@tesouro/embedded-components-react 0.11.234 → 0.11.236

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 (77) hide show
  1. package/README.md +53 -2
  2. package/dist/index.css +30 -0
  3. package/dist/index.d.ts +24 -0
  4. package/dist/lib/ReceivablesWidget.d.ts +24 -0
  5. package/dist/lib/WidgetSuite.d.ts +24 -0
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index.js +6 -6
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +198 -118
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +76 -194
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +67 -75
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +111 -69
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +459 -108
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +101 -449
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +9 -117
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +85 -8
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +67 -73
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +246 -71
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +40 -251
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +237 -38
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +21 -244
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +529 -21
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +4 -530
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +44 -4
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +242 -41
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +3 -245
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js +5 -3
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index50.js +63 -4
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index51.js +1 -64
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +1 -1
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +386 -354
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +1 -0
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +1 -1
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +1 -1
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +260 -258
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +219 -179
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +26 -25
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +15 -0
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +31 -40
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +18 -17
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +40 -8
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +30 -63
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +463 -27
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +15 -29
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +8 -18
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +18 -18
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +19 -30
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +15 -66
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +66 -391
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +148 -2
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +173 -43
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +3 -71
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +37 -432
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +66 -188
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +455 -22
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +191 -5
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +23 -0
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +5 -265
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +261 -125
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +2 -27
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +122 -230
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +27 -3
  61. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +216 -224
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js +3 -30
  63. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index59.js +228 -168
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index60.js +29 -21
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index61.js +152 -109
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index62.js +22 -2
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index63.js +140 -43
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index64.js +2 -0
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index65.js +47 -0
  70. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/document-preview.js +1 -0
  71. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  72. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/document/documentPreview.js +122 -0
  73. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/WidgetFrame/WidgetFrame.js +1 -1
  74. package/dist/packages/shared-ui-shadcn/dist/index.js +4584 -4551
  75. package/package.json +1 -1
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index52.js +0 -1
  77. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +0 -2
@@ -63,59 +63,59 @@ function ft(e, t) {
63
63
  };
64
64
  }
65
65
  function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, canCreateCustomer: v = !0, onCreated: ht, onUpdated: gt }) {
66
- let _t = Ue(), vt = Ge(), yt = Ke(), bt = Je(), xt = We(), St = o(), y = g("draft"), Ct = g(!1), [wt, Tt] = _(), b = g(!1), x = g(!1), Et = g(null), S = g(void 0), C = g([]), Dt = g(""), [w, T] = _(!1), [E, Ot] = _("create"), [kt, At] = _(!1), [jt, Mt] = _(), [Nt, Pt] = _(), [D, O] = _(() => je()), k = g(D), [Ft, A] = _(!1), [It, j] = _({}), [Lt, Rt] = _("none"), zt = Xe(), M = Ye(), N = M.data?.data, { unitNamesById: P } = zt, [Bt, Vt] = _(), [F, Ht] = _(!1), Ut = g(!1), I = g(!1), L = g(!1), R = g({
66
+ let _t = Ue(), vt = Ge(), yt = Ke(), bt = Je(), xt = We(), St = o(), y = g("draft"), Ct = g(!1), [wt, Tt] = _(), b = g(!1), x = g(!1), Et = g(null), S = g(void 0), C = g([]), Dt = g(""), [w, T] = _(!1), [E, Ot] = _("create"), [kt, At] = _(!1), [jt, Mt] = _(), [Nt, Pt] = _(), [Ft, It] = _(), [D, O] = _(() => je()), k = g(D), [Lt, A] = _(!1), [Rt, j] = _({}), [zt, Bt] = _("none"), Vt = Xe(), M = Ye(), N = M.data?.data, { unitNamesById: P } = Vt, [Ht, Ut] = _(), [F, Wt] = _(!1), Gt = g(!1), I = g(!1), L = g(!1), R = g({
67
67
  lines: !1,
68
68
  discount: !1
69
- }), [Wt, Gt] = _(!1), [Kt, qt] = _(!1), Jt = h(() => t(), []), Yt = h(() => ({
69
+ }), [Kt, z] = _(!1), [qt, Jt] = _(!1), Yt = h(() => t(), []), Xt = h(() => ({
70
70
  ...i,
71
71
  ...pt
72
- }), [pt]), Xt = s(D.customerId), Zt = a(D.customerId || void 0), Qt = Xt.data?.data?.[0], { billingAddressId: $t, billingAddress: en, shippingAddressId: tn } = Le({
72
+ }), [pt]), Zt = s(D.customerId), Qt = a(D.customerId || void 0), $t = Zt.data?.data?.[0], { billingAddressId: en, billingAddress: tn, shippingAddressId: nn } = Le({
73
73
  values: D,
74
- counterpart: Zt.data,
75
- addresses: Xt.data?.data
76
- }), z = !!D.customerId && (Xt.isLoading || Zt.isLoading), B = et({
74
+ counterpart: Qt.data,
75
+ addresses: Zt.data?.data
76
+ }), B = !!D.customerId && (Zt.isLoading || Qt.isLoading), V = et({
77
77
  counterpartId: D.customerId,
78
- billingAddressId: $t,
79
- billingCountry: en?.country,
78
+ billingAddressId: en,
79
+ billingCountry: tn?.country,
80
80
  inlineCustomerType: v && !D.customerId && D.customerName.trim() ? Be : void 0,
81
- isAddressesLoading: z
82
- }), nn = B.isLoading || z, rn = p((e) => {
81
+ isAddressesLoading: B
82
+ }), rn = V.isLoading || B, an = p((e) => {
83
83
  O((t) => ({
84
84
  ...t,
85
85
  attachments: e(t.attachments)
86
86
  }));
87
- }, []), V = it({
87
+ }, []), H = it({
88
88
  attachments: D.attachments,
89
- setAttachments: rn,
90
- receivableId: jt
91
- }), { reset: H, discardUploads: an, commitRemovals: on } = V, sn = D.type === "invoice" ? he({
89
+ setAttachments: an,
90
+ receivableId: Nt
91
+ }), { reset: U, discardUploads: on, commitRemovals: sn } = H, cn = D.type === "invoice" ? he({
92
92
  attachments: D.attachments,
93
- pendingUploads: V.pendingUploads,
94
- isCountLimitReached: V.isCountLimitReached,
93
+ pendingUploads: H.pendingUploads,
94
+ isCountLimitReached: H.isCountLimitReached,
95
95
  isRecurring: f(D),
96
96
  messages: d
97
- }) : void 0, cn = p((e) => {
97
+ }) : void 0, ln = p((e) => {
98
98
  e && O((t) => dt(t, e));
99
- }, []), ln = c({
100
- view: Lt,
101
- setView: Rt,
99
+ }, []), un = c({
100
+ view: zt,
101
+ setView: Bt,
102
102
  selectedId: D.customerId || void 0,
103
- setSelectedId: cn,
104
- messages: Yt,
103
+ setSelectedId: ln,
104
+ messages: Xt,
105
105
  counterpartType: "customer",
106
106
  counterpart: void 0,
107
- primaryAddress: Qt
108
- }), { openCreate: un, setValues: dn } = ln, fn = p(() => {
109
- un(), dn((e) => He(e, {
107
+ primaryAddress: $t
108
+ }), { openCreate: dn, setValues: fn } = un, pn = p(() => {
109
+ dn(), fn((e) => He(e, {
110
110
  name: D.customerName,
111
111
  email: D.customerEmail
112
112
  }));
113
113
  }, [
114
- un,
115
114
  dn,
115
+ fn,
116
116
  D.customerName,
117
117
  D.customerEmail
118
- ]), pn = p((e) => O((t) => {
118
+ ]), mn = p((e) => O((t) => {
119
119
  let n = e({
120
120
  paymentTermsId: t.paymentTermsId,
121
121
  paymentTermsCustomDate: t.paymentTermsCustomDate
@@ -125,14 +125,14 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
125
125
  ...n,
126
126
  ...n.paymentTermsId === "receipt_due" ? { paymentReminderId: "" } : {}
127
127
  };
128
- }), []), mn = at({
128
+ }), []), hn = at({
129
129
  paymentTermsId: D.paymentTermsId,
130
130
  paymentTermsCustomDate: D.paymentTermsCustomDate,
131
131
  issueDate: D.issueDate,
132
132
  isRecurring: D.type === "invoice" && f(D),
133
133
  messages: d,
134
- onChange: pn
135
- }), hn = mn.reset, gn = p((e, { automatic: t = !1 } = {}) => {
134
+ onChange: mn
135
+ }), gn = hn.reset, _n = p((e, { automatic: t = !1 } = {}) => {
136
136
  t && (k.current = {
137
137
  ...k.current,
138
138
  ...e
@@ -140,18 +140,18 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
140
140
  ...t,
141
141
  ...e
142
142
  }));
143
- }, []), U = st({
143
+ }, []), W = st({
144
144
  open: w,
145
145
  bankAccountId: D.bankAccountId,
146
146
  bankAccountType: D.bankAccountType,
147
147
  embeddedBankName: mt,
148
148
  messages: d,
149
- onSelect: gn
150
- }), _n = U.reset, vn = qe(Nt), W = Nt ? vn.data : void 0, G = ve(W), yn = G > 0, K = !!Nt && vn.isLoading, bn = g(void 0);
149
+ onSelect: _n
150
+ }), vn = W.reset, yn = qe(Ft), G = Ft ? yn.data : void 0, K = ve(G), bn = K > 0, q = !!Ft && yn.isLoading, xn = g(void 0);
151
151
  m(() => {
152
- if (!W || bn.current === W.id) return;
153
- bn.current = W.id;
154
- let e = be(W);
152
+ if (!G || xn.current === G.id) return;
153
+ xn.current = G.id;
154
+ let e = be(G);
155
155
  k.current = {
156
156
  ...k.current,
157
157
  ...e
@@ -159,21 +159,21 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
159
159
  ...t,
160
160
  ...e
161
161
  }));
162
- }, [W]);
163
- let xn = p((e) => O(e), []), Sn = p((e) => j((t) => {
162
+ }, [G]);
163
+ let Sn = p((e) => O(e), []), Cn = p((e) => j((t) => {
164
164
  if (!e.some((e) => e in t)) return t;
165
165
  let n = { ...t };
166
166
  return e.forEach((e) => delete n[e]), n;
167
- }), []), Cn = g([]), wn = p((e) => {
168
- F ? Cn.current.push(...e) : Sn(e);
169
- }, [Sn, F]);
167
+ }), []), wn = g([]), Tn = p((e) => {
168
+ F ? wn.current.push(...e) : Cn(e);
169
+ }, [Cn, F]);
170
170
  m(() => {
171
- let e = Cn.current;
171
+ let e = wn.current;
172
172
  if (!e.length) return;
173
- Cn.current = [];
173
+ wn.current = [];
174
174
  let t = xe({
175
175
  fields: D,
176
- issuedCount: G,
176
+ issuedCount: K,
177
177
  messages: d
178
178
  });
179
179
  j((n) => {
@@ -183,68 +183,68 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
183
183
  }), r;
184
184
  });
185
185
  }, [
186
- G,
186
+ K,
187
187
  d,
188
188
  D
189
189
  ]);
190
- let Tn = ot({
190
+ let En = ot({
191
191
  values: D,
192
- errors: It,
193
- lockSchedule: yn,
192
+ errors: Rt,
193
+ lockSchedule: bn,
194
194
  requireRepeat: E === "create" && kt,
195
195
  messages: d,
196
- onChange: xn,
197
- onClearErrors: Sn,
198
- onRevalidateErrors: wn
199
- }), q = Tn.reset, En = p((e) => O((t) => ({
196
+ onChange: Sn,
197
+ onClearErrors: Cn,
198
+ onRevalidateErrors: Tn
199
+ }), J = En.reset, Dn = p((e) => O((t) => ({
200
200
  ...t,
201
201
  ...e
202
- })), []), J = St.isPending || _t.isPending || vt.isPending || yt.isPending || bt.isPending || xt.isPending, Dn = ct({
202
+ })), []), Y = St.isPending || _t.isPending || vt.isPending || yt.isPending || bt.isPending || xt.isPending, On = ct({
203
203
  open: w,
204
204
  isInvoice: D.type === "invoice",
205
- disabled: J,
205
+ disabled: Y,
206
206
  paymentTermsId: D.paymentTermsId,
207
207
  paymentTermsCustomDate: D.paymentTermsCustomDate,
208
208
  paymentReminderId: D.paymentReminderId,
209
209
  overdueReminderId: D.overdueReminderId,
210
210
  messages: d,
211
- onSelect: En
212
- }), On = Dn.reset, kn = p(() => {
213
- C.current = [], Vt(void 0), Ot("create"), At(!1), Mt(void 0), Pt(void 0), bn.current = void 0, S.current = void 0, y.current = "draft", b.current = !1, x.current = !1, O(je()), A(!1), j({}), Ht(!1), Gt(!1), R.current = {
211
+ onSelect: Dn
212
+ }), kn = On.reset, An = p(() => {
213
+ C.current = [], Ut(void 0), Ot("create"), At(!1), Pt(void 0), It(void 0), xn.current = void 0, S.current = void 0, y.current = "draft", b.current = !1, x.current = !1, O(je()), A(!1), j({}), Wt(!1), z(!1), R.current = {
214
214
  lines: !1,
215
215
  discount: !1
216
- }, H(), q();
217
- }, [H, q]), An = p((e = "invoice", { customerId: t = "", recurring: n = !1 } = {}) => {
218
- hn(), _n(), q();
216
+ }, U(), J();
217
+ }, [U, J]), jn = p((e = "invoice", { customerId: t = "", recurring: n = !1 } = {}) => {
218
+ gn(), vn(), J();
219
219
  let r = {
220
220
  ...je(),
221
221
  type: e,
222
222
  customerId: t
223
223
  }, i = n ? ye(r) : r;
224
- On($e(i)), C.current = [], S.current = void 0, y.current = "draft", b.current = !1, x.current = !1, bn.current = void 0, Vt(void 0), Ot("create"), At(n), Mt(void 0), Pt(void 0), k.current = i, O(i), A(!1), j({}), H(), Ht(!1), Gt(!1), R.current = {
224
+ kn($e(i)), C.current = [], S.current = void 0, y.current = "draft", b.current = !1, x.current = !1, xn.current = void 0, Ut(void 0), Ot("create"), At(n), Pt(void 0), It(void 0), k.current = i, O(i), A(!1), j({}), U(), Wt(!1), z(!1), R.current = {
225
225
  lines: !1,
226
226
  discount: !1
227
227
  }, T(!0);
228
228
  }, [
229
- H,
230
- hn,
231
- _n,
232
- q,
233
- On
234
- ]), jn = p((e, { highlightForIssue: t = !1 } = {}) => {
229
+ U,
230
+ gn,
231
+ vn,
232
+ J,
233
+ kn
234
+ ]), Mn = p((e, { highlightForIssue: t = !1 } = {}) => {
235
235
  if (e.type === "credit_note") return;
236
- hn(), _n(), q();
236
+ gn(), vn(), J();
237
237
  let n = Ie(e, N);
238
- On($e(n)), C.current = e.line_items, Dt.current = e.currency, S.current = void 0, y.current = "draft", b.current = !1, x.current = t, bn.current = void 0, Vt(void 0), Ot("edit"), Mt(e.id), Pt(e.type === "invoice" ? e.recurrence_id ?? void 0 : void 0), k.current = n, O(n), A(!1), j({}), Ht(!1), Gt(!1), R.current = {
238
+ kn($e(n)), C.current = e.line_items, Dt.current = e.currency, S.current = void 0, y.current = "draft", b.current = !1, x.current = t, xn.current = void 0, Ut(void 0), Ot("edit"), Mt(e), Pt(e.id), It(e.type === "invoice" ? e.recurrence_id ?? void 0 : void 0), k.current = n, O(n), A(!1), j({}), Wt(!1), z(!1), R.current = {
239
239
  lines: !1,
240
240
  discount: !1
241
- }, H(), T(!0);
241
+ }, U(), T(!0);
242
242
  }, [
243
- H,
244
- hn,
245
- _n,
246
- q,
247
- On,
243
+ U,
244
+ gn,
245
+ vn,
246
+ J,
247
+ kn,
248
248
  N
249
249
  ]);
250
250
  m(() => {
@@ -259,19 +259,19 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
259
259
  };
260
260
  }));
261
261
  }, [N]);
262
- let Y = V.isUploading, Mn = p(() => {
263
- Y || (an(), A(!1), T(!1), j({}));
264
- }, [an, Y]), Nn = p(() => {
265
- Ft ? A(!1) : Y ? e.error(d.attachmentsUploading) : ut(k.current, D) ? A(!0) : Mn();
262
+ let X = H.isUploading, Nn = p(() => {
263
+ X || (on(), A(!1), T(!1), j({}));
264
+ }, [on, X]), Pn = p(() => {
265
+ Lt ? A(!1) : X ? e.error(d.attachmentsUploading) : ut(k.current, D) ? A(!0) : Nn();
266
266
  }, [
267
- Mn,
268
- Y,
267
+ Nn,
268
+ X,
269
269
  d.attachmentsUploading,
270
- Ft,
270
+ Lt,
271
271
  D
272
- ]), Pn = p((e) => {
272
+ ]), Fn = p(() => ut(k.current, D), [D]), In = p((e) => {
273
273
  let t = { ...e };
274
- t.taxRate !== void 0 && (t.taxRate = le(t.taxRate), L.current = !0), t.type !== void 0 && t.type !== "invoice" && an(), t.discount !== void 0 && qt(!1), t.discount !== void 0 && F && (I.current = !0), t.discountType !== void 0 && (I.current = !0), t.currency !== void 0 && (Ut.current = !0), O((e) => {
274
+ t.taxRate !== void 0 && (t.taxRate = le(t.taxRate), L.current = !0), t.type !== void 0 && t.type !== "invoice" && on(), t.discount !== void 0 && Jt(!1), t.discount !== void 0 && F && (I.current = !0), t.discountType !== void 0 && (I.current = !0), t.currency !== void 0 && (Gt.current = !0), O((e) => {
275
275
  let n = {
276
276
  ...t.customerId === void 0 ? e : dt(e, t.customerId),
277
277
  ...t
@@ -285,14 +285,14 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
285
285
  currency: n.currency
286
286
  })), n;
287
287
  });
288
- }, [an, F]), Fn = p(() => {
289
- Gt(!0), qt(Te(D.discount, D.discountType, D.currency) === 0);
288
+ }, [on, F]), Ln = p(() => {
289
+ z(!0), Jt(Te(D.discount, D.discountType, D.currency) === 0);
290
290
  }, [
291
291
  D.discount,
292
292
  D.discountType,
293
293
  D.currency
294
- ]), In = p(() => {
295
- Gt(!1), I.current = !0, O((e) => ({
294
+ ]), Rn = p(() => {
295
+ z(!1), I.current = !0, O((e) => ({
296
296
  ...e,
297
297
  discount: Ce({
298
298
  value: e.discount,
@@ -300,7 +300,7 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
300
300
  currency: e.currency
301
301
  })
302
302
  }));
303
- }, []), Ln = p(() => {
303
+ }, []), zn = p(() => {
304
304
  let e = ze({
305
305
  values: D,
306
306
  messages: d,
@@ -315,7 +315,7 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
315
315
  v,
316
316
  d,
317
317
  D
318
- ]), Rn = p(() => {
318
+ ]), Bn = p(() => {
319
319
  L.current = !0, O((e) => {
320
320
  let t = l(e.taxRate);
321
321
  return t === e.taxRate ? e : {
@@ -323,17 +323,17 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
323
323
  taxRate: t
324
324
  };
325
325
  });
326
- }, []), X = p((e, { validate: t }) => {
327
- t && (Ut.current = !0), O((t) => ({
326
+ }, []), Z = p((e, { validate: t }) => {
327
+ t && (Gt.current = !0), O((t) => ({
328
328
  ...t,
329
329
  lineItems: e(t.lineItems)
330
330
  }));
331
331
  }, []);
332
332
  m(() => {
333
- let e = Ut.current, t = I.current;
333
+ let e = Gt.current, t = I.current;
334
334
  if (!e && !t && !L.current) return;
335
- Ut.current = !1, I.current = !1, L.current = !1, e && (R.current.lines = !0), t && (R.current.discount = !0);
336
- let n = b.current || G > 0, r = e ? me(D.lineItems, {
335
+ Gt.current = !1, I.current = !1, L.current = !1, e && (R.current.lines = !0), t && (R.current.discount = !0);
336
+ let n = b.current || K > 0, r = e ? me(D.lineItems, {
337
337
  currency: D.currency,
338
338
  messages: d,
339
339
  requireComplete: n
@@ -343,18 +343,18 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
343
343
  return R.current.lines && (i.lineItems = e ? r : t.lineItems, i.lineItemsSummary = fe(i.lineItems, Ae(D, d), n && D.lineItems.length === 0 ? d.lineItemsRequired : void 0)), R.current.discount && (i.discount = ke(D, d)), i;
344
344
  });
345
345
  }, [
346
- G,
346
+ K,
347
347
  d,
348
348
  D
349
349
  ]);
350
- let zn = p((e, t) => {
350
+ let Vn = p((e, t) => {
351
351
  let { unit: n, ...r } = t, i = ce(r);
352
- i.name !== void 0 && (i.productId = ""), n !== void 0 && (i.measureUnitId = n, i.measureUnitName = ""), i.taxable !== void 0 && (L.current = !0), X((t) => t.map((t) => t.id === e ? {
352
+ i.name !== void 0 && (i.productId = ""), n !== void 0 && (i.measureUnitId = n, i.measureUnitName = ""), i.taxable !== void 0 && (L.current = !0), Z((t) => t.map((t) => t.id === e ? {
353
353
  ...t,
354
354
  ...i
355
355
  } : t), { validate: F });
356
- }, [X, F]), Bn = p((e, t) => {
357
- X((n) => n.map((n) => n.id === e ? {
356
+ }, [Z, F]), Hn = p((e, t) => {
357
+ Z((n) => n.map((n) => n.id === e ? {
358
358
  ...n,
359
359
  ...ae({
360
360
  product: t,
@@ -363,59 +363,59 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
363
363
  })
364
364
  } : n), { validate: !0 });
365
365
  }, [
366
- X,
366
+ Z,
367
367
  P,
368
368
  D.currency
369
- ]), Vn = p((e, t) => {
370
- t && X((n) => t.kind === "remove" ? n.filter((t) => t.id !== e) : n.map((n) => n.id === e ? {
369
+ ]), Un = p((e, t) => {
370
+ t && Z((n) => t.kind === "remove" ? n.filter((t) => t.id !== e) : n.map((n) => n.id === e ? {
371
371
  ...n,
372
372
  ...t.patch
373
373
  } : n), { validate: !0 });
374
- }, [X]), Hn = p((e, t) => {
374
+ }, [Z]), Wn = p((e, t) => {
375
375
  let n = D.lineItems.find((t) => t.id === e);
376
- n && Vn(e, ne({
376
+ n && Un(e, ne({
377
377
  lineItem: n,
378
378
  field: t,
379
379
  rowCount: D.lineItems.length,
380
380
  currency: D.currency
381
381
  }));
382
382
  }, [
383
- Vn,
383
+ Un,
384
384
  D.currency,
385
385
  D.lineItems
386
- ]), Un = p((e, t) => {
386
+ ]), Gn = p((e, t) => {
387
387
  let n = D.lineItems.find((t) => t.id === e);
388
- n && Vn(e, ue({
388
+ n && Un(e, ue({
389
389
  lineItem: n,
390
390
  step: t,
391
391
  rowCount: D.lineItems.length
392
392
  }));
393
- }, [Vn, D.lineItems]), Wn = p(() => {
393
+ }, [Un, D.lineItems]), Kn = p(() => {
394
394
  let e = re(D.currency);
395
- Vt(e.id), O((t) => ({
395
+ Ut(e.id), O((t) => ({
396
396
  ...t,
397
397
  lineItems: [...t.lineItems, e]
398
398
  }));
399
- }, [D.currency]), Gn = p((e) => {
400
- X((t) => t.length <= 1 ? t : t.filter((t) => t.id !== e), { validate: !0 });
401
- }, [X]), Kn = p((e, t) => e.type === "invoice" && (t === "issue" || Se(e) && G === 0), [G]), qn = p((e, t) => ({
399
+ }, [D.currency]), qn = p((e) => {
400
+ Z((t) => t.length <= 1 ? t : t.filter((t) => t.id !== e), { validate: !0 });
401
+ }, [Z]), Jn = p((e, t) => e.type === "invoice" && (t === "issue" || Se(e) && K === 0), [K]), Yn = p((e, t) => ({
402
402
  ...ze({
403
403
  values: e,
404
404
  messages: d,
405
405
  willIssue: t,
406
- hasStartedRecurrence: G > 0,
406
+ hasStartedRecurrence: K > 0,
407
407
  canCreateCustomer: v
408
408
  }),
409
409
  ...e.type === "invoice" && f(e) ? xe({
410
410
  fields: e,
411
- issuedCount: G,
411
+ issuedCount: K,
412
412
  messages: d
413
413
  }) : {}
414
414
  }), [
415
415
  v,
416
- G,
416
+ K,
417
417
  d
418
- ]), Jn = p(() => {
418
+ ]), Xn = p(() => {
419
419
  requestAnimationFrame(() => {
420
420
  let e = Et.current, t = e?.querySelector("[aria-invalid=\"true\"], [data-invalid=\"true\"]");
421
421
  if (!e || !t) return;
@@ -425,31 +425,31 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
425
425
  behavior: "smooth"
426
426
  });
427
427
  });
428
- }, []), Yn = p((e, t) => {
429
- j(e), Ht(!0), b.current = t, R.current = {
428
+ }, []), Zn = p((e, t) => {
429
+ j(e), Wt(!0), b.current = t, R.current = {
430
430
  lines: !0,
431
431
  discount: !0
432
- }, Jn();
433
- }, [Jn]), Xn = !Nt || D.frequency !== "once" || vn.isError;
432
+ }, Xn();
433
+ }, [Xn]), Qn = !Ft || D.frequency !== "once" || yn.isError;
434
434
  m(() => {
435
- if (!w || !x.current || z || K || !Xn) return;
435
+ if (!w || !x.current || B || q || !Qn) return;
436
436
  x.current = !1;
437
- let e = Kn(D, "issue");
438
- Yn(qn(D, e), e);
437
+ let e = Jn(D, "issue");
438
+ Zn(Yn(D, e), e);
439
439
  }, [
440
- z,
440
+ B,
441
441
  w,
442
- Xn,
443
- K,
442
+ Qn,
443
+ q,
444
+ Zn,
444
445
  Yn,
445
- qn,
446
446
  D,
447
- Kn
447
+ Jn
448
448
  ]);
449
- let Zn = g({ values: D });
449
+ let $n = g({ values: D });
450
450
  m(() => {
451
- let e = Zn.current;
452
- if (Zn.current = { values: D }, !F) return;
451
+ let e = $n.current;
452
+ if ($n.current = { values: D }, !F) return;
453
453
  let t = [
454
454
  "customerId",
455
455
  "customerEmail",
@@ -479,13 +479,13 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
479
479
  F,
480
480
  D
481
481
  ]);
482
- let Qn = p(async (t) => {
483
- if (y.current = t, K) return;
484
- if (Y) {
482
+ let er = p(async (t) => {
483
+ if (y.current = t, q) return;
484
+ if (X) {
485
485
  e.error(d.attachmentsUploading);
486
486
  return;
487
487
  }
488
- if (M.isLoading || z) {
488
+ if (M.isLoading || B) {
489
489
  e.error(d.lineItemsLoading);
490
490
  return;
491
491
  }
@@ -494,27 +494,27 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
494
494
  lineItems: i
495
495
  };
496
496
  a !== D && O(a);
497
- let o = a.type === "invoice" && f(a), s = Kn(a, t);
498
- if (s && (nn || U.isLoading)) {
497
+ let o = a.type === "invoice" && f(a), s = Jn(a, t);
498
+ if (s && (rn || W.isLoading)) {
499
499
  e.error(d.issueChecksLoading);
500
500
  return;
501
501
  }
502
- if (s && !U.canAddAccount && !a.bankAccountId && !U.hasAccounts) {
502
+ if (s && !W.canAddAccount && !a.bankAccountId && !W.hasAccounts) {
503
503
  e.error(d.issueBankAccountUnavailable);
504
504
  return;
505
505
  }
506
- let c = qn(a, s);
506
+ let c = Yn(a, s);
507
507
  if (Me(c)) {
508
- Yn(c, s);
508
+ Zn(c, s);
509
509
  return;
510
510
  }
511
- if (j({}), s && B.isTaxIdMissing) {
511
+ if (j({}), s && V.isTaxIdMissing) {
512
512
  e.error(d.issueTaxIdRequired);
513
513
  return;
514
514
  }
515
515
  let te = v && !a.customerId && !!a.customerName.trim(), ne = a.customerEmail.trim();
516
516
  if (s && (a.paymentReminderId || a.overdueReminderId)) {
517
- let t = te ? ne ? void 0 : d.issueRemindersNoEmail : Qe(B.counterpart, d);
517
+ let t = te ? ne ? void 0 : d.issueRemindersNoEmail : Qe(V.counterpart, d);
518
518
  if (t) {
519
519
  e.error(t);
520
520
  return;
@@ -536,7 +536,7 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
536
536
  let n = t;
537
537
  O((e) => ft(e, n));
538
538
  }
539
- let l = E === "edit" ? jt : S.current, u, re, ie = "", ae = {};
539
+ let l = E === "edit" ? Nt : S.current, u, re, ie = "", ae = {};
540
540
  try {
541
541
  if (l) {
542
542
  let e = Pe({
@@ -555,12 +555,12 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
555
555
  path: { receivable_id: l },
556
556
  body: Fe({
557
557
  values: a,
558
- billingAddressId: $t,
559
- shippingAddressId: tn,
558
+ billingAddressId: en,
559
+ shippingAddressId: nn,
560
560
  lineItemChanges: e
561
561
  })
562
562
  });
563
- on(), u = l, re = t?.type ?? a.type, o && t && (C.current = t.line_items, Dt.current = t.currency, a = {
563
+ sn(), u = l, re = t?.type ?? a.type, o && t && (C.current = t.line_items, Dt.current = t.currency, a = {
564
564
  ...a,
565
565
  lineItems: oe(a.lineItems, t.line_items)
566
566
  }, O(a));
@@ -568,12 +568,12 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
568
568
  ae = Re({ values: a });
569
569
  let e = await _t.mutateAsync({ body: Ne({
570
570
  values: a,
571
- billingAddressId: $t,
572
- shippingAddressId: tn,
571
+ billingAddressId: en,
572
+ shippingAddressId: nn,
573
573
  unitNamesById: P
574
574
  }) });
575
575
  if (!e?.id) {
576
- T(!1), kn();
576
+ T(!1), An();
577
577
  return;
578
578
  }
579
579
  u = e.id, re = e.type, ie = e.counterpart_name ?? "", o && (S.current = e.id, C.current = e.line_items, Dt.current = e.currency, a = {
@@ -588,7 +588,7 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
588
588
  });
589
589
  e.error((l ? d.updateFailed : d.createFailed).replace("{errorMessage}", i));
590
590
  let { errors: ee, listError: o } = nt(r(t, n), ae), c = fe(ee.lineItems, void 0, o);
591
- Yn({
591
+ Zn({
592
592
  ...ee,
593
593
  ...c ? { lineItemsSummary: c } : {}
594
594
  }, s);
@@ -596,9 +596,9 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
596
596
  }
597
597
  let se = o ? "recurrence" : "draft";
598
598
  if (o) try {
599
- W ? (await bt.mutateAsync({
600
- path: { recurrence_id: W.id },
601
- body: _e(a, { lockSchedule: yn })
599
+ G ? (await bt.mutateAsync({
600
+ path: { recurrence_id: G.id },
601
+ body: _e(a, { lockSchedule: bn })
602
602
  }), e.success(d.recurrenceUpdated)) : (await yt.mutateAsync({ body: ge(a, u) }), e.success(d.recurrenceActivated));
603
603
  } catch (t) {
604
604
  e.error(rt(t, { messages: d }));
@@ -611,93 +611,93 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
611
611
  }
612
612
  else E === "create" ? e.success(d.createSucceeded.replace("{customer}", ie)) : e.success(d.updateSucceeded);
613
613
  let ce = E === "create" ? ht : gt;
614
- T(!1), kn(), ce?.(u, re, {
614
+ T(!1), An(), ce?.(u, re, {
615
615
  mode: se,
616
616
  counterpartId: a.customerId,
617
617
  inlineItems: Ze(a.lineItems, a.currency),
618
- hasCustomerEmail: te ? !!ne : !!(B.counterpart && ee(B.counterpart).trim())
618
+ hasCustomerEmail: te ? !!ne : !!(V.counterpart && ee(V.counterpart).trim())
619
619
  });
620
620
  }, [
621
- U.canAddAccount,
622
- U.hasAccounts,
623
- U.isLoading,
624
- $t,
621
+ W.canAddAccount,
622
+ W.hasAccounts,
623
+ W.isLoading,
624
+ en,
625
625
  v,
626
- on,
626
+ sn,
627
627
  St,
628
628
  _t,
629
629
  yt,
630
- jt,
631
- W,
632
- z,
633
- Y,
634
- nn,
630
+ Nt,
631
+ G,
632
+ B,
633
+ X,
634
+ rn,
635
635
  xt,
636
- yn,
636
+ bn,
637
637
  d,
638
638
  E,
639
639
  ht,
640
640
  gt,
641
- B.counterpart,
642
- B.isTaxIdMissing,
643
- K,
644
- kn,
645
- tn,
646
- Yn,
641
+ V.counterpart,
642
+ V.isTaxIdMissing,
643
+ q,
644
+ An,
645
+ nn,
646
+ Zn,
647
647
  N,
648
648
  P,
649
649
  M.isLoading,
650
650
  vt,
651
651
  bt,
652
- qn,
652
+ Yn,
653
653
  D,
654
- Kn
655
- ]), Z = p(async (e = y.current) => {
654
+ Jn
655
+ ]), Q = p(async (e = y.current) => {
656
656
  if (!Ct.current) {
657
657
  Ct.current = !0, Tt(e);
658
658
  try {
659
- await Qn(e);
659
+ await er(e);
660
660
  } finally {
661
661
  Ct.current = !1, Tt(void 0);
662
662
  }
663
663
  }
664
- }, [Qn]), $n = h(() => ({
664
+ }, [er]), tr = h(() => ({
665
665
  ...D,
666
- discount: Wt ? Kt ? "" : D.discount : we(Te(D.discount, D.discountType, D.currency), D.discountType, D.currency),
666
+ discount: Kt ? qt ? "" : D.discount : we(Te(D.discount, D.discountType, D.currency), D.discountType, D.currency),
667
667
  lineItems: D.lineItems.map(pe)
668
668
  }), [
669
+ qt,
669
670
  Kt,
670
- Wt,
671
671
  D
672
- ]), er = h(() => te(D.lineItems), [D.lineItems]), tr = h(() => Oe(D), [D]), nr = D.type === "invoice", Q = nr && f(D), rr = J || M.isLoading || U.isLoading, ir = rr || z || V.isUploading || K, ar = E === "edit" ? d.updateDraftButton : d.saveDraftButton, or = Q ? W ? d.recurrenceUpdateButton : d.recurrenceActivateButton : nr ? d.issueButton : ar, $ = nr && !Q ? "issue" : "draft", sr = p(() => Z("draft"), [Z]), cr = p(() => Z($), [$, Z]), lr = p(() => Z(), [Z]), ur = p(() => {
672
+ ]), nr = h(() => te(D.lineItems), [D.lineItems]), rr = h(() => Oe(D), [D]), ir = D.type === "invoice", $ = ir && f(D), ar = Y || M.isLoading || W.isLoading, or = ar || B || H.isUploading || q, sr = E === "edit" ? d.updateDraftButton : d.saveDraftButton, cr = $ ? G ? d.recurrenceUpdateButton : d.recurrenceActivateButton : ir ? d.issueButton : sr, lr = ir && !$ ? "issue" : "draft", ur = p(() => Q("draft"), [Q]), dr = p(() => Q(lr), [lr, Q]), fr = p(() => Q(), [Q]), pr = p(() => {
673
673
  y.current = "draft";
674
- }, []), dr = p(() => {
675
- y.current = $;
676
- }, [$]), fr = ir || Q, pr = p(async () => {
677
- if (!fr) try {
678
- await Z("draft");
674
+ }, []), mr = p(() => {
675
+ y.current = lr;
676
+ }, [lr]), hr = or || $, gr = p(async () => {
677
+ if (!hr) try {
678
+ await Q("draft");
679
679
  } finally {
680
680
  A(!1);
681
681
  }
682
- }, [fr, Z]), mr = p(() => A(!1), []), hr = h(() => ({
683
- open: Ft,
684
- onSaveDraft: () => void pr(),
685
- onDiscard: Mn,
686
- onCancel: mr,
687
- isSaving: J,
688
- isSaveDraftDisabled: fr
682
+ }, [hr, Q]), _r = p(() => A(!1), []), vr = h(() => ({
683
+ open: Lt,
684
+ onSaveDraft: () => void gr(),
685
+ onDiscard: Nn,
686
+ onCancel: _r,
687
+ isSaving: Y,
688
+ isSaveDraftDisabled: hr
689
689
  }), [
690
- mr,
691
- Mn,
692
- J,
693
- fr,
694
- pr,
695
- Ft
696
- ]), gr = h(() => De(tr, D.currency), [tr, D.currency]), _r = lt({
690
+ _r,
691
+ Nn,
692
+ Y,
693
+ hr,
694
+ gr,
695
+ Lt
696
+ ]), yr = h(() => De(rr, D.currency), [rr, D.currency]), br = lt({
697
697
  values: D,
698
- totals: tr,
699
- billingAddress: en,
700
- bankAccount: U.selectedAccount,
698
+ totals: rr,
699
+ billingAddress: tn,
700
+ bankAccount: W.selectedAccount,
701
701
  unitNamesById: P,
702
702
  messages: d,
703
703
  enabled: w
@@ -706,72 +706,74 @@ function pt({ messages: d, counterpartMessageLabels: pt, embeddedBankName: mt, c
706
706
  open: w,
707
707
  setOpen: T,
708
708
  mode: E,
709
- dialogMode: E === "create" && Q ? "createRecurring" : E,
709
+ dialogMode: E === "create" && $ ? "createRecurring" : E,
710
710
  values: D,
711
- sheetValues: $n,
712
- errors: It,
711
+ sheetValues: tr,
712
+ errors: Rt,
713
713
  setValues: O,
714
- updateValues: Pn,
715
- commitTaxRate: Rn,
716
- commitCustomerEmail: Ln,
717
- focusDiscount: Fn,
718
- commitDiscount: In,
719
- updateLineItem: zn,
720
- selectProduct: Bn,
721
- commitLineItem: Hn,
722
- stepLineItem: Un,
723
- addLineItem: Wn,
724
- removeLineItem: Gn,
725
- attachmentsView: sn,
726
- attachmentsUploading: V.isUploading,
727
- draftButtonLabel: nr && !Q ? ar : void 0,
728
- draftDisabled: ir,
729
- draftLoading: J && wt === "draft",
730
- primaryButtonLabel: or,
731
- primaryLoading: J && wt === $,
732
- primaryDisabled: ir || nr && (nn || !Q && B.isCounterpartLoading),
714
+ updateValues: In,
715
+ commitTaxRate: Bn,
716
+ commitCustomerEmail: zn,
717
+ focusDiscount: Ln,
718
+ commitDiscount: Rn,
719
+ updateLineItem: Vn,
720
+ selectProduct: Hn,
721
+ commitLineItem: Wn,
722
+ stepLineItem: Gn,
723
+ addLineItem: Kn,
724
+ removeLineItem: qn,
725
+ attachmentsView: cn,
726
+ attachmentsUploading: H.isUploading,
727
+ draftButtonLabel: ir && !$ ? sr : void 0,
728
+ draftDisabled: or,
729
+ draftLoading: Y && wt === "draft",
730
+ primaryButtonLabel: cr,
731
+ primaryLoading: Y && wt === lr,
732
+ primaryDisabled: or || ir && (rn || !$ && V.isCounterpartLoading),
733
733
  scrollContainerRef: Et,
734
- selectAttachmentFiles: V.selectFiles,
735
- setAttachmentIncludeInEmail: V.setIncludeInEmail,
736
- removeAttachment: V.remove,
737
- autoFocusLineItemId: Bt,
738
- lineItemUnitOptions: zt.unitOptions,
734
+ selectAttachmentFiles: H.selectFiles,
735
+ setAttachmentIncludeInEmail: H.setIncludeInEmail,
736
+ removeAttachment: H.remove,
737
+ autoFocusLineItemId: Ht,
738
+ lineItemUnitOptions: Vt.unitOptions,
739
739
  lineItemsLoading: M.isLoading,
740
- lineItemControls: er,
741
- totals: tr,
742
- preview: _r,
743
- totalsView: gr,
740
+ lineItemControls: nr,
741
+ totals: rr,
742
+ preview: br,
743
+ totalsView: yr,
744
744
  currencySymbol: ie(D.currency),
745
- isSubmitting: J,
746
- fieldsDisabled: rr,
747
- paymentTerms: mn,
745
+ isSubmitting: Y,
746
+ fieldsDisabled: ar,
747
+ paymentTerms: hn,
748
748
  showBillingSection: D.type === "invoice" || E === "edit",
749
749
  purchaseOrder: E === "create" ? {
750
750
  value: D.purchaseOrder,
751
- error: It.purchaseOrder
751
+ error: Rt.purchaseOrder
752
752
  } : void 0,
753
- recurrence: Tn,
753
+ recurrence: En,
754
754
  showRecurrenceSection: D.type === "invoice",
755
- recurrenceLoading: K,
755
+ recurrenceLoading: q,
756
756
  showDueDateField: D.type === "quote",
757
- openCreate: An,
758
- openEdit: jn,
759
- close: Mn,
760
- requestClose: Nn,
761
- unsavedPrompt: hr,
762
- submit: lr,
763
- submitDraft: sr,
764
- submitPrimary: cr,
765
- selectDraftMode: ur,
766
- selectPrimaryMode: dr,
767
- units: zt,
768
- counterpartView: Lt,
769
- counterpartForm: ln,
770
- stateOptions: Jt,
771
- openCounterpartCreate: fn,
772
- customer: Zt.data?.id === D.customerId ? Zt.data : void 0,
773
- bankAccount: U,
774
- reminders: Dn
757
+ openCreate: jn,
758
+ openEdit: Mn,
759
+ editingReceivable: E === "edit" ? jt : void 0,
760
+ hasPendingChanges: Fn,
761
+ close: Nn,
762
+ requestClose: Pn,
763
+ unsavedPrompt: vr,
764
+ submit: fr,
765
+ submitDraft: ur,
766
+ submitPrimary: dr,
767
+ selectDraftMode: pr,
768
+ selectPrimaryMode: mr,
769
+ units: Vt,
770
+ counterpartView: zt,
771
+ counterpartForm: un,
772
+ stateOptions: Yt,
773
+ openCounterpartCreate: pn,
774
+ customer: Qt.data?.id === D.customerId ? Qt.data : void 0,
775
+ bankAccount: W,
776
+ reminders: On
775
777
  };
776
778
  }
777
779
  export { pt as useReceivableForm };