@tesouro/embedded-components-react 0.5.44 → 0.5.46
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/README.md +7 -5
- package/dist/index.d.ts +54 -24
- package/dist/lib/BankAccountOnboardingWidget.d.ts +15 -1
- package/dist/lib/BillPayWidget.d.ts +16 -1
- package/dist/lib/SettingsWidget.d.ts +1 -0
- package/dist/lib/WidgetSuite.d.ts +1 -0
- package/dist/lib/monite-sdk.d.ts +2 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index10.js +12 -8
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js +233 -211
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +12 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +7 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +387 -387
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +119 -113
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +1 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +55 -70
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +9 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +163 -151
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index6.js +77 -77
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ExpenseApprovalsPage.js +17 -10
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/labels.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index382.js +10 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index394.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index616.js +23 -23
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index3.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +13 -4
- package/dist/libs/tesouro-embedded-components-react/settings-widget/help/ui/shadcn/dist/index3.js +27 -29
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/ApprovalPoliciesSettings.js +29 -28
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index11.js +13 -13
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +1933 -1906
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/scopes.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -14,25 +14,25 @@ import "../../../shared/ui/dist/index.js";
|
|
|
14
14
|
import { useAnalyticsTrack as l } from "../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
15
15
|
import { WidgetProvider as u } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
16
16
|
import { getStateOptions as d } from "../../../shared/util/dist/lib/usStates.js";
|
|
17
|
-
import { extractApiErrorMessage as
|
|
18
|
-
import { useRefetchWidget as
|
|
19
|
-
import { getNaicsOptions as
|
|
17
|
+
import { extractApiErrorMessage as f } from "../../../shared/util/dist/lib/apiErrors.js";
|
|
18
|
+
import { useRefetchWidget as p, useWidgetConfig as m } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
19
|
+
import { getNaicsOptions as ee } from "../../../shared/feature/dist/lib/naicsCodeMap.js";
|
|
20
20
|
import "../../../shared/feature/dist/index.js";
|
|
21
|
-
import { identifierLast4 as
|
|
22
|
-
import { bankAccountOnboardingTestIds as
|
|
23
|
-
import { ADDITIONAL_OWNERS_LABELS_EN as
|
|
24
|
-
import { interpolateBankName as
|
|
25
|
-
import { ResultStep as
|
|
21
|
+
import { identifierLast4 as h } from "./index7.js";
|
|
22
|
+
import { bankAccountOnboardingTestIds as g } from "./index11.js";
|
|
23
|
+
import { ADDITIONAL_OWNERS_LABELS_EN as te } from "../../ui/dist/index5.js";
|
|
24
|
+
import { interpolateBankName as _ } from "../../ui/dist/index7.js";
|
|
25
|
+
import { ResultStep as ne } from "../../ui/dist/index12.js";
|
|
26
26
|
import "../../ui/dist/index.js";
|
|
27
|
-
import { BusinessDetailsStep as
|
|
28
|
-
import { PersonalDetailsStep as
|
|
29
|
-
import { AdditionalOwnersStep as
|
|
30
|
-
import { buildCreateApplicationBody as
|
|
31
|
-
import { buildOnboardingPrefill as
|
|
32
|
-
import { OnboardingAnalyticsEvent as
|
|
33
|
-
import { DEFAULT_LABELS as
|
|
34
|
-
import { withoutResumeOnlyOwnerFields as
|
|
35
|
-
import { ApplicationClientSecretProvider as
|
|
27
|
+
import { BusinessDetailsStep as re } from "./index12.js";
|
|
28
|
+
import { PersonalDetailsStep as ie } from "./index14.js";
|
|
29
|
+
import { AdditionalOwnersStep as ae } from "./index16.js";
|
|
30
|
+
import { buildCreateApplicationBody as oe, buildUpdateApplicationBody as v } from "./index17.js";
|
|
31
|
+
import { buildOnboardingPrefill as y } from "./index18.js";
|
|
32
|
+
import { OnboardingAnalyticsEvent as se, WIDGET_NAME as ce } from "./index19.js";
|
|
33
|
+
import { DEFAULT_LABELS as b } from "./index20.js";
|
|
34
|
+
import { withoutResumeOnlyOwnerFields as le, withoutStoredIdentifierMarkers as ue } from "./index21.js";
|
|
35
|
+
import { ApplicationClientSecretProvider as de, useApplicationClientSecret as fe } from "../../data-access/dist/index2.js";
|
|
36
36
|
import { useCreateApplication as pe } from "../../data-access/dist/index4.js";
|
|
37
37
|
import { useUpdateApplication as me } from "../../data-access/dist/index6.js";
|
|
38
38
|
import { useSubmitApplication as he } from "../../data-access/dist/index7.js";
|
|
@@ -81,7 +81,7 @@ function Te(e, t) {
|
|
|
81
81
|
subtitle: t.personalReviewSubtitle
|
|
82
82
|
};
|
|
83
83
|
let n = {
|
|
84
|
-
...
|
|
84
|
+
...te,
|
|
85
85
|
...t.additionalOwners
|
|
86
86
|
};
|
|
87
87
|
return {
|
|
@@ -89,250 +89,262 @@ function Te(e, t) {
|
|
|
89
89
|
subtitle: n.subheading
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
let
|
|
92
|
+
function Ee({ onEmbeddedOnboardingCompletedSuccessfully: u, onNavigateToDashboard: te, labels: y, initialBusinessDetails: ce, initialPersonalDetails: ue, initialAdditionalOwners: de, initialApplicationId: x = null, initialBoundAuthEpoch: _e, onEditableDraftChange: E, bankLogoSrc: Ee, disclosureLinks: D, open: O, defaultOpen: k, onOpenChange: A, isFullScreenInline: j = !1 }) {
|
|
93
|
+
let M = l(), { authEpoch: N } = r();
|
|
94
94
|
S(() => {
|
|
95
|
-
|
|
96
|
-
}, [
|
|
97
|
-
let
|
|
98
|
-
...
|
|
99
|
-
...
|
|
95
|
+
M(se.Mounted);
|
|
96
|
+
}, [M]);
|
|
97
|
+
let P = {
|
|
98
|
+
...b,
|
|
99
|
+
...y,
|
|
100
100
|
stepIndicator: {
|
|
101
|
-
...
|
|
102
|
-
...
|
|
101
|
+
...b.stepIndicator,
|
|
102
|
+
...y?.stepIndicator
|
|
103
103
|
},
|
|
104
|
-
businessDetails:
|
|
105
|
-
personalDetails:
|
|
106
|
-
additionalOwners:
|
|
104
|
+
businessDetails: y?.businessDetails ?? {},
|
|
105
|
+
personalDetails: y?.personalDetails ?? {},
|
|
106
|
+
additionalOwners: y?.additionalOwners ?? {},
|
|
107
107
|
result: {
|
|
108
|
-
...
|
|
109
|
-
...
|
|
108
|
+
...b.result,
|
|
109
|
+
...y?.result
|
|
110
110
|
}
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
}, [
|
|
114
|
-
|
|
115
|
-
}, [
|
|
111
|
+
}, F = m().initResponse, { termsHref: De, privacyHref: Oe, electronicCommunicationHref: ke, patriotActHref: Ae } = D ?? {}, I = O === void 0, [je, Me] = w(() => k ?? !1), Ne = I ? je : O, Pe = k ?? !1, L = ve((e) => {
|
|
112
|
+
I && Me(e), A?.(e);
|
|
113
|
+
}, [A, I]), Fe = ve(() => {
|
|
114
|
+
u();
|
|
115
|
+
}, [u]), Ie = p(), [R, z] = w(0), [Le, Re] = w(() => ({
|
|
116
116
|
...Ce,
|
|
117
117
|
...ce
|
|
118
|
-
})), [
|
|
118
|
+
})), [B, ze] = w(() => ({
|
|
119
119
|
...we,
|
|
120
120
|
...ue
|
|
121
|
-
})), [
|
|
122
|
-
S(() => () =>
|
|
123
|
-
let
|
|
124
|
-
|
|
125
|
-
!
|
|
121
|
+
})), [Be, V] = w(() => de ?? []), [H, Ve] = w(null), [U, He] = w(null), [W, Ue] = w(null), [G, We] = w(x), [Ge, Ke] = w(_e ?? N), [qe, K] = w(null), [q, Je] = w(!1), [Ye, J] = w(null), Xe = pe(), Y = me(), Ze = he(), Qe = ge(), { setClientSecret: $e } = fe(), { data: et, refetch: tt } = a(), { mutateAsync: nt } = i(), rt = s(), it = ye(null);
|
|
122
|
+
S(() => () => it.current?.abort(), []);
|
|
123
|
+
let at = C(() => ee(P.businessDetails.naicsTitles), [P.businessDetails.naicsTitles]), ot = C(() => d(P.businessDetails.stateTitles), [P.businessDetails.stateTitles]), st = C(() => d(P.personalDetails.stateTitles), [P.personalDetails.stateTitles]), ct = C(() => d(P.additionalOwners.stateTitles), [P.additionalOwners.stateTitles]), X = q || Ye !== null, lt = F?.status === "ACTIVE" || F?.status === "INACTIVE", ut = F?.status === "INVITED", Z = !!F && !X && (lt || ut || rt.isSuppressed), Q = Z ? lt ? o.UserAlreadyOnboarded : ut ? o.UserInvitedToOrganization : rt.reason : null;
|
|
124
|
+
S(() => {
|
|
125
|
+
!Z || !Q || (M(se.Suppressed, { reason: Q }), console.info(`[onboarding] not shown: ${Q}`));
|
|
126
126
|
}, [
|
|
127
|
-
X,
|
|
128
127
|
Z,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
Ge
|
|
128
|
+
Q,
|
|
129
|
+
M
|
|
130
|
+
]), S(() => {
|
|
131
|
+
E?.(X || G === null ? null : {
|
|
132
|
+
applicationId: G,
|
|
133
|
+
authEpoch: Ge
|
|
134
|
+
});
|
|
135
|
+
}, [
|
|
136
|
+
E,
|
|
137
|
+
X,
|
|
138
|
+
G,
|
|
139
|
+
Ge
|
|
140
|
+
]);
|
|
141
|
+
let dt = ye(N);
|
|
142
|
+
if (dt.current = N, !F || !X && (Z || !rt.isResolved)) return null;
|
|
143
|
+
let ft = H?.companyStructure === "SOLE_PROPRIETORSHIP", pt = [
|
|
144
|
+
P.stepIndicator.business,
|
|
145
|
+
P.stepIndicator.personal,
|
|
146
|
+
P.stepIndicator.ownership
|
|
147
|
+
], mt = R === 0 ? H : R === 1 ? U : R === 2 ? W : null, $ = Xe.isPending || Y.isPending || Ze.isPending || q, ht = () => {
|
|
148
|
+
K(null), z((e) => e === 0 ? 0 : e - 1);
|
|
149
|
+
}, gt = () => {
|
|
150
|
+
L(!1);
|
|
151
|
+
}, _t = async (e) => {
|
|
152
|
+
Je(!0), L(!0);
|
|
141
153
|
let t = new AbortController();
|
|
142
|
-
|
|
154
|
+
it.current = t;
|
|
143
155
|
let n = !1;
|
|
144
156
|
try {
|
|
145
|
-
let r = await
|
|
157
|
+
let r = await Ze.mutateAsync({ path: { id: e } });
|
|
146
158
|
if (t.signal.aborted) return;
|
|
147
|
-
if (!r.id) throw Error(
|
|
148
|
-
if (n = !0, (await
|
|
149
|
-
let e =
|
|
150
|
-
if (e === void 0 && (e = (await
|
|
159
|
+
if (!r.id) throw Error(P.submitFailedError);
|
|
160
|
+
if (n = !0, (await Qe(e, { signal: t.signal })).status === "complete") {
|
|
161
|
+
let e = et;
|
|
162
|
+
if (e === void 0 && (e = (await tt()).data), t.signal.aborted) return;
|
|
151
163
|
if (e !== void 0) try {
|
|
152
|
-
await
|
|
164
|
+
await nt({ displayedVersion: e.version ?? null });
|
|
153
165
|
} catch {}
|
|
154
166
|
if (t.signal.aborted) return;
|
|
155
|
-
|
|
156
|
-
} else
|
|
167
|
+
J("success"), Ie(), Fe();
|
|
168
|
+
} else J("pending");
|
|
157
169
|
} catch (e) {
|
|
158
170
|
if (e instanceof DOMException && e.name === "AbortError") return;
|
|
159
171
|
if (!n) throw e;
|
|
160
|
-
|
|
172
|
+
J("pending");
|
|
161
173
|
} finally {
|
|
162
|
-
|
|
174
|
+
it.current = null, Je(!1);
|
|
163
175
|
}
|
|
164
|
-
},
|
|
165
|
-
|
|
176
|
+
}, vt = () => {
|
|
177
|
+
Re((e) => e.taxIdOnFileLast4 && e.taxId ? {
|
|
166
178
|
...e,
|
|
167
179
|
taxId: "",
|
|
168
|
-
taxIdOnFileLast4:
|
|
180
|
+
taxIdOnFileLast4: h(e.taxId),
|
|
169
181
|
taxIdOnFileStructure: e.companyStructure === "" ? void 0 : e.companyStructure
|
|
170
182
|
} : e);
|
|
171
|
-
},
|
|
172
|
-
|
|
183
|
+
}, yt = () => {
|
|
184
|
+
ze((e) => e.ssnOnFileLast4 && e.ssn ? {
|
|
173
185
|
...e,
|
|
174
186
|
ssn: "",
|
|
175
|
-
ssnOnFileLast4:
|
|
187
|
+
ssnOnFileLast4: h(e.ssn)
|
|
176
188
|
} : e);
|
|
177
|
-
},
|
|
178
|
-
|
|
189
|
+
}, bt = () => {
|
|
190
|
+
V((e) => e.map((e) => e.ssnOnFileLast4 && e.ssn ? {
|
|
179
191
|
...e,
|
|
180
192
|
ssn: "",
|
|
181
|
-
ssnOnFileLast4:
|
|
193
|
+
ssnOnFileLast4: h(e.ssn)
|
|
182
194
|
} : e));
|
|
183
|
-
},
|
|
184
|
-
|
|
185
|
-
},
|
|
186
|
-
|
|
195
|
+
}, xt = () => {
|
|
196
|
+
V((e) => e.map(le));
|
|
197
|
+
}, St = async () => {
|
|
198
|
+
K(null);
|
|
187
199
|
try {
|
|
188
|
-
if (
|
|
189
|
-
if (!
|
|
190
|
-
let e =
|
|
191
|
-
if (e) await
|
|
200
|
+
if (R === 0) {
|
|
201
|
+
if (!H) return;
|
|
202
|
+
let e = G;
|
|
203
|
+
if (e) await Y.mutateAsync({
|
|
192
204
|
path: { id: e },
|
|
193
|
-
body:
|
|
194
|
-
businessDetails:
|
|
195
|
-
carryConsent:
|
|
205
|
+
body: v({
|
|
206
|
+
businessDetails: H,
|
|
207
|
+
carryConsent: x !== null
|
|
196
208
|
})
|
|
197
209
|
});
|
|
198
210
|
else {
|
|
199
|
-
let t = await
|
|
200
|
-
e =
|
|
211
|
+
let t = dt.current, n = await Xe.mutateAsync({ body: oe(H) });
|
|
212
|
+
e = n.id, We(e), Ke(t), n.clientSecret && $e(n.clientSecret);
|
|
201
213
|
}
|
|
202
|
-
|
|
203
|
-
} else if (
|
|
204
|
-
if (!
|
|
205
|
-
await
|
|
206
|
-
path: { id:
|
|
207
|
-
body:
|
|
208
|
-
businessDetails:
|
|
209
|
-
applicant:
|
|
210
|
-
carryConsent:
|
|
214
|
+
vt(), ft && xt(), z(1);
|
|
215
|
+
} else if (R === 1) {
|
|
216
|
+
if (!U || !H || !G) return;
|
|
217
|
+
await Y.mutateAsync({
|
|
218
|
+
path: { id: G },
|
|
219
|
+
body: v({
|
|
220
|
+
businessDetails: H,
|
|
221
|
+
applicant: U,
|
|
222
|
+
carryConsent: x !== null
|
|
211
223
|
})
|
|
212
|
-
}),
|
|
213
|
-
} else if (
|
|
214
|
-
if (!
|
|
215
|
-
await
|
|
216
|
-
path: { id:
|
|
217
|
-
body:
|
|
218
|
-
}),
|
|
224
|
+
}), vt(), yt(), z(2);
|
|
225
|
+
} else if (R === 2) {
|
|
226
|
+
if (!W || !G) return;
|
|
227
|
+
await Y.mutateAsync({
|
|
228
|
+
path: { id: G },
|
|
229
|
+
body: v({ businessOwners: W })
|
|
230
|
+
}), bt(), await _t(G);
|
|
219
231
|
}
|
|
220
232
|
} catch (e) {
|
|
221
|
-
let t =
|
|
222
|
-
|
|
233
|
+
let t = f(e) ?? (e instanceof Error ? e.message : void 0) ?? P.genericRetryError;
|
|
234
|
+
K(t);
|
|
223
235
|
}
|
|
224
|
-
},
|
|
225
|
-
if (
|
|
226
|
-
let r =
|
|
227
|
-
...
|
|
228
|
-
...
|
|
229
|
-
}, c = /* @__PURE__ */ T(
|
|
236
|
+
}, Ct = Te(Math.min(R, 2), P), wt = F.bankName?.trim() || P.fallbackBankName, Tt = _(P.shellFdicDisclaimer, wt);
|
|
237
|
+
if (X) {
|
|
238
|
+
let r = H?.companyLegalName ?? "", i = F.bankName?.trim() || P.fallbackBankName, a = Ye ?? "pending", o = a === "success", s = {
|
|
239
|
+
...b.result,
|
|
240
|
+
...P.result
|
|
241
|
+
}, c = /* @__PURE__ */ T(ne, {
|
|
230
242
|
testIds: {
|
|
231
|
-
processing:
|
|
232
|
-
dashboardButton:
|
|
243
|
+
processing: g.resultProcessing,
|
|
244
|
+
dashboardButton: g.resultDashboardButton
|
|
233
245
|
},
|
|
234
246
|
status: a,
|
|
235
|
-
isLoading:
|
|
247
|
+
isLoading: q,
|
|
236
248
|
loadingMessage: s.loadingMessage,
|
|
237
249
|
headingLine1: o ? s.successHeadingLine1 : s.pendingHeadingLine1,
|
|
238
250
|
headingLine2: `${r}!`,
|
|
239
251
|
body: o ? s.successBody : s.pendingBody,
|
|
240
|
-
followUpEmail:
|
|
252
|
+
followUpEmail: U?.workEmail ?? "",
|
|
241
253
|
emailBoxLead: s.pendingEmailBoxLead,
|
|
242
254
|
navigateToDashboardLabel: s.navigateToDashboard,
|
|
243
|
-
bankLogoSrc:
|
|
244
|
-
bankLogoAlt:
|
|
245
|
-
fdicDisclaimer:
|
|
246
|
-
onNavigateToDashboard:
|
|
255
|
+
bankLogoSrc: Ee,
|
|
256
|
+
bankLogoAlt: _(s.bankLogoAlt, i),
|
|
257
|
+
fdicDisclaimer: _(s.fdicDisclaimer, i),
|
|
258
|
+
onNavigateToDashboard: te
|
|
247
259
|
});
|
|
248
|
-
return
|
|
260
|
+
return j ? /* @__PURE__ */ T("div", {
|
|
249
261
|
className: "ttw:grid ttw:h-full ttw:w-full ttw:grid-rows-[1fr] ttw:place-items-center ttw:gap-0 ttw:overflow-auto ttw:bg-background",
|
|
250
262
|
children: c
|
|
251
263
|
}) : /* @__PURE__ */ T(e, {
|
|
252
|
-
open:
|
|
253
|
-
onOpenChange:
|
|
264
|
+
open: Ne,
|
|
265
|
+
onOpenChange: L,
|
|
254
266
|
children: /* @__PURE__ */ xe(t, {
|
|
255
267
|
className: "ttw:grid ttw:max-h-[95vh] ttw:w-[720px] ttw:max-w-[calc(100vw-2rem)] ttw:grid-rows-[1fr] ttw:gap-0 ttw:overflow-hidden ttw:rounded-2xl ttw:p-0",
|
|
256
268
|
children: [/* @__PURE__ */ T(n, {
|
|
257
269
|
className: "ttw:sr-only",
|
|
258
|
-
children:
|
|
270
|
+
children: P.modalTitle
|
|
259
271
|
}), c]
|
|
260
272
|
})
|
|
261
273
|
});
|
|
262
274
|
}
|
|
263
|
-
let
|
|
275
|
+
let Et = R === 2 ? P.submit : P.next, Dt = mt === null || $;
|
|
264
276
|
return /* @__PURE__ */ T(be, { children: /* @__PURE__ */ xe(c, {
|
|
265
|
-
open:
|
|
266
|
-
defaultOpen:
|
|
267
|
-
onOpenChange:
|
|
268
|
-
isFullScreenInline:
|
|
269
|
-
title:
|
|
270
|
-
subtitle:
|
|
271
|
-
stepLabels:
|
|
272
|
-
activeStep:
|
|
273
|
-
disclaimerText:
|
|
274
|
-
onBack:
|
|
275
|
-
onCancel:
|
|
276
|
-
onNext:
|
|
277
|
+
open: Ne,
|
|
278
|
+
defaultOpen: Pe,
|
|
279
|
+
onOpenChange: L,
|
|
280
|
+
isFullScreenInline: j,
|
|
281
|
+
title: Ct.title,
|
|
282
|
+
subtitle: Ct.subtitle,
|
|
283
|
+
stepLabels: pt,
|
|
284
|
+
activeStep: R,
|
|
285
|
+
disclaimerText: Tt,
|
|
286
|
+
onBack: R === 0 ? gt : ht,
|
|
287
|
+
onCancel: R > 0 ? gt : void 0,
|
|
288
|
+
onNext: St,
|
|
277
289
|
showDismissButton: !1,
|
|
278
|
-
isNextDisabled:
|
|
290
|
+
isNextDisabled: Dt,
|
|
279
291
|
isNextLoading: $,
|
|
280
|
-
nextLabel:
|
|
292
|
+
nextLabel: Et,
|
|
281
293
|
nextIcon: null,
|
|
282
|
-
errorMessage:
|
|
294
|
+
errorMessage: qe,
|
|
283
295
|
labels: {
|
|
284
|
-
backButton:
|
|
285
|
-
cancelButton:
|
|
296
|
+
backButton: R === 0 ? P.cancel : P.back,
|
|
297
|
+
cancelButton: P.cancel
|
|
286
298
|
},
|
|
287
299
|
testIds: {
|
|
288
|
-
root:
|
|
289
|
-
dismiss:
|
|
290
|
-
back:
|
|
291
|
-
cancel:
|
|
292
|
-
next:
|
|
300
|
+
root: g.shell,
|
|
301
|
+
dismiss: g.shellDismiss,
|
|
302
|
+
back: g.shellBack,
|
|
303
|
+
cancel: g.shellCancel,
|
|
304
|
+
next: g.shellNext,
|
|
293
305
|
scrollRegion: {
|
|
294
|
-
root:
|
|
295
|
-
fade:
|
|
296
|
-
hint:
|
|
306
|
+
root: g.shellScrollRegion,
|
|
307
|
+
fade: g.shellScrollFade,
|
|
308
|
+
hint: g.shellScrollHint
|
|
297
309
|
}
|
|
298
310
|
},
|
|
299
311
|
children: [
|
|
300
|
-
|
|
301
|
-
value:
|
|
302
|
-
onValueChange: Le,
|
|
303
|
-
onSnapshotChange: Be,
|
|
304
|
-
naicsOptions: et,
|
|
305
|
-
stateOptions: tt,
|
|
306
|
-
isSubmitting: $,
|
|
307
|
-
labels: j.businessDetails,
|
|
308
|
-
bankName: _t,
|
|
309
|
-
termsHref: Ee,
|
|
310
|
-
privacyHref: De,
|
|
311
|
-
electronicCommunicationHref: Oe,
|
|
312
|
-
patriotActHref: ke
|
|
313
|
-
}, "business") : null,
|
|
314
|
-
F === 1 ? /* @__PURE__ */ T(ae, {
|
|
315
|
-
value: L,
|
|
312
|
+
R === 0 ? /* @__PURE__ */ T(re, {
|
|
313
|
+
value: Le,
|
|
316
314
|
onValueChange: Re,
|
|
317
315
|
onSnapshotChange: Ve,
|
|
318
|
-
|
|
316
|
+
naicsOptions: at,
|
|
317
|
+
stateOptions: ot,
|
|
319
318
|
isSubmitting: $,
|
|
320
|
-
labels:
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
319
|
+
labels: P.businessDetails,
|
|
320
|
+
bankName: wt,
|
|
321
|
+
termsHref: De,
|
|
322
|
+
privacyHref: Oe,
|
|
323
|
+
electronicCommunicationHref: ke,
|
|
324
|
+
patriotActHref: Ae
|
|
325
|
+
}, "business") : null,
|
|
326
|
+
R === 1 ? /* @__PURE__ */ T(ie, {
|
|
327
|
+
value: B,
|
|
328
|
+
onValueChange: ze,
|
|
328
329
|
onSnapshotChange: He,
|
|
330
|
+
stateOptions: st,
|
|
331
|
+
isSubmitting: $,
|
|
332
|
+
labels: P.personalDetails
|
|
333
|
+
}, "personal") : null,
|
|
334
|
+
R === 2 ? /* @__PURE__ */ T(ae, {
|
|
335
|
+
owners: ft ? Se : Be,
|
|
336
|
+
onOwnersChange: V,
|
|
337
|
+
primaryOwnerName: `${B.firstName} ${B.lastName}`.trim(),
|
|
338
|
+
primaryOwnerPercentage: ft ? 100 : U?.ownsOver25Percent === !0 ? U.ownershipPercentage ?? 0 : 0,
|
|
339
|
+
stateOptions: ct,
|
|
340
|
+
onSnapshotChange: Ue,
|
|
329
341
|
isSubmitting: $,
|
|
330
|
-
labels:
|
|
342
|
+
labels: P.additionalOwners
|
|
331
343
|
}) : null
|
|
332
344
|
]
|
|
333
345
|
}) });
|
|
334
346
|
}
|
|
335
|
-
function
|
|
347
|
+
function D({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: s, errorFallback: c, onError: l, analytics: d, disclosuresAcceptance: f, providerLabels: p, ...m }) {
|
|
336
348
|
return /* @__PURE__ */ T(u, {
|
|
337
349
|
baseUrl: e,
|
|
338
350
|
widgetToken: t,
|
|
@@ -345,63 +357,73 @@ function O({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gat
|
|
|
345
357
|
errorFallback: c,
|
|
346
358
|
onError: l,
|
|
347
359
|
analytics: d,
|
|
348
|
-
disclosuresAcceptance:
|
|
349
|
-
providerLabels:
|
|
350
|
-
widgetName:
|
|
351
|
-
children: /* @__PURE__ */ T(
|
|
360
|
+
disclosuresAcceptance: f,
|
|
361
|
+
providerLabels: p,
|
|
362
|
+
widgetName: ce,
|
|
363
|
+
children: /* @__PURE__ */ T(O, { ...m })
|
|
352
364
|
});
|
|
353
365
|
}
|
|
354
|
-
function
|
|
355
|
-
let { initResponse: t } =
|
|
366
|
+
function O(e) {
|
|
367
|
+
let { initResponse: t } = m(), { client: n } = r(), i = t?.userId ?? null, [a, o] = w(i), [s, c] = w(0);
|
|
356
368
|
i !== a && (o(i), a !== null && i !== null && c((e) => e + 1));
|
|
357
369
|
let [l, u] = w(n);
|
|
358
|
-
return n !== l && (u(n), c((e) => e + 1)), /* @__PURE__ */ T(
|
|
370
|
+
return n !== l && (u(n), c((e) => e + 1)), /* @__PURE__ */ T(k, { ...e }, s);
|
|
371
|
+
}
|
|
372
|
+
function k(e) {
|
|
373
|
+
let { authEpoch: t } = r(), { ownApplicationIds: n } = x(), [i, a] = w(null), [o, s] = w(0);
|
|
374
|
+
return i !== null && t !== i.authEpoch && n !== null && !n.includes(i.applicationId) && (a(null), s((e) => e + 1)), /* @__PURE__ */ T(de, { children: /* @__PURE__ */ T(j, {
|
|
375
|
+
...e,
|
|
376
|
+
onEditableDraftChange: a
|
|
377
|
+
}, o) }, o);
|
|
359
378
|
}
|
|
360
379
|
var A = { canRender: !1 };
|
|
361
380
|
function j(e) {
|
|
362
|
-
let { setClientSecret: t } = fe(), {
|
|
381
|
+
let { setClientSecret: t } = fe(), { authEpoch: n } = r(), { applicationId: i, clientSecret: a, isResolved: o } = x(), { application: s, isResolved: c, isUnavailable: l } = _e(i, a);
|
|
363
382
|
S(() => {
|
|
364
|
-
|
|
365
|
-
}, [
|
|
366
|
-
let [
|
|
383
|
+
a && t(a);
|
|
384
|
+
}, [a, t]);
|
|
385
|
+
let [u, d] = w(null);
|
|
367
386
|
if (S(() => {
|
|
368
|
-
if (!(
|
|
369
|
-
if (
|
|
370
|
-
|
|
387
|
+
if (!(u?.canRender === !0 || !o || !c)) {
|
|
388
|
+
if (l) {
|
|
389
|
+
d(A);
|
|
371
390
|
return;
|
|
372
391
|
}
|
|
373
|
-
if (
|
|
374
|
-
|
|
392
|
+
if (s !== null && s.status !== void 0 && s.status !== E) {
|
|
393
|
+
d(A);
|
|
375
394
|
return;
|
|
376
395
|
}
|
|
377
|
-
|
|
396
|
+
d({
|
|
378
397
|
canRender: !0,
|
|
379
|
-
applicationId:
|
|
380
|
-
|
|
398
|
+
applicationId: s === null ? null : i,
|
|
399
|
+
authEpoch: n,
|
|
400
|
+
prefill: y(s)
|
|
381
401
|
});
|
|
382
402
|
}
|
|
383
403
|
}, [
|
|
384
|
-
|
|
385
|
-
|
|
404
|
+
n,
|
|
405
|
+
u,
|
|
386
406
|
o,
|
|
407
|
+
c,
|
|
408
|
+
l,
|
|
387
409
|
s,
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
return /* @__PURE__ */ T(D, {
|
|
410
|
+
i
|
|
411
|
+
]), u === null || !u.canRender) return null;
|
|
412
|
+
let { applicationId: f, authEpoch: p, prefill: m } = u;
|
|
413
|
+
return /* @__PURE__ */ T(Ee, {
|
|
393
414
|
...e,
|
|
394
|
-
initialApplicationId:
|
|
415
|
+
initialApplicationId: f,
|
|
416
|
+
initialBoundAuthEpoch: p,
|
|
395
417
|
initialBusinessDetails: {
|
|
396
|
-
...
|
|
397
|
-
...
|
|
418
|
+
...ue(e.initialBusinessDetails),
|
|
419
|
+
...m?.businessDetails
|
|
398
420
|
},
|
|
399
421
|
initialPersonalDetails: {
|
|
400
|
-
...
|
|
401
|
-
...
|
|
422
|
+
...ue(e.initialPersonalDetails),
|
|
423
|
+
...m?.personalDetails
|
|
402
424
|
},
|
|
403
|
-
initialAdditionalOwners:
|
|
425
|
+
initialAdditionalOwners: m?.additionalOwners ?? e.initialAdditionalOwners?.map(le)
|
|
404
426
|
});
|
|
405
427
|
}
|
|
406
428
|
//#endregion
|
|
407
|
-
export {
|
|
429
|
+
export { D as BankAccountOnboardingWidget, D as default };
|
|
@@ -24,13 +24,16 @@ function o(e) {
|
|
|
24
24
|
function s(e) {
|
|
25
25
|
return (e / 100).toFixed(2);
|
|
26
26
|
}
|
|
27
|
-
function c({ values: e, initialLineItems: r, counterpartId: i, clearCounterpart: a, counterpartBankAccountId: o, editedTotals: s,
|
|
28
|
-
let
|
|
29
|
-
if (i ?
|
|
27
|
+
function c({ values: e, initialLineItems: r, counterpartId: i, clearCounterpart: a, counterpartBankAccountId: o, editedTotals: s, currentTotals: c, lineItems: d, document: f }) {
|
|
28
|
+
let p = { currency: t };
|
|
29
|
+
if (i ? p.counterpart_id = i : a && (p.counterpart_id = null), i ? p.counterpart_bank_account_id = o ?? null : a && (p.counterpart_bank_account_id = null), e.invoiceNumber && (p.document_id = e.invoiceNumber), e.invoiceDate && (p.issued_at = e.invoiceDate), e.dueDate && (p.due_date = e.dueDate), f && (p.base64_encoded_file = f.base64EncodedFile, p.file_name = f.fileName), s && (p.discount = n(s.discount) ?? 0, p.tax_amount = n(s.tax) ?? 0, s.total !== void 0 && (p.total_amount = (n(s.total) ?? 0) + (n(s.discount) ?? 0))), c && d) {
|
|
30
|
+
let e = u(d).reduce((e, t) => e + t.subtotal, 0), t = n(c.tax) ?? 0, r = n(c.discount) ?? 0, i = c.total === void 0 ? e + t : (n(c.total) ?? 0) + r;
|
|
31
|
+
p.subtotal = e, p.tax_amount = t, p.total_amount = i;
|
|
32
|
+
} else if (r && !("total_amount" in p)) {
|
|
30
33
|
let e = l(r, s?.tax);
|
|
31
|
-
e !== void 0 && (
|
|
34
|
+
e !== void 0 && (p.total_amount = e);
|
|
32
35
|
}
|
|
33
|
-
return
|
|
36
|
+
return p;
|
|
34
37
|
}
|
|
35
38
|
function l(e, t) {
|
|
36
39
|
let r = !1, a = e.reduce((e, t) => {
|
|
@@ -42,13 +45,15 @@ function l(e, t) {
|
|
|
42
45
|
}
|
|
43
46
|
function u(e) {
|
|
44
47
|
return e.filter(i).map((e) => {
|
|
45
|
-
let t = n(e.amount), i = r(e.quantity) ?? 1, a = n(e.price) ?? (t === null ? 0 : Math.round(t / i)), o = Math.round(i * a);
|
|
48
|
+
let t = n(e.amount), i = r(e.quantity) ?? 1, a = n(e.price) ?? (t === null ? 0 : Math.round(t / i)), o = Math.round(i * a), s = t ?? o;
|
|
46
49
|
return {
|
|
47
50
|
name: e.description,
|
|
48
51
|
quantity: i,
|
|
49
52
|
unit_price: a,
|
|
50
53
|
tax: 0,
|
|
51
|
-
|
|
54
|
+
subtotal: s,
|
|
55
|
+
tax_amount: 0,
|
|
56
|
+
total: s,
|
|
52
57
|
...e.glCode ? { ledger_account_id: e.glCode } : {}
|
|
53
58
|
};
|
|
54
59
|
});
|
|
@@ -44,10 +44,10 @@ function f(t, n = e) {
|
|
|
44
44
|
let r = d(t, n);
|
|
45
45
|
return r ? { total: r } : void 0;
|
|
46
46
|
}
|
|
47
|
-
function p(t, r
|
|
47
|
+
function p(t, r = e) {
|
|
48
48
|
if (t === void 0) return;
|
|
49
|
-
let
|
|
50
|
-
if (
|
|
49
|
+
let i = n(t);
|
|
50
|
+
if (i !== null) return i > 0 ? void 0 : { total: r.totalNotGreaterThanZero };
|
|
51
51
|
}
|
|
52
52
|
function m(t, n, r, i = e) {
|
|
53
53
|
let a = {};
|