@tesouro/embedded-components-react 0.11.167 → 0.11.168

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 (20) hide show
  1. package/dist/index.d.ts +3 -0
  2. package/dist/lib/BankAccountsWidget.d.ts +1 -0
  3. package/dist/lib/CreditCardsWidget.d.ts +1 -0
  4. package/dist/lib/DebitCardsWidget.d.ts +1 -0
  5. package/dist/lib/LinkedAccountsWidget.d.ts +1 -0
  6. package/dist/lib/WidgetSuite.d.ts +3 -0
  7. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/BankAccountsWidget/BankAccountsWidget.js +1 -0
  8. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/useBankAccountsWidget.js +122 -121
  9. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/BankAccountsWidgetUi.js +63 -59
  10. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/labels.js +1 -0
  11. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/testIds.js +2 -0
  12. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/useCardsWidget.js +161 -160
  13. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +126 -122
  14. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/labels.js +1 -0
  15. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js +192 -191
  16. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index13.js +2 -1
  17. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index14.js +100 -96
  18. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index6.js +1 -0
  19. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  20. package/package.json +1 -1
@@ -15,190 +15,190 @@ import { useAllOrganizationUsersQuery as oe } from "../../../../shared/data-acce
15
15
  import "../../../../shared/data-access/dist/index.js";
16
16
  import "../../../../shared/ui/dist/index.js";
17
17
  import { useAnalyticsTrack as se } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
18
- import { useRefetchWidget as ce, useWidgetConfig as le, useWidgetError as ue, useWidgetLoading as de } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
18
+ import { useRefetchWidget as ce, useWidgetConfig as le, useWidgetError as ue, useWidgetInitStaleForToken as de, useWidgetLoading as fe } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
19
19
  import "../../../../shared/feature/dist/index.js";
20
- import { filterRolesForOrganization as fe } from "../../../../../shared/util-validation/dist/index6.js";
21
- import { filterUsersForOrganization as pe } from "../../../../../shared/util-validation/dist/index7.js";
22
- import { DEFAULT_FEATURE_LABELS as me } from "./labels.js";
20
+ import { filterRolesForOrganization as pe } from "../../../../../shared/util-validation/dist/index6.js";
21
+ import { filterUsersForOrganization as me } from "../../../../../shared/util-validation/dist/index7.js";
22
+ import { DEFAULT_FEATURE_LABELS as he } from "./labels.js";
23
23
  import { LinkedAccountsWidgetAnalyticsEvent as i } from "./analytics/events.js";
24
- import { EMPTY_CONNECT_FORM as he, EMPTY_EDIT_FORM as ge, EMPTY_VERIFY_FORM as _e, isConnectStep1Valid as ve, isRoutingNumberValid as ye, isVerifyAmountInRange as be, isVerifyFormValid as xe, parseVerifyAmountToMinorUnits as Se, sanitizeRoutingNumberInput as Ce, toEditForm as we, toUpdateBody as Te } from "./forms.js";
25
- import { getLinkedAccountsPermissions as Ee } from "./permissions.js";
26
- import { toAccountRows as De } from "./rows.js";
27
- import { fromApiAccountHolderType as Oe, toApiAccountHolderType as ke, toSummaryTypeLabel as Ae, toTextParts as a } from "./summary.js";
28
- import { useConnectExternalBankAccountMutation as je } from "../../../data-access/dist/index3.js";
29
- import { useExternalBankAccountsQuery as Me } from "../../../data-access/dist/index4.js";
30
- import { useGrantExternalBankAccountAccessMutation as Ne } from "../../../data-access/dist/index5.js";
31
- import { useLinkExternalBankAccountMutation as Pe } from "../../../data-access/dist/index6.js";
32
- import { useUnlinkExternalBankAccountMutation as Fe } from "../../../data-access/dist/index9.js";
33
- import { useUpdateExternalBankAccountMutation as Ie } from "../../../data-access/dist/index10.js";
34
- import { useValidateExternalBankAccountMutation as Le } from "../../../data-access/dist/index11.js";
24
+ import { EMPTY_CONNECT_FORM as ge, EMPTY_EDIT_FORM as _e, EMPTY_VERIFY_FORM as ve, isConnectStep1Valid as ye, isRoutingNumberValid as be, isVerifyAmountInRange as xe, isVerifyFormValid as Se, parseVerifyAmountToMinorUnits as Ce, sanitizeRoutingNumberInput as we, toEditForm as Te, toUpdateBody as Ee } from "./forms.js";
25
+ import { getLinkedAccountsPermissions as De } from "./permissions.js";
26
+ import { toAccountRows as Oe } from "./rows.js";
27
+ import { fromApiAccountHolderType as ke, toApiAccountHolderType as Ae, toSummaryTypeLabel as je, toTextParts as a } from "./summary.js";
28
+ import { useConnectExternalBankAccountMutation as Me } from "../../../data-access/dist/index3.js";
29
+ import { useExternalBankAccountsQuery as Ne } from "../../../data-access/dist/index4.js";
30
+ import { useGrantExternalBankAccountAccessMutation as Pe } from "../../../data-access/dist/index5.js";
31
+ import { useLinkExternalBankAccountMutation as Fe } from "../../../data-access/dist/index6.js";
32
+ import { useUnlinkExternalBankAccountMutation as Ie } from "../../../data-access/dist/index9.js";
33
+ import { useUpdateExternalBankAccountMutation as Le } from "../../../data-access/dist/index10.js";
34
+ import { useValidateExternalBankAccountMutation as Re } from "../../../data-access/dist/index11.js";
35
35
  import "../../../data-access/dist/index.js";
36
- import { useAdminEligibleUserIds as Re } from "./useAdminEligibleUserIds.js";
37
- import { toAccessRows as ze, toOrganizationRoleOptions as Be, toTeamMembers as Ve } from "./teamMembers.js";
38
- import { DEFAULT_LABELS as He } from "../../../ui/dist/index13.js";
36
+ import { useAdminEligibleUserIds as ze } from "./useAdminEligibleUserIds.js";
37
+ import { toAccessRows as Be, toOrganizationRoleOptions as Ve, toTeamMembers as He } from "./teamMembers.js";
38
+ import { DEFAULT_LABELS as Ue } from "../../../ui/dist/index13.js";
39
39
  import "../../../ui/dist/index.js";
40
- import { useCallback as Ue, useEffect as o, useMemo as s, useState as c } from "react";
41
- import { useControllableState as We } from "@radix-ui/react-use-controllable-state";
40
+ import { useCallback as We, useEffect as Ge, useMemo as o, useState as s } from "react";
41
+ import { useControllableState as Ke } from "@radix-ui/react-use-controllable-state";
42
42
  // ../../libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js
43
- function Ge(e) {
43
+ function qe(e) {
44
44
  let t = e;
45
45
  return typeof e == "object" && !!e && "verificationStatus" in e && t.verificationStatus === "VERIFIED";
46
46
  }
47
- var l = "tesouro.linkedAccounts.locallySentMicroDepositAccountIds.v1";
48
- function Ke() {
47
+ var c = "tesouro.linkedAccounts.locallySentMicroDepositAccountIds.v1";
48
+ function Je() {
49
49
  if (typeof window > "u") return /* @__PURE__ */ new Set();
50
50
  try {
51
- let e = window.sessionStorage.getItem(l), t = e ? JSON.parse(e) : [];
52
- return new Set(Array.isArray(t) ? t.filter(qe) : []);
51
+ let e = window.sessionStorage.getItem(c), t = e ? JSON.parse(e) : [];
52
+ return new Set(Array.isArray(t) ? t.filter(Ye) : []);
53
53
  } catch {
54
54
  return /* @__PURE__ */ new Set();
55
55
  }
56
56
  }
57
- function qe(e) {
57
+ function Ye(e) {
58
58
  return typeof e == "string";
59
59
  }
60
- function Je(e) {
60
+ function Xe(e) {
61
61
  if (typeof window < "u") try {
62
- window.sessionStorage.setItem(l, JSON.stringify([...e]));
62
+ window.sessionStorage.setItem(c, JSON.stringify([...e]));
63
63
  } catch {}
64
64
  }
65
- function Ye(e, t) {
65
+ function Ze(e, t) {
66
66
  let n = new Set(e).add(t);
67
- return Je(n), n;
67
+ return Xe(n), n;
68
68
  }
69
- var Xe = re.ExternalBankAccountWriteOrg;
70
- function u({ labels: re, featureLabels: l, isLinkAccountOpen: qe, onLinkAccountOpenChange: Je }) {
71
- let u = {
72
- ...He,
69
+ var Qe = re.ExternalBankAccountWriteOrg;
70
+ function l({ labels: re, featureLabels: c, isLinkAccountOpen: Ye, onLinkAccountOpenChange: Xe }) {
71
+ let l = {
72
+ ...Ue,
73
73
  ...re
74
- }, d = {
75
- ...me,
76
- ...l
77
- }, f = se(), { organizationId: p, widgetToken: Ze, initResponse: m } = le(), Qe = de(), { organizationStatus: $e } = ne(), h = te($e), g = !!ue(), et = ce(), _ = !!(p && Ze), tt = _ || !!Ze && $e === ee.Rotating, v = s(() => Ee(m?.scopes), [m?.scopes]), y = tt && v.canRead && !!m, [b, nt] = c(), [rt, it] = We({
78
- prop: qe,
74
+ }, u = {
75
+ ...he,
76
+ ...c
77
+ }, d = se(), { organizationId: f, widgetToken: $e, initResponse: p } = le(), et = fe(), tt = de(), { organizationStatus: nt } = ne(), m = te(nt), h = !!ue(), rt = ce(), g = !!(f && $e), it = g || !!$e && nt === ee.Rotating, _ = o(() => De(p?.scopes), [p?.scopes]), at = tt && !_.canRead, v = !h && !tt && !!p && !_.canRead, y = it && _.canRead && !!p, [b, ot] = s(), [st, ct] = Ke({
78
+ prop: Ye,
79
79
  defaultProp: !1,
80
- onChange: Je,
80
+ onChange: Xe,
81
81
  caller: "LinkedAccountsWidget"
82
- }), at = _ && v.canWrite, x = rt && at, [S, C] = c(1), [w, ot] = c([]), [T, st] = c(), [ct, E] = c(), [D, lt] = c(Ke), [ut, O] = c(!1), [dt, k] = c(!1), [ft, pt] = c(!1), [mt, A] = c(!1), [ht, gt] = c(!1), [j, M] = c(), [N, P] = c(), [F, _t] = c(he), [vt, yt] = c(!1), [bt, xt] = c(ge), [I, St] = c(_e);
83
- o(() => {
84
- f(i.Mounted);
85
- }, [f]);
86
- let L = Me({
82
+ }), lt = g && _.canWrite && !v, x = st && lt, [S, C] = s(1), [w, ut] = s([]), [T, dt] = s(), [ft, E] = s(), [D, pt] = s(Je), [mt, O] = s(!1), [ht, k] = s(!1), [gt, _t] = s(!1), [vt, A] = s(!1), [yt, bt] = s(!1), [j, M] = s(), [N, P] = s(), [F, xt] = s(ge), [St, Ct] = s(!1), [wt, Tt] = s(_e), [I, Et] = s(ve);
83
+ Ge(() => {
84
+ d(i.Mounted);
85
+ }, [d]);
86
+ let L = Ne({
87
87
  limit: 100,
88
88
  enabled: y
89
- }), R = je(), z = Ne(), B = Ie(), V = Fe(), H = Pe(), U = Le(), W = x && S >= 2, G = oe({ enabled: W }), K = ae({ enabled: W }), Ct = ie({ enabled: x && v.canReadOrganization }).data?.legalName ?? "", q = s(() => vt ? F : {
89
+ }), R = Me(), z = Pe(), B = Le(), V = Ie(), H = Fe(), U = Re(), W = x && S >= 2, G = oe({ enabled: W }), K = ae({ enabled: W }), Dt = ie({ enabled: x && _.canReadOrganization }).data?.legalName ?? "", q = o(() => St ? F : {
90
90
  ...F,
91
- nameOnAccount: Ct
91
+ nameOnAccount: Dt
92
92
  }, [
93
- vt,
93
+ St,
94
94
  F,
95
- Ct
96
- ]), { userIds: wt, isResolving: Tt, isError: Et, refetch: Dt } = Re({
95
+ Dt
96
+ ]), { userIds: Ot, isResolving: kt, isError: At, refetch: jt } = ze({
97
97
  enabled: W,
98
- permissionKey: Xe,
99
- organizationId: p
100
- }), J = s(() => {
101
- let e = K.data?.data ?? [], t = p ? fe(e, {
102
- organizationId: p,
103
- organizationTypes: m?.organizationTypes ?? []
104
- }) : e, n = pe(G.data?.data ?? [], p);
105
- return Ve(n, Be(t), wt);
98
+ permissionKey: Qe,
99
+ organizationId: f
100
+ }), J = o(() => {
101
+ let e = K.data?.data ?? [], t = f ? pe(e, {
102
+ organizationId: f,
103
+ organizationTypes: p?.organizationTypes ?? []
104
+ }) : e, n = me(G.data?.data ?? [], f);
105
+ return He(n, Ve(t), Ot);
106
106
  }, [
107
- wt,
107
+ Ot,
108
108
  K.data?.data,
109
109
  G.data?.data,
110
- p,
111
- m?.organizationTypes
112
- ]), Ot = G.isError && G.isFetching, Y = G.isLoading || G.isFetchingNextPage || !!G.hasNextPage || Ot || K.isResolving || Tt, kt = G.isError && !Ot || Et, At = !Y && !kt, jt = () => {
113
- G.isError && G.refetch(), Et && Dt(), K.isError && K.refetch();
114
- }, X = y ? L.data?.data ?? [] : [], Z = s(() => X.map((e) => e.verificationStatus === "UNVERIFIED" && D.has(e.id) ? {
110
+ f,
111
+ p?.organizationTypes
112
+ ]), Mt = G.isError && G.isFetching, Y = G.isLoading || G.isFetchingNextPage || !!G.hasNextPage || Mt || K.isResolving || kt, Nt = G.isError && !Mt || At, Pt = !Y && !Nt, Ft = () => {
113
+ G.isError && G.refetch(), At && jt(), K.isError && K.refetch();
114
+ }, X = y ? L.data?.data ?? [] : [], Z = o(() => X.map((e) => e.verificationStatus === "UNVERIFIED" && D.has(e.id) ? {
115
115
  ...e,
116
116
  verificationStatus: "VERIFICATION_SENT"
117
- } : e), [X, D]), Mt = [.../* @__PURE__ */ new Set([...J.filter((e) => e.locked).map((e) => e.id), ...w])], Nt = Ue((e) => {
118
- R.reset(), z.reset(), H.reset(), e.nameOnAccount !== q.nameOnAccount && yt(!0), _t({
117
+ } : e), [X, D]), It = [.../* @__PURE__ */ new Set([...J.filter((e) => e.locked).map((e) => e.id), ...w])], Lt = We((e) => {
118
+ R.reset(), z.reset(), H.reset(), e.nameOnAccount !== q.nameOnAccount && Ct(!0), xt({
119
119
  ...e,
120
- routingNumber: Ce(e.routingNumber)
120
+ routingNumber: we(e.routingNumber)
121
121
  });
122
122
  }, [
123
123
  q.nameOnAccount,
124
124
  R,
125
125
  z,
126
126
  H
127
- ]), Pt = () => {
127
+ ]), Rt = () => {
128
128
  C(3), n(t);
129
- }, Ft = (e) => {
130
- v.canMicroDeposit ? (E("connect"), H.mutate({ path: { id: e } }, { onSuccess: () => {
131
- E(void 0), lt((t) => Ye(t, e)), f(i.AccountLinked, { accountId: e }), Pt();
132
- } })) : Pt();
133
- }, It = (e) => {
129
+ }, zt = (e) => {
130
+ _.canMicroDeposit ? (E("connect"), H.mutate({ path: { id: e } }, { onSuccess: () => {
131
+ E(void 0), pt((t) => Ze(t, e)), d(i.AccountLinked, { accountId: e }), Rt();
132
+ } })) : Rt();
133
+ }, Bt = (e) => {
134
134
  z.mutate({
135
135
  path: { id: e },
136
- body: { userIds: Mt }
137
- }, { onSuccess: () => Ft(e) });
138
- }, Lt = () => {
139
- if (_ && v.canWrite) {
136
+ body: { userIds: It }
137
+ }, { onSuccess: () => zt(e) });
138
+ }, Vt = () => {
139
+ if (g && _.canWrite) {
140
140
  if (S === 1) {
141
- if (!ve(q)) {
142
- gt(!0);
141
+ if (!ye(q)) {
142
+ bt(!0);
143
143
  return;
144
144
  }
145
145
  C(2);
146
- } else S === 2 && (At ? T ? It(T.id) : R.mutate({ body: {
146
+ } else S === 2 && (Pt ? T ? Bt(T.id) : R.mutate({ body: {
147
147
  nickname: q.nickname.trim(),
148
148
  accountNumber: q.accountNumber.trim(),
149
149
  routingNumber: q.routingNumber.trim(),
150
150
  nameOnAccount: q.nameOnAccount.trim(),
151
151
  type: q.type,
152
- accountHolderType: ke(q.accountHolderType)
152
+ accountHolderType: Ae(q.accountHolderType)
153
153
  } }, { onSuccess: (e) => {
154
- f(i.AccountConnected, { accountId: e?.id }), st(e), e?.id && It(e.id);
155
- } }) : Y || jt());
154
+ d(i.AccountConnected, { accountId: e?.id }), dt(e), e?.id && Bt(e.id);
155
+ } }) : Y || Ft());
156
156
  }
157
- }, Rt = () => {
157
+ }, Ht = () => {
158
158
  S === 2 && C(1);
159
- }, zt = (e, t) => {
160
- J.find((t) => t.id === e)?.locked || ot((n) => t ? [.../* @__PURE__ */ new Set([...n, e])] : n.filter((t) => t !== e));
161
- }, [Bt, Vt] = c(x);
162
- x !== Bt && (Vt(x), x && (C(1), gt(!1), _t(he), yt(!1), ot([]), st(void 0), E(void 0)));
163
- let { reset: Ht } = R, { reset: Ut } = z, { reset: Wt } = H;
164
- o(() => {
165
- x && (Ht(), Ut(), Wt());
159
+ }, Ut = (e, t) => {
160
+ J.find((t) => t.id === e)?.locked || ut((n) => t ? [.../* @__PURE__ */ new Set([...n, e])] : n.filter((t) => t !== e));
161
+ }, [Wt, Gt] = s(x);
162
+ x !== Wt && (Gt(x), x && (C(1), bt(!1), xt(ge), Ct(!1), ut([]), dt(void 0), E(void 0)));
163
+ let { reset: Kt } = R, { reset: qt } = z, { reset: Jt } = H;
164
+ Ge(() => {
165
+ x && (Kt(), qt(), Jt());
166
166
  }, [
167
167
  x,
168
- Ht,
169
- Ut,
170
- Wt
168
+ Kt,
169
+ qt,
170
+ Jt
171
171
  ]);
172
- let Gt = (e) => {
173
- (!e || at) && it(e);
174
- }, Kt = (e) => {
175
- if (!_ || !v.canWrite) return;
172
+ let Yt = (e) => {
173
+ (!e || lt) && ct(e);
174
+ }, Xt = (e) => {
175
+ if (!g || !_.canWrite) return;
176
176
  let t = X.find((t) => t.id === e);
177
- nt(e), xt(we(t)), O(!0);
178
- }, qt = (e) => {
179
- e && !_ || e && !v.canWrite || O(e);
180
- }, Jt = () => {
181
- if (!_ || !v.canWrite || !b) return;
182
- let t = X.find((e) => e.id === b), n = Te(bt, t);
177
+ ot(e), Tt(Te(t)), O(!0);
178
+ }, Zt = (e) => {
179
+ e && !g || e && !_.canWrite || O(e);
180
+ }, Qt = () => {
181
+ if (!g || !_.canWrite || !b) return;
182
+ let t = X.find((e) => e.id === b), n = Ee(wt, t);
183
183
  Object.keys(n).length !== 0 && B.mutate({
184
184
  path: { id: b },
185
185
  body: n
186
186
  }, { onSuccess: () => {
187
- f(i.AccountUpdated, { accountId: b }), e.success(d.editSuccessToast), O(!1);
187
+ d(i.AccountUpdated, { accountId: b }), e.success(u.editSuccessToast), O(!1);
188
188
  } });
189
- }, Yt = (e) => {
190
- _ && v.canWrite && (nt(e), St(_e), A(!1), pt(!1), U.reset(), k(!0));
191
- }, Xt = (e) => {
192
- e && !_ || e && !v.canWrite || k(e);
193
- }, Zt = (e) => {
194
- U.reset(), A(!1), St(e);
195
- }, Qt = () => {
196
- if (!_ || !v.canWrite || !b) return;
197
- if (!xe(I)) {
198
- pt(!0);
189
+ }, $t = (e) => {
190
+ g && _.canWrite && (ot(e), Et(ve), A(!1), _t(!1), U.reset(), k(!0));
191
+ }, en = (e) => {
192
+ e && !g || e && !_.canWrite || k(e);
193
+ }, tn = (e) => {
194
+ U.reset(), A(!1), Et(e);
195
+ }, nn = () => {
196
+ if (!g || !_.canWrite || !b) return;
197
+ if (!Se(I)) {
198
+ _t(!0);
199
199
  return;
200
200
  }
201
- let t = Se(I.firstAmount), r = Se(I.secondAmount);
201
+ let t = Ce(I.firstAmount), r = Ce(I.secondAmount);
202
202
  t !== null && r !== null && (A(!1), U.mutate({
203
203
  path: { id: b },
204
204
  body: {
@@ -206,39 +206,39 @@ function u({ labels: re, featureLabels: l, isLinkAccountOpen: qe, onLinkAccountO
206
206
  secondAmount: r
207
207
  }
208
208
  }, { onSuccess: (t) => {
209
- Ge(t) ? (f(i.AccountVerified, { accountId: b }), n("tesouro-new-external-bank-account-linked-success"), e.success(d.verifySuccessToast), k(!1)) : A(!0);
209
+ qe(t) ? (d(i.AccountVerified, { accountId: b }), n("tesouro-new-external-bank-account-linked-success"), e.success(u.verifySuccessToast), k(!1)) : A(!0);
210
210
  } }));
211
- }, $t = (e) => {
212
- _ && v.canMicroDeposit && (H.reset(), P(e));
213
- }, en = (e) => {
211
+ }, rn = (e) => {
212
+ g && _.canMicroDeposit && (H.reset(), P(e));
213
+ }, an = (e) => {
214
214
  e || P(void 0);
215
- }, tn = () => {
216
- if (!_ || !v.canMicroDeposit || !N) return;
215
+ }, on = () => {
216
+ if (!g || !_.canMicroDeposit || !N) return;
217
217
  let t = N;
218
218
  E("row"), H.mutate({ path: { id: t } }, { onSuccess: () => {
219
- E(void 0), lt((e) => Ye(e, t)), f(i.AccountLinked, { accountId: t }), e.success(d.sendDepositsSuccessToast), P(void 0);
219
+ E(void 0), pt((e) => Ze(e, t)), d(i.AccountLinked, { accountId: t }), e.success(u.sendDepositsSuccessToast), P(void 0);
220
220
  } });
221
- }, nn = (e) => {
222
- _ && v.canWrite && (V.reset(), M(e));
223
- }, rn = (e) => {
221
+ }, sn = (e) => {
222
+ g && _.canWrite && (V.reset(), M(e));
223
+ }, cn = (e) => {
224
224
  e || M(void 0);
225
- }, an = () => {
226
- if (!_ || !v.canWrite || !j) return;
225
+ }, ln = () => {
226
+ if (!g || !_.canWrite || !j) return;
227
227
  let t = j;
228
228
  V.mutate({ path: { id: t } }, { onSuccess: () => {
229
- f(i.AccountUnlinked, { accountId: t }), e.success(d.unlinkSuccessToast), M(void 0);
229
+ d(i.AccountUnlinked, { accountId: t }), e.success(u.unlinkSuccessToast), M(void 0);
230
230
  } });
231
- }, on = R.isPending || z.isPending || B.isPending || U.isPending || V.isPending || H.isPending, sn = v.canWrite, cn = !_ || on, ln = !_ && h, Q = !_ && !h, [un, dn] = c(Q);
232
- Q !== un && (dn(Q), Q && (O(!1), k(!1), M(void 0), P(void 0)));
233
- let $ = H.isError && ct === "connect", fn = ze(J, {
231
+ }, un = R.isPending || z.isPending || B.isPending || U.isPending || V.isPending || H.isPending, dn = _.canWrite, fn = !g || un, pn = !g && m, Q = !g && !m || v, [mn, hn] = s(Q);
232
+ Q !== mn && (hn(Q), Q && (O(!1), k(!1), M(void 0), P(void 0)));
233
+ let $ = H.isError && ft === "connect", gn = Be(J, {
234
234
  selectedUserIds: w,
235
- disabled: cn || !sn,
236
- fallbackTooltip: u.teamMemberAccessTooltip,
237
- onUserToggle: zt
238
- }), pn = J.filter((e) => e.locked).length + w.length, mn = T ? ((e) => {
235
+ disabled: fn || !dn,
236
+ fallbackTooltip: l.teamMemberAccessTooltip,
237
+ onUserToggle: Ut
238
+ }), _n = J.filter((e) => e.locked).length + w.length, vn = T ? ((e) => {
239
239
  let t = e.accountNumber.slice(-4), n = {
240
240
  type: {
241
- text: Ae(e.accountHolderType ? Oe(e.accountHolderType) : q.accountHolderType, e.type ?? q.type, d),
241
+ text: je(e.accountHolderType ? ke(e.accountHolderType) : q.accountHolderType, e.type ?? q.type, u),
242
242
  emphasized: !1
243
243
  },
244
244
  last4: {
@@ -248,31 +248,31 @@ function u({ labels: re, featureLabels: l, isLinkAccountOpen: qe, onLinkAccountO
248
248
  };
249
249
  return D.has(e.id) ? {
250
250
  variant: "deposits-sent",
251
- description: a(d.summaryDescription, n),
251
+ description: a(u.summaryDescription, n),
252
252
  nextSteps: [{
253
253
  key: "check-bank",
254
- title: d.summaryCheckBankTitle.replaceAll("{last4}", t),
255
- description: a(d.summaryCheckBankDescription, n)
254
+ title: u.summaryCheckBankTitle.replaceAll("{last4}", t),
255
+ description: a(u.summaryCheckBankDescription, n)
256
256
  }, {
257
257
  key: "verify",
258
- title: d.summaryVerifyTitle,
259
- description: a(d.summaryVerifyDescription, n)
258
+ title: u.summaryVerifyTitle,
259
+ description: a(u.summaryVerifyDescription, n)
260
260
  }]
261
261
  } : {
262
262
  variant: "account-added",
263
- description: a(d.summaryAccountAddedDescription, n),
263
+ description: a(u.summaryAccountAddedDescription, n),
264
264
  nextSteps: []
265
265
  };
266
- })(T) : void 0, hn = De(Z, d, v, {
267
- labels: u,
268
- onEditSelect: Kt,
269
- onVerifySelect: Yt,
270
- onSendDepositsSelect: $t,
271
- onUnlinkSelect: nn
272
- }), gn = s(() => {
266
+ })(T) : void 0, yn = Oe(Z, u, _, {
267
+ labels: l,
268
+ onEditSelect: Xt,
269
+ onVerifySelect: $t,
270
+ onSendDepositsSelect: rn,
271
+ onUnlinkSelect: sn
272
+ }), bn = o(() => {
273
273
  if (!R.isError && !z.isError && !$) return;
274
274
  let e = R.error ?? z.error ?? ($ ? H.error : void 0);
275
- return r(e) ?? u.connectErrorTitle;
275
+ return r(e) ?? l.connectErrorTitle;
276
276
  }, [
277
277
  R.error,
278
278
  R.isError,
@@ -280,16 +280,17 @@ function u({ labels: re, featureLabels: l, isLinkAccountOpen: qe, onLinkAccountO
280
280
  z.isError,
281
281
  $,
282
282
  H.error,
283
- u.connectErrorTitle
283
+ l.connectErrorTitle
284
284
  ]);
285
285
  return {
286
- rows: hn,
287
- isLoading: !g && (h && !L.data || Qe && !m || y && L.isLoading),
288
- isError: g || y && L.isError,
289
- onRetry: g ? et : () => void L.refetch(),
286
+ rows: yn,
287
+ isLoading: !h && (at || m && !L.data || et && !p || y && L.isLoading),
288
+ isError: h || y && L.isError,
289
+ isAccessRestricted: v,
290
+ onRetry: h ? rt : () => void L.refetch(),
290
291
  isConnectOpen: x,
291
- isEditOpen: ut,
292
- isVerifyOpen: dt,
292
+ isEditOpen: mt,
293
+ isVerifyOpen: ht,
293
294
  verifyAccountName: Z.find((e) => e.id === b)?.nickname,
294
295
  verifyAccountNumber: Z.find((e) => e.id === b)?.accountNumber,
295
296
  isUnlinkOpen: !!j,
@@ -297,44 +298,44 @@ function u({ labels: re, featureLabels: l, isLinkAccountOpen: qe, onLinkAccountO
297
298
  isSendDepositsOpen: !!N,
298
299
  sendDepositsAccountNumber: Z.find((e) => e.id === N)?.accountNumber,
299
300
  connectStep: S,
300
- accessRows: fn,
301
- accessGrantedCount: pn,
302
- connectSummary: mn,
301
+ accessRows: gn,
302
+ accessGrantedCount: _n,
303
+ connectSummary: vn,
303
304
  isTeamMembersLoading: Y,
304
- isTeamMembersError: kt,
305
- onTeamMembersRetry: jt,
306
- isConnectRequiredErrorVisible: ht,
307
- isConnectRoutingNumberInvalid: q.routingNumber.trim() !== "" && !ye(q.routingNumber),
308
- connectErrorMessage: gn,
309
- isVerifyFirstAmountInvalid: I.firstAmount.trim() !== "" && !be(I.firstAmount),
310
- isVerifySecondAmountInvalid: I.secondAmount.trim() !== "" && !be(I.secondAmount),
311
- isVerifyRequiredErrorVisible: ft,
312
- isActionDisabled: cn,
313
- isAuthPending: ln,
314
- canConnect: sn,
315
- isSubmitting: on,
305
+ isTeamMembersError: Nt,
306
+ onTeamMembersRetry: Ft,
307
+ isConnectRequiredErrorVisible: yt,
308
+ isConnectRoutingNumberInvalid: q.routingNumber.trim() !== "" && !be(q.routingNumber),
309
+ connectErrorMessage: bn,
310
+ isVerifyFirstAmountInvalid: I.firstAmount.trim() !== "" && !xe(I.firstAmount),
311
+ isVerifySecondAmountInvalid: I.secondAmount.trim() !== "" && !xe(I.secondAmount),
312
+ isVerifyRequiredErrorVisible: gt,
313
+ isActionDisabled: fn,
314
+ isAuthPending: pn,
315
+ canConnect: dn,
316
+ isSubmitting: un,
316
317
  isConnectError: R.isError || z.isError || $,
317
318
  isEditError: B.isError,
318
319
  isUnlinkError: V.isError,
319
- isSendDepositsError: H.isError && ct === "row",
320
- isVerifyError: U.isError || mt,
320
+ isSendDepositsError: H.isError && ft === "row",
321
+ isVerifyError: U.isError || vt,
321
322
  connectForm: q,
322
- editForm: bt,
323
+ editForm: wt,
323
324
  verifyForm: I,
324
- onConnectOpenChange: Gt,
325
- onEditOpenChange: qt,
326
- onVerifyOpenChange: Xt,
327
- onUnlinkOpenChange: rn,
328
- onSendDepositsOpenChange: en,
329
- onConnectFormChange: Nt,
330
- onEditFormChange: xt,
331
- onVerifyFormChange: Zt,
332
- onConnectNext: Lt,
333
- onConnectBack: Rt,
334
- onEditSubmit: Jt,
335
- onVerifySubmit: Qt,
336
- onUnlinkConfirm: an,
337
- onSendDepositsConfirm: tn
325
+ onConnectOpenChange: Yt,
326
+ onEditOpenChange: Zt,
327
+ onVerifyOpenChange: en,
328
+ onUnlinkOpenChange: cn,
329
+ onSendDepositsOpenChange: an,
330
+ onConnectFormChange: Lt,
331
+ onEditFormChange: Tt,
332
+ onVerifyFormChange: tn,
333
+ onConnectNext: Vt,
334
+ onConnectBack: Ht,
335
+ onEditSubmit: Qt,
336
+ onVerifySubmit: nn,
337
+ onUnlinkConfirm: ln,
338
+ onSendDepositsConfirm: on
338
339
  };
339
340
  }
340
- export { l as LOCALLY_SENT_MICRO_DEPOSIT_ACCOUNT_IDS_STORAGE_KEY, u as useLinkedAccountsWidget };
341
+ export { c as LOCALLY_SENT_MICRO_DEPOSIT_ACCOUNT_IDS_STORAGE_KEY, l as useLinkedAccountsWidget };
@@ -76,6 +76,7 @@ var e = {
76
76
  actionErrorTitle: "Couldn't save account. Try again.",
77
77
  verifyErrorTitle: "Couldn't verify account. Check the amounts and try again.",
78
78
  emptyTitle: "No linked accounts yet",
79
- emptyDescription: "No external accounts have been linked yet."
79
+ emptyDescription: "No external accounts have been linked yet.",
80
+ accessRestrictedTitle: "You don't have access to linked accounts"
80
81
  };
81
82
  export { e as DEFAULT_LABELS };