@tesouro/embedded-components-react 0.2.337 → 0.2.339
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.
- package/dist/index.css +4 -0
- package/dist/index.js +1 -1
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index10.js +103 -58
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index4.js +74 -37
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +25 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +64 -48
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +4 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +40 -50
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +51 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +5 -71
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +71 -48
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +46 -77
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +78 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +33 -117
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +138 -67
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +63 -200
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +194 -184
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +180 -50
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +64 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +12 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +46 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +26 -158
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +159 -31
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +32 -98
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +102 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +13 -224
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +243 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +4 -29
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +27 -80
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +76 -126
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +137 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +3 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +2 -43
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +45 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +1 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +6 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +9 -92
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +94 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +3 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +7 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +14 -51
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +59 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +3 -110
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +107 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +8 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +40 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +6 -98
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +91 -171
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +179 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +5 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +6 -113
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +115 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +0 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +14 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +26 -26
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/clientRegistry.js +11 -2
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +94 -74
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -1
- package/package.json +1 -1
|
@@ -2,207 +2,70 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import "
|
|
13
|
-
import { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
14
|
-
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
15
|
-
import { Landmark as g, Plus as _, X as v } from "lucide-react";
|
|
5
|
+
import { SourceDocumentPanel as e } from "../../ui/dist/index83.js";
|
|
6
|
+
import "../../ui/dist/index.js";
|
|
7
|
+
import { useAttachPayableFileMutation as t, useDeletePayableFileMutation as n } from "../../data-access/dist/index10.js";
|
|
8
|
+
import "../../data-access/dist/index.js";
|
|
9
|
+
import { createSourceDocumentPreview as r } from "./index26.js";
|
|
10
|
+
import { SOURCE_DOCUMENT_CONTAINER_LABELS_EN as i } from "./index27.js";
|
|
11
|
+
import { useEffect as a, useState as o } from "react";
|
|
12
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
16
13
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js
|
|
17
|
-
function
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
...t,
|
|
72
|
-
...e,
|
|
73
|
-
firstName: t.firstName || t.legalName,
|
|
74
|
-
legalName: t.legalName
|
|
75
|
-
} : e.entityType === "organization" && t.entityType !== "organization" ? {
|
|
76
|
-
...t,
|
|
77
|
-
...e,
|
|
78
|
-
legalName: t.legalName || [t.firstName, t.lastName].filter(Boolean).join(" ")
|
|
79
|
-
} : {
|
|
80
|
-
...t,
|
|
81
|
-
...e
|
|
82
|
-
});
|
|
83
|
-
}, [G]);
|
|
84
|
-
return /* @__PURE__ */ h("div", {
|
|
85
|
-
ref: K,
|
|
86
|
-
className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4",
|
|
87
|
-
children: [
|
|
88
|
-
/* @__PURE__ */ h("div", {
|
|
89
|
-
className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-2",
|
|
90
|
-
children: [/* @__PURE__ */ m("p", {
|
|
91
|
-
className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
|
|
92
|
-
children: y === "edit" ? A.editTitle : A.createTitle
|
|
93
|
-
}), /* @__PURE__ */ m(e, {
|
|
94
|
-
type: "button",
|
|
95
|
-
variant: "ghost",
|
|
96
|
-
size: "icon",
|
|
97
|
-
"aria-label": A.close,
|
|
98
|
-
onClick: D,
|
|
99
|
-
children: /* @__PURE__ */ m(v, { className: "ttw:size-4" })
|
|
100
|
-
})]
|
|
101
|
-
}),
|
|
102
|
-
/* @__PURE__ */ m(r, {
|
|
103
|
-
mode: y,
|
|
104
|
-
counterpartMode: "vendor",
|
|
105
|
-
values: H.values,
|
|
106
|
-
errors: H.errors,
|
|
107
|
-
stateOptions: z,
|
|
108
|
-
onChange: q,
|
|
109
|
-
onAddressChange: (e) => {
|
|
110
|
-
R(!0), G((t) => ({
|
|
111
|
-
...t,
|
|
112
|
-
address: {
|
|
113
|
-
...t.address,
|
|
114
|
-
...e
|
|
115
|
-
}
|
|
116
|
-
}));
|
|
117
|
-
},
|
|
118
|
-
sections: {
|
|
119
|
-
entityType: !0,
|
|
120
|
-
profileHeading: !1,
|
|
121
|
-
title: !1,
|
|
122
|
-
taxId: !1,
|
|
123
|
-
address: "collapsible",
|
|
124
|
-
bankAccount: !1
|
|
125
|
-
},
|
|
126
|
-
sectionsToExpand: H.sectionsToExpand,
|
|
127
|
-
onAddressExpand: H.expandAddress,
|
|
128
|
-
labels: { businessNameLabel: A.nameLabel }
|
|
129
|
-
}),
|
|
130
|
-
/* @__PURE__ */ h("div", {
|
|
131
|
-
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
132
|
-
children: [/* @__PURE__ */ m("p", {
|
|
133
|
-
className: "ttw:text-sm ttw:font-semibold ttw:text-foreground",
|
|
134
|
-
children: A.paymentMethodsHeading
|
|
135
|
-
}), /* @__PURE__ */ m("p", {
|
|
136
|
-
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
137
|
-
children: A.paymentMethodsDescription
|
|
138
|
-
})]
|
|
139
|
-
}),
|
|
140
|
-
/* @__PURE__ */ h("div", {
|
|
141
|
-
className: "ttw:flex ttw:gap-3 ttw:rounded-lg ttw:border ttw:border-border ttw:p-3",
|
|
142
|
-
children: [/* @__PURE__ */ m("span", {
|
|
143
|
-
className: "ttw:flex ttw:size-8 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-md ttw:bg-primary",
|
|
144
|
-
children: /* @__PURE__ */ m(g, {
|
|
145
|
-
"aria-hidden": !0,
|
|
146
|
-
className: "ttw:size-4 ttw:text-white"
|
|
147
|
-
})
|
|
148
|
-
}), /* @__PURE__ */ h("div", {
|
|
149
|
-
className: "ttw:flex ttw:flex-1 ttw:flex-col ttw:gap-3",
|
|
150
|
-
children: [/* @__PURE__ */ h("div", {
|
|
151
|
-
className: "ttw:flex ttw:flex-col ttw:gap-0.5",
|
|
152
|
-
children: [/* @__PURE__ */ m("p", {
|
|
153
|
-
className: "ttw:text-sm ttw:font-medium ttw:text-foreground",
|
|
154
|
-
children: A.achTitle
|
|
155
|
-
}), /* @__PURE__ */ m("p", {
|
|
156
|
-
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
157
|
-
children: A.achDescription
|
|
158
|
-
})]
|
|
159
|
-
}), F ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(n, {
|
|
160
|
-
idPrefix: "vendor-inline-ach",
|
|
161
|
-
values: H.values.bankAccount,
|
|
162
|
-
errors: H.errors?.bankAccount,
|
|
163
|
-
onChange: (e) => {
|
|
164
|
-
R(!0), G((t) => ({
|
|
165
|
-
...t,
|
|
166
|
-
bankAccount: {
|
|
167
|
-
...t.bankAccount,
|
|
168
|
-
...e
|
|
169
|
-
}
|
|
170
|
-
}));
|
|
171
|
-
},
|
|
172
|
-
labels: {
|
|
173
|
-
accountHolderName: A.accountHolderNameLabel,
|
|
174
|
-
routingNumber: A.routingNumberLabel,
|
|
175
|
-
accountNumber: A.accountNumberLabel
|
|
176
|
-
}
|
|
177
|
-
}), /* @__PURE__ */ m("p", {
|
|
178
|
-
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
179
|
-
children: A.achHelp
|
|
180
|
-
})] }) : /* @__PURE__ */ h(e, {
|
|
181
|
-
type: "button",
|
|
182
|
-
variant: "link",
|
|
183
|
-
className: "ttw:w-fit ttw:px-0",
|
|
184
|
-
onClick: () => I(!0),
|
|
185
|
-
children: [/* @__PURE__ */ m(_, { className: "ttw:size-4" }), A.addBankAccount]
|
|
186
|
-
})]
|
|
187
|
-
})]
|
|
188
|
-
}),
|
|
189
|
-
/* @__PURE__ */ h("div", {
|
|
190
|
-
className: "ttw:flex ttw:justify-end ttw:gap-2",
|
|
191
|
-
children: [/* @__PURE__ */ m(e, {
|
|
192
|
-
type: "button",
|
|
193
|
-
variant: "outline",
|
|
194
|
-
onClick: D,
|
|
195
|
-
children: A.cancel
|
|
196
|
-
}), /* @__PURE__ */ m(e, {
|
|
197
|
-
type: "button",
|
|
198
|
-
onClick: H.submit,
|
|
199
|
-
loading: H.isSubmitting,
|
|
200
|
-
disabled: H.isSubmitting,
|
|
201
|
-
children: A.save
|
|
202
|
-
})]
|
|
203
|
-
})
|
|
204
|
-
]
|
|
14
|
+
function c(e) {
|
|
15
|
+
let [t, n] = o();
|
|
16
|
+
return a(() => {
|
|
17
|
+
if (!e) {
|
|
18
|
+
n(void 0);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
let t = URL.createObjectURL(e);
|
|
22
|
+
return n(t), () => URL.revokeObjectURL(t);
|
|
23
|
+
}, [e]), t;
|
|
24
|
+
}
|
|
25
|
+
function l({ payableId: a, file: o, isDocumentPending: l, pendingFileName: u, readOnly: d, staging: f, labels: p }) {
|
|
26
|
+
let { stagedFile: m, onFileStaged: h, onClearStagedFile: g, isSaving: _ } = f ?? {}, v = {
|
|
27
|
+
...i,
|
|
28
|
+
...p,
|
|
29
|
+
preview: {
|
|
30
|
+
...i.preview,
|
|
31
|
+
...p?.preview
|
|
32
|
+
}
|
|
33
|
+
}, y = t(), b = n(), x = c(m), S = !!(o || m);
|
|
34
|
+
if (!S && (l || y.isPending)) return /* @__PURE__ */ s(e, {
|
|
35
|
+
mode: "loading",
|
|
36
|
+
fileName: u
|
|
37
|
+
});
|
|
38
|
+
if (!S && d) return /* @__PURE__ */ s("div", {
|
|
39
|
+
className: "ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4 ttw:text-sm ttw:text-muted-foreground",
|
|
40
|
+
children: v.noDocument
|
|
41
|
+
});
|
|
42
|
+
if (!S) return /* @__PURE__ */ s(e, {
|
|
43
|
+
mode: "upload",
|
|
44
|
+
uploadStatus: y.isPending ? "uploading" : "idle",
|
|
45
|
+
uploadErrorMessage: y.isError ? v.attachFailed : void 0,
|
|
46
|
+
onFilesSelected: (e) => {
|
|
47
|
+
let [t] = e;
|
|
48
|
+
t && (a ? y.mutate({
|
|
49
|
+
path: { payable_id: a },
|
|
50
|
+
file: t
|
|
51
|
+
}) : h?.(t));
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
let C = o?.name ?? m?.name ?? "", w = r(o || {
|
|
55
|
+
name: C,
|
|
56
|
+
url: x ?? "",
|
|
57
|
+
mimetype: m?.type ?? ""
|
|
58
|
+
}, v.preview);
|
|
59
|
+
return /* @__PURE__ */ s(e, {
|
|
60
|
+
mode: "document",
|
|
61
|
+
fileName: C,
|
|
62
|
+
preview: w,
|
|
63
|
+
onDownload: o ? () => window.open(o.url, "_blank", "noopener,noreferrer") : void 0,
|
|
64
|
+
onDelete: d ? void 0 : o && a ? () => b.mutate({
|
|
65
|
+
path: { file_id: o.id },
|
|
66
|
+
payableId: a
|
|
67
|
+
}) : _ ? void 0 : g
|
|
205
68
|
});
|
|
206
69
|
}
|
|
207
70
|
//#endregion
|
|
208
|
-
export {
|
|
71
|
+
export { l as SourceDocumentContainer, l as default };
|
|
@@ -2,197 +2,207 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import "
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { useCounterpartDetails as ae } from "../../../shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js";
|
|
5
|
+
import { Button as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { getStateOptions as t } from "../../../shared/util/dist/lib/usStates.js";
|
|
7
|
+
import { AchFieldGroup as n } from "../../../shared/counterpart-management/ui/dist/index5.js";
|
|
8
|
+
import { CounterpartFormFields as r, useFocusFirstInvalidField as i } from "../../../shared/counterpart-management/ui/dist/index9.js";
|
|
9
|
+
import { VENDOR_INLINE_FORM_LABELS_EN as a } from "./index27.js";
|
|
10
|
+
import { COUNTERPART_MESSAGE_LABELS_EN as o } from "../../../shared/counterpart-management/feature/dist/lib/labels.js";
|
|
11
|
+
import { useCounterpartForm as s } from "../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
|
|
13
12
|
import "../../../shared/counterpart-management/feature/dist/index.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
13
|
+
import { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
14
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
15
|
+
import { Landmark as g, Plus as _, X as v } from "lucide-react";
|
|
17
16
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
17
|
+
function y({ mode: y, counterpart: b, primaryAddress: x, bankAccounts: S, isBankAccountsLoading: C, isBankAccountsError: w, initialName: T, onSaved: E, onCancel: D, onDirtyChange: O, labels: k }) {
|
|
18
|
+
let A = {
|
|
19
|
+
...a,
|
|
20
|
+
...k
|
|
21
|
+
}, [j, M] = f("none"), [N, P] = f(b?.id), [F, I] = f(!1), [L, R] = f(!1);
|
|
22
|
+
l(() => {
|
|
23
|
+
O?.(L);
|
|
24
|
+
}, [L, O]);
|
|
25
|
+
let z = u(() => t(), []), B = d(j), V = d(!1), H = s({
|
|
26
|
+
view: j,
|
|
27
|
+
setView: M,
|
|
28
|
+
selectedId: N,
|
|
29
|
+
setSelectedId: P,
|
|
30
|
+
messages: o,
|
|
31
|
+
counterpartType: "vendor",
|
|
32
|
+
counterpart: b,
|
|
33
|
+
primaryAddress: x,
|
|
34
|
+
bankAccounts: S,
|
|
35
|
+
isBankAccountsLoading: C,
|
|
36
|
+
isBankAccountsError: w
|
|
37
|
+
}), { openCreate: U, openEdit: W, setValues: G } = H, K = i(H.errors);
|
|
38
|
+
l(() => {
|
|
39
|
+
y === "edit" ? W() : U();
|
|
36
40
|
}, [
|
|
37
|
-
v,
|
|
38
41
|
y,
|
|
39
|
-
|
|
40
|
-
G,
|
|
42
|
+
U,
|
|
41
43
|
W
|
|
42
|
-
]),
|
|
43
|
-
B.current !==
|
|
44
|
-
}, [v, U]), d(() => {
|
|
45
|
-
let e = setTimeout(() => {
|
|
46
|
-
D(w.trim());
|
|
47
|
-
}, ce);
|
|
48
|
-
return () => clearTimeout(e);
|
|
49
|
-
}, [w]);
|
|
50
|
-
let K = re({
|
|
51
|
-
sort: "counterpart_name",
|
|
52
|
-
order: "asc",
|
|
53
|
-
limit: se,
|
|
54
|
-
counterpart_name__icontains: E || void 0,
|
|
55
|
-
is_vendor: !0,
|
|
56
|
-
enabled: !!E
|
|
57
|
-
}), q = ae({ selectedId: v }), J = ie(), Y = l(), X = f(() => {
|
|
58
|
-
let t = q.counterpart;
|
|
59
|
-
if (!t) return;
|
|
60
|
-
if (q.isBankAccountsLoading) return {
|
|
61
|
-
name: o(t),
|
|
62
|
-
email: a(t),
|
|
63
|
-
methodLabel: C.paymentMethodLoading,
|
|
64
|
-
fields: []
|
|
65
|
-
};
|
|
66
|
-
if (q.isBankAccountsError) return {
|
|
67
|
-
name: o(t),
|
|
68
|
-
email: a(t),
|
|
69
|
-
methodLabel: C.paymentMethodUnavailable,
|
|
70
|
-
fields: []
|
|
71
|
-
};
|
|
72
|
-
let n = s(q.bankAccounts);
|
|
73
|
-
return {
|
|
74
|
-
name: o(t),
|
|
75
|
-
email: a(t),
|
|
76
|
-
methodLabel: n ? C.achMethod : C.noMethod,
|
|
77
|
-
fields: n ? [
|
|
78
|
-
{
|
|
79
|
-
label: C.accountHolder,
|
|
80
|
-
value: n.account_holder_name ?? ""
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
label: C.routingNumber,
|
|
84
|
-
value: n.routing_number ?? ""
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
label: C.accountNumber,
|
|
88
|
-
value: n.account_number ?? "",
|
|
89
|
-
maskedValue: n.account_number ? e(n.account_number) : ""
|
|
90
|
-
}
|
|
91
|
-
] : []
|
|
92
|
-
};
|
|
44
|
+
]), l(() => {
|
|
45
|
+
B.current !== "none" && j === "none" && N && E(N), B.current = j;
|
|
93
46
|
}, [
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
let t = ne(e);
|
|
104
|
-
if (Object.keys(t).length > 0) return L(t), A(!0), !1;
|
|
105
|
-
L(void 0);
|
|
106
|
-
let n = te(q.bankAccounts, R ?? Z?.id);
|
|
107
|
-
if (n.kind === "update") return await Y.mutateAsync({
|
|
108
|
-
path: {
|
|
109
|
-
counterpart_id: v,
|
|
110
|
-
bank_account_id: n.bankAccountId
|
|
111
|
-
},
|
|
112
|
-
body: r(e, { includeAchDefaults: n.includeAchDefaults })
|
|
113
|
-
}), z(n.bankAccountId), !0;
|
|
114
|
-
let i = await J.mutateAsync({
|
|
115
|
-
path: { counterpart_id: v },
|
|
116
|
-
body: ee(e)
|
|
117
|
-
});
|
|
118
|
-
return z(i?.id), !0;
|
|
47
|
+
j,
|
|
48
|
+
N,
|
|
49
|
+
E
|
|
50
|
+
]), l(() => {
|
|
51
|
+
y !== "create" || V.current || (V.current = !0, G((e) => ({
|
|
52
|
+
...e,
|
|
53
|
+
entityType: "organization",
|
|
54
|
+
legalName: T?.trim() || e.legalName
|
|
55
|
+
})));
|
|
119
56
|
}, [
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
57
|
+
y,
|
|
58
|
+
T,
|
|
59
|
+
G
|
|
60
|
+
]), l(() => {
|
|
61
|
+
y === "edit" && (H.values.bankAccount.routingNumber || H.values.bankAccount.accountNumber) && I(!0);
|
|
62
|
+
}, [
|
|
63
|
+
y,
|
|
64
|
+
H.values.bankAccount.accountNumber,
|
|
65
|
+
H.values.bankAccount.routingNumber
|
|
66
|
+
]), l(() => {
|
|
67
|
+
H.sectionsToExpand.bankAccount && I(!0);
|
|
68
|
+
}, [H.sectionsToExpand.bankAccount]);
|
|
69
|
+
let q = c((e) => {
|
|
70
|
+
R(!0), G((t) => e.entityType === "individual" && t.entityType !== "individual" ? {
|
|
71
|
+
...t,
|
|
72
|
+
...e,
|
|
73
|
+
firstName: t.firstName || t.legalName,
|
|
74
|
+
legalName: t.legalName
|
|
75
|
+
} : e.entityType === "organization" && t.entityType !== "organization" ? {
|
|
76
|
+
...t,
|
|
77
|
+
...e,
|
|
78
|
+
legalName: t.legalName || [t.firstName, t.lastName].filter(Boolean).join(" ")
|
|
79
|
+
} : {
|
|
80
|
+
...t,
|
|
81
|
+
...e
|
|
82
|
+
});
|
|
83
|
+
}, [G]);
|
|
84
|
+
return /* @__PURE__ */ h("div", {
|
|
85
|
+
ref: K,
|
|
86
|
+
className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4",
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ h("div", {
|
|
89
|
+
className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-2",
|
|
90
|
+
children: [/* @__PURE__ */ m("p", {
|
|
91
|
+
className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
|
|
92
|
+
children: y === "edit" ? A.editTitle : A.createTitle
|
|
93
|
+
}), /* @__PURE__ */ m(e, {
|
|
94
|
+
type: "button",
|
|
95
|
+
variant: "ghost",
|
|
96
|
+
size: "icon",
|
|
97
|
+
"aria-label": A.close,
|
|
98
|
+
onClick: D,
|
|
99
|
+
children: /* @__PURE__ */ m(v, { className: "ttw:size-4" })
|
|
100
|
+
})]
|
|
101
|
+
}),
|
|
102
|
+
/* @__PURE__ */ m(r, {
|
|
103
|
+
mode: y,
|
|
104
|
+
counterpartMode: "vendor",
|
|
105
|
+
values: H.values,
|
|
106
|
+
errors: H.errors,
|
|
107
|
+
stateOptions: z,
|
|
108
|
+
onChange: q,
|
|
109
|
+
onAddressChange: (e) => {
|
|
110
|
+
R(!0), G((t) => ({
|
|
174
111
|
...t,
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
112
|
+
address: {
|
|
113
|
+
...t.address,
|
|
114
|
+
...e
|
|
115
|
+
}
|
|
116
|
+
}));
|
|
117
|
+
},
|
|
118
|
+
sections: {
|
|
119
|
+
entityType: !0,
|
|
120
|
+
profileHeading: !1,
|
|
121
|
+
title: !1,
|
|
122
|
+
taxId: !1,
|
|
123
|
+
address: "collapsible",
|
|
124
|
+
bankAccount: !1
|
|
125
|
+
},
|
|
126
|
+
sectionsToExpand: H.sectionsToExpand,
|
|
127
|
+
onAddressExpand: H.expandAddress,
|
|
128
|
+
labels: { businessNameLabel: A.nameLabel }
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ h("div", {
|
|
131
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
132
|
+
children: [/* @__PURE__ */ m("p", {
|
|
133
|
+
className: "ttw:text-sm ttw:font-semibold ttw:text-foreground",
|
|
134
|
+
children: A.paymentMethodsHeading
|
|
135
|
+
}), /* @__PURE__ */ m("p", {
|
|
136
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
137
|
+
children: A.paymentMethodsDescription
|
|
138
|
+
})]
|
|
139
|
+
}),
|
|
140
|
+
/* @__PURE__ */ h("div", {
|
|
141
|
+
className: "ttw:flex ttw:gap-3 ttw:rounded-lg ttw:border ttw:border-border ttw:p-3",
|
|
142
|
+
children: [/* @__PURE__ */ m("span", {
|
|
143
|
+
className: "ttw:flex ttw:size-8 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-md ttw:bg-primary",
|
|
144
|
+
children: /* @__PURE__ */ m(g, {
|
|
145
|
+
"aria-hidden": !0,
|
|
146
|
+
className: "ttw:size-4 ttw:text-white"
|
|
147
|
+
})
|
|
148
|
+
}), /* @__PURE__ */ h("div", {
|
|
149
|
+
className: "ttw:flex ttw:flex-1 ttw:flex-col ttw:gap-3",
|
|
150
|
+
children: [/* @__PURE__ */ h("div", {
|
|
151
|
+
className: "ttw:flex ttw:flex-col ttw:gap-0.5",
|
|
152
|
+
children: [/* @__PURE__ */ m("p", {
|
|
153
|
+
className: "ttw:text-sm ttw:font-medium ttw:text-foreground",
|
|
154
|
+
children: A.achTitle
|
|
155
|
+
}), /* @__PURE__ */ m("p", {
|
|
156
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
157
|
+
children: A.achDescription
|
|
158
|
+
})]
|
|
159
|
+
}), F ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(n, {
|
|
160
|
+
idPrefix: "vendor-inline-ach",
|
|
161
|
+
values: H.values.bankAccount,
|
|
162
|
+
errors: H.errors?.bankAccount,
|
|
163
|
+
onChange: (e) => {
|
|
164
|
+
R(!0), G((t) => ({
|
|
165
|
+
...t,
|
|
166
|
+
bankAccount: {
|
|
167
|
+
...t.bankAccount,
|
|
168
|
+
...e
|
|
169
|
+
}
|
|
170
|
+
}));
|
|
171
|
+
},
|
|
172
|
+
labels: {
|
|
173
|
+
accountHolderName: A.accountHolderNameLabel,
|
|
174
|
+
routingNumber: A.routingNumberLabel,
|
|
175
|
+
accountNumber: A.accountNumberLabel
|
|
176
|
+
}
|
|
177
|
+
}), /* @__PURE__ */ m("p", {
|
|
178
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
179
|
+
children: A.achHelp
|
|
180
|
+
})] }) : /* @__PURE__ */ h(e, {
|
|
181
|
+
type: "button",
|
|
182
|
+
variant: "link",
|
|
183
|
+
className: "ttw:w-fit ttw:px-0",
|
|
184
|
+
onClick: () => I(!0),
|
|
185
|
+
children: [/* @__PURE__ */ m(_, { className: "ttw:size-4" }), A.addBankAccount]
|
|
186
|
+
})]
|
|
187
|
+
})]
|
|
188
|
+
}),
|
|
189
|
+
/* @__PURE__ */ h("div", {
|
|
190
|
+
className: "ttw:flex ttw:justify-end ttw:gap-2",
|
|
191
|
+
children: [/* @__PURE__ */ m(e, {
|
|
192
|
+
type: "button",
|
|
193
|
+
variant: "outline",
|
|
194
|
+
onClick: D,
|
|
195
|
+
children: A.cancel
|
|
196
|
+
}), /* @__PURE__ */ m(e, {
|
|
197
|
+
type: "button",
|
|
198
|
+
onClick: H.submit,
|
|
199
|
+
loading: H.isSubmitting,
|
|
200
|
+
disabled: H.isSubmitting,
|
|
201
|
+
children: A.save
|
|
202
|
+
})]
|
|
203
|
+
})
|
|
204
|
+
]
|
|
205
|
+
});
|
|
196
206
|
}
|
|
197
207
|
//#endregion
|
|
198
|
-
export {
|
|
208
|
+
export { y as VendorInlineForm, y as default };
|