@tesouro/embedded-components-react 0.7.44 → 0.7.45

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.d.ts CHANGED
@@ -3439,6 +3439,7 @@ interface Labels$1 {
3439
3439
  learnMoreButton: string;
3440
3440
  connectTitle: string;
3441
3441
  nicknameLabel: string;
3442
+ nameOnAccountLabel: string;
3442
3443
  accountNumberLabel: string;
3443
3444
  routingNumberLabel: string;
3444
3445
  routingNumberError: string;
@@ -9,6 +9,7 @@ interface Labels {
9
9
  learnMoreButton: string;
10
10
  connectTitle: string;
11
11
  nicknameLabel: string;
12
+ nameOnAccountLabel: string;
12
13
  accountNumberLabel: string;
13
14
  routingNumberLabel: string;
14
15
  routingNumberError: string;
@@ -2487,6 +2487,7 @@ interface Labels$1 {
2487
2487
  learnMoreButton: string;
2488
2488
  connectTitle: string;
2489
2489
  nicknameLabel: string;
2490
+ nameOnAccountLabel: string;
2490
2491
  accountNumberLabel: string;
2491
2492
  routingNumberLabel: string;
2492
2493
  routingNumberError: string;
@@ -3,5 +3,4 @@ import "./index3.js";
3
3
  import { useCreateDebitCardMutation as t } from "./index4.js";
4
4
  import { useCreateVelocityControlMutation as n } from "./index5.js";
5
5
  import { useManageDebitCardAccessMutation as r } from "./index6.js";
6
- import { useCreateCardOrganizationQuery as i } from "./index7.js";
7
- export { e as useCreateCard, i as useCreateCardOrganizationQuery, t as useCreateDebitCardMutation, n as useCreateVelocityControlMutation, r as useManageDebitCardAccessMutation };
6
+ export { e as useCreateCard, t as useCreateDebitCardMutation, n as useCreateVelocityControlMutation, r as useManageDebitCardAccessMutation };
@@ -7,30 +7,30 @@ import { getStateOptions as t } from "../../../../shared/util/dist/lib/usStates.
7
7
  import { Scope as n } from "../../../../shared/data-access/dist/lib/scopes.js";
8
8
  import { useAllBankAccountsQuery as r } from "../../../../shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js";
9
9
  import { useAllMerchantCategoryGroupsQuery as i } from "../../../../shared/data-access/dist/lib/merchant-category-group/useAllMerchantCategoryGroupsQuery.js";
10
- import { useAllOrganizationUsersQuery as a } from "../../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
10
+ import { useOrganizationQuery as a } from "../../../../shared/data-access/dist/lib/organization/useOrganizationQuery.js";
11
+ import { useAllOrganizationUsersQuery as o } from "../../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
11
12
  import "../../../../shared/data-access/dist/index.js";
12
- import { EmbeddedToaster as o } from "../../../../shared/ui/dist/lib/EmbeddedToaster.js";
13
+ import { EmbeddedToaster as ee } from "../../../../shared/ui/dist/lib/EmbeddedToaster.js";
13
14
  import "../../../../shared/ui/dist/index.js";
14
- import { useAnalyticsTrack as ee } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
15
+ import { useAnalyticsTrack as te } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
15
16
  import { WidgetProvider as s } from "../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
16
- import { useWidgetConfig as te } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
17
+ import { useWidgetConfig as ne } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
17
18
  import "../../../../shared/feature/dist/index.js";
18
- import { filterUsersForOrganization as ne } from "../../../../../shared/util-validation/dist/index7.js";
19
+ import { filterUsersForOrganization as re } from "../../../../../shared/util-validation/dist/index7.js";
19
20
  import { CREATE_CARD_WIDGET_LABELS_EN as c } from "../../ui/dist/lib/CreateCardWidget/labels.js";
20
21
  import { CreateCardView as l, MailingOptionValue as u } from "../../ui/dist/lib/CreateCardWidget/types.js";
21
- import { CreateCardWidget as re } from "../../ui/dist/lib/CreateCardWidget/CreateCardWidget.js";
22
+ import { CreateCardWidget as ie } from "../../ui/dist/lib/CreateCardWidget/CreateCardWidget.js";
22
23
  import "../../ui/dist/index.js";
23
- import { CardFormatValue as d, buildCreateDebitCardRequest as ie, createDebitCardReference as ae, formatBusinessAddress as oe, isBusinessAddressComplete as se, isManualAddressComplete as ce } from "./index3.js";
24
- import { resolveCreateCardFeatureLabels as le } from "./index5.js";
25
- import { CreateCardWidgetAnalyticsEvent as ue, WIDGET_NAME as de } from "./index2.js";
26
- import { SpendLimitPeriodValue as f, buildPerTransactionMaximumVelocityControlRequest as fe, buildSpendLimitVelocityControlRequest as pe, parseControlAmountToMinorUnits as me } from "./index4.js";
27
- import { getCreateCardPermissions as he } from "./index6.js";
28
- import { useCreateCardCardholderOptions as ge } from "./index7.js";
29
- import { useCreateCard as _e } from "../../data-access/dist/index2.js";
30
- import { useCreateDebitCardMutation as ve } from "../../data-access/dist/index4.js";
31
- import { useCreateVelocityControlMutation as ye } from "../../data-access/dist/index5.js";
32
- import { useManageDebitCardAccessMutation as be } from "../../data-access/dist/index6.js";
33
- import { useCreateCardOrganizationQuery as xe } from "../../data-access/dist/index7.js";
24
+ import { CardFormatValue as d, buildCreateDebitCardRequest as ae, createDebitCardReference as oe, formatBusinessAddress as se, isBusinessAddressComplete as ce, isManualAddressComplete as le } from "./index3.js";
25
+ import { resolveCreateCardFeatureLabels as ue } from "./index5.js";
26
+ import { CreateCardWidgetAnalyticsEvent as de, WIDGET_NAME as fe } from "./index2.js";
27
+ import { SpendLimitPeriodValue as f, buildPerTransactionMaximumVelocityControlRequest as pe, buildSpendLimitVelocityControlRequest as me, parseControlAmountToMinorUnits as he } from "./index4.js";
28
+ import { getCreateCardPermissions as ge } from "./index6.js";
29
+ import { useCreateCardCardholderOptions as _e } from "./index7.js";
30
+ import { useCreateCard as ve } from "../../data-access/dist/index2.js";
31
+ import { useCreateDebitCardMutation as ye } from "../../data-access/dist/index4.js";
32
+ import { useCreateVelocityControlMutation as be } from "../../data-access/dist/index5.js";
33
+ import { useManageDebitCardAccessMutation as xe } from "../../data-access/dist/index6.js";
34
34
  import "../../data-access/dist/index.js";
35
35
  import { useEffect as p, useMemo as m, useRef as h, useState as g } from "react";
36
36
  import { Fragment as Se, jsx as _, jsxs as Ce } from "react/jsx-runtime";
@@ -59,8 +59,8 @@ function ke(e, t) {
59
59
  let n = e.nickname?.trim(), r = Oe(e.accountNumber);
60
60
  return n && r ? `${n} (${r})` : n || r || t;
61
61
  }
62
- function y({ cardArtSrc: n, labels: s, featureLabels: de, className: Oe, onClose: y, onCancel: Ae, onViewCard: je }) {
63
- let Me = ee(), { isReady: b } = _e(), { initResponse: Ne, organizationId: x } = te(), S = m(() => he(Ne?.scopes), [Ne?.scopes]), C = le(de), w = {
62
+ function y({ cardArtSrc: n, labels: s, featureLabels: fe, className: Oe, onClose: y, onCancel: Ae, onViewCard: je }) {
63
+ let Me = te(), { isReady: b } = ve(), { initResponse: Ne, organizationId: x } = ne(), S = m(() => ge(Ne?.scopes), [Ne?.scopes]), C = ue(fe), w = {
64
64
  ...c,
65
65
  ...s,
66
66
  setup: {
@@ -81,12 +81,12 @@ function y({ cardArtSrc: n, labels: s, featureLabels: de, className: Oe, onClose
81
81
  p(() => (W.current = !0, () => {
82
82
  W.current = !1;
83
83
  }), []), p(() => {
84
- Me(ue.Mounted);
84
+ Me(de.Mounted);
85
85
  }, [Me]);
86
- let { options: Ye, isError: G, refetch: Xe } = ge({ enabled: b && S.canReadUsers }), K = a({
86
+ let { options: Ye, isError: G, refetch: Xe } = _e({ enabled: b && S.canReadUsers }), K = o({
87
87
  enabled: b && S.canReadUsers,
88
88
  permissions: [we]
89
- }), Ze = m(() => !b || !S.canReadUsers || K.isResolving || K.isError ? [] : ne(K.data?.data ?? [], x).map((e) => e.id), [
89
+ }), Ze = m(() => !b || !S.canReadUsers || K.isResolving || K.isError ? [] : re(K.data?.data ?? [], x).map((e) => e.id), [
90
90
  K.data?.data,
91
91
  K.isError,
92
92
  K.isResolving,
@@ -116,7 +116,7 @@ function y({ cardArtSrc: n, labels: s, featureLabels: de, className: Oe, onClose
116
116
  C.toast.retry,
117
117
  q
118
118
  ]);
119
- let $e = xe({ enabled: b && S.canReadOrganization }), Y = r({ enabled: b && S.canReadFundingAccounts }), et = i({ enabled: b && S.canReadMerchantCategoryGroups }), tt = ve(), nt = ye(), rt = be(), X = !!Y.isError && b && S.canReadFundingAccounts, Z = m(() => X ? [] : (Y.data?.data ?? []).map((e) => ({
119
+ let $e = a({ enabled: b && S.canReadOrganization }), Y = r({ enabled: b && S.canReadFundingAccounts }), et = i({ enabled: b && S.canReadMerchantCategoryGroups }), tt = ye(), nt = be(), rt = xe(), X = !!Y.isError && b && S.canReadFundingAccounts, Z = m(() => X ? [] : (Y.data?.data ?? []).map((e) => ({
120
120
  value: e.id,
121
121
  label: ke(e, C.untitledFundingAccount)
122
122
  })), [
@@ -126,7 +126,7 @@ function y({ cardArtSrc: n, labels: s, featureLabels: de, className: Oe, onClose
126
126
  ]), Q = m(() => (et.data?.data ?? []).map((e) => ({
127
127
  value: e.id,
128
128
  label: e.name
129
- })), [et.data?.data]), $ = ze ?? (Z.length === 1 ? Z[0].value : null), it = $e.data?.address, at = oe(it), ot = se(it), st = D === d.Physical, ct = st && O === u.BusinessAddress && !!at, lt = st && O === u.DifferentAddress, ut = X || Z.length > 0, dt = b && S.canWriteAuthorizationControls, ft = m(() => [
129
+ })), [et.data?.data]), $ = ze ?? (Z.length === 1 ? Z[0].value : null), it = $e.data?.address, at = se(it), ot = ce(it), st = D === d.Physical, ct = st && O === u.BusinessAddress && !!at, lt = st && O === u.DifferentAddress, ut = X || Z.length > 0, dt = b && S.canWriteAuthorizationControls, ft = m(() => [
130
130
  {
131
131
  value: f.OneTime,
132
132
  label: C.spendLimit.periodOneTime
@@ -165,7 +165,7 @@ function y({ cardArtSrc: n, labels: s, featureLabels: de, className: Oe, onClose
165
165
  C.spendLimit.monthlyResetNotice,
166
166
  C.spendLimit.oneTimeWarningDescription,
167
167
  C.spendLimit.oneTimeWarningTitle
168
- ]), mt = A && (me(M) === null || P === null), ht = I && me(R) === null, gt = B && H.length === 0, _t = Q.length === 0 && !B;
168
+ ]), mt = A && (he(M) === null || P === null), ht = I && he(R) === null, gt = B && H.length === 0, _t = Q.length === 0 && !B;
169
169
  dt || (A && j(!1), M !== "" && N(""), P !== null && F(null), I && L(!1), R !== "" && z(""), B && V(!1), H.length > 0 && U([]));
170
170
  let vt = m(() => ({
171
171
  isSpendLimitEnabled: A,
@@ -202,7 +202,7 @@ function y({ cardArtSrc: n, labels: s, featureLabels: de, className: Oe, onClose
202
202
  M,
203
203
  pt,
204
204
  ft
205
- ]), yt = !b || !S.canIssue || tt.isPending || nt.isPending || rt.isPending || G || X || q || Qe || !E || !D || !$ || mt || ht || gt || D === d.Physical && (!O || O === u.BusinessAddress && !ot || O === u.DifferentAddress && !ce(Ve)), bt = m(() => {
205
+ ]), yt = !b || !S.canIssue || tt.isPending || nt.isPending || rt.isPending || G || X || q || Qe || !E || !D || !$ || mt || ht || gt || D === d.Physical && (!O || O === u.BusinessAddress && !ot || O === u.DifferentAddress && !le(Ve)), bt = m(() => {
206
206
  let e = De(Ge, C);
207
207
  return {
208
208
  ...s,
@@ -217,7 +217,7 @@ function y({ cardArtSrc: n, labels: s, featureLabels: de, className: Oe, onClose
217
217
  s
218
218
  ]), xt = async () => {
219
219
  if (!b) return;
220
- let t = ae(), n = ie({
220
+ let t = oe(), n = ae({
221
221
  cardholderUserId: E,
222
222
  format: D,
223
223
  bankAccountId: $,
@@ -238,7 +238,7 @@ function y({ cardArtSrc: n, labels: s, featureLabels: de, className: Oe, onClose
238
238
  We(t.id), Ke(t.cardStatus);
239
239
  let i = [];
240
240
  if (A) {
241
- let e = pe({
241
+ let e = me({
242
242
  cardId: t.id,
243
243
  amount: M,
244
244
  period: P,
@@ -248,7 +248,7 @@ function y({ cardArtSrc: n, labels: s, featureLabels: de, className: Oe, onClose
248
248
  e && i.push(e);
249
249
  }
250
250
  if (I) {
251
- let e = fe({
251
+ let e = pe({
252
252
  cardId: t.id,
253
253
  amount: R,
254
254
  id: crypto.randomUUID(),
@@ -316,7 +316,7 @@ function y({ cardArtSrc: n, labels: s, featureLabels: de, className: Oe, onClose
316
316
  });
317
317
  }
318
318
  };
319
- return /* @__PURE__ */ Ce(Se, { children: [/* @__PURE__ */ _(o, {}), /* @__PURE__ */ _(re, {
319
+ return /* @__PURE__ */ Ce(Se, { children: [/* @__PURE__ */ _(ee, {}), /* @__PURE__ */ _(ie, {
320
320
  view: Ie,
321
321
  cardArtSrc: n,
322
322
  labels: bt,
@@ -367,9 +367,9 @@ function y({ cardArtSrc: n, labels: s, featureLabels: de, className: Oe, onClose
367
367
  } : void 0
368
368
  })] });
369
369
  }
370
- function Ae({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: ee, errorFallback: te, onError: ne, analytics: c, disclosuresAcceptance: l, providerLabels: u, ...re }) {
370
+ function Ae({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: ee, errorFallback: te, onError: ne, analytics: re, disclosuresAcceptance: c, providerLabels: l, ...u }) {
371
371
  return /* @__PURE__ */ _(s, {
372
- widgetName: de,
372
+ widgetName: fe,
373
373
  baseUrl: e,
374
374
  widgetToken: t,
375
375
  organizationId: n,
@@ -380,10 +380,10 @@ function Ae({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, ga
380
380
  uiFramework: ee,
381
381
  errorFallback: te,
382
382
  onError: ne,
383
- analytics: c,
384
- disclosuresAcceptance: l,
385
- providerLabels: u,
386
- children: /* @__PURE__ */ _(y, { ...re })
383
+ analytics: re,
384
+ disclosuresAcceptance: c,
385
+ providerLabels: l,
386
+ children: /* @__PURE__ */ _(y, { ...u })
387
387
  });
388
388
  }
389
389
  //#endregion
@@ -2,6 +2,7 @@
2
2
  var e = {
3
3
  accountHolderType: "",
4
4
  nickname: "",
5
+ nameOnAccount: "",
5
6
  accountNumber: "",
6
7
  routingNumber: "",
7
8
  type: ""
@@ -21,7 +22,7 @@ function n(e) {
21
22
  return r % 10 == 0;
22
23
  }
23
24
  function r(e) {
24
- return e.accountHolderType !== "" && e.type !== "" && e.nickname.trim() !== "" && e.accountNumber.trim() !== "" && n(e.routingNumber);
25
+ return e.accountHolderType !== "" && e.type !== "" && e.nameOnAccount.trim() !== "" && e.nickname.trim() !== "" && e.accountNumber.trim() !== "" && n(e.routingNumber);
25
26
  }
26
27
  var i = {
27
28
  nickname: "",
@@ -2,14 +2,15 @@ import { hasAnyScope as e } from "../../../../shared/data-access/dist/lib/hasAny
2
2
  import { Scope as t } from "../../../../shared/data-access/dist/lib/scopes.js";
3
3
  import "../../../../shared/data-access/dist/index.js";
4
4
  //#region ../../libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/permissions.js
5
- var n = [t.ExternalBankAccountReadOrg], r = [t.ExternalBankAccountWriteOrg], i = [t.ExternalBankAccountMicroDepositOrg];
6
- function a(t) {
7
- let a = new Set(t ?? []);
5
+ var n = [t.ExternalBankAccountReadOrg], r = [t.ExternalBankAccountWriteOrg], i = [t.ExternalBankAccountMicroDepositOrg], a = [t.OrganizationReadOrg];
6
+ function o(t) {
7
+ let o = new Set(t ?? []);
8
8
  return {
9
- canRead: e(a, n),
10
- canWrite: e(a, r),
11
- canMicroDeposit: e(a, i)
9
+ canRead: e(o, n),
10
+ canWrite: e(o, r),
11
+ canMicroDeposit: e(o, i),
12
+ canReadOrganization: e(o, a)
12
13
  };
13
14
  }
14
15
  //#endregion
15
- export { a as getLinkedAccountsPermissions };
16
+ export { o as getLinkedAccountsPermissions };
@@ -7,42 +7,43 @@ import { TESOURO_NEW_EXTERNAL_BANK_ACCOUNT_LINKED_SUCCESS_EVENT as t, emitWidget
7
7
  import { extractApiErrorMessage as ee } from "../../../../shared/util/dist/lib/apiErrors.js";
8
8
  import { OrganizationStatus as te, isOrganizationOnItsWay as ne } from "../../../../shared/data-access/dist/lib/organizationStatus.js";
9
9
  import { useEmbedApi as re } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
10
- import { Scope as r } from "../../../../shared/data-access/dist/lib/scopes.js";
11
- import { useAllOrganizationRolesQuery as ie } from "../../../../shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js";
12
- import { useAllOrganizationUsersQuery as ae } from "../../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
10
+ import { Scope as ie } from "../../../../shared/data-access/dist/lib/scopes.js";
11
+ import { useOrganizationQuery as ae } from "../../../../shared/data-access/dist/lib/organization/useOrganizationQuery.js";
12
+ import { useAllOrganizationRolesQuery as oe } from "../../../../shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js";
13
+ import { useAllOrganizationUsersQuery as se } from "../../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
13
14
  import "../../../../shared/data-access/dist/index.js";
14
15
  import "../../../../shared/ui/dist/index.js";
15
- import { useAnalyticsTrack as oe } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
16
- import { useWidgetConfig as se, useWidgetError as ce, useWidgetLoading as le } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
16
+ import { useAnalyticsTrack as ce } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
17
+ import { useWidgetConfig as le, useWidgetError as ue, useWidgetLoading as de } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
17
18
  import "../../../../shared/feature/dist/index.js";
18
- import { filterRolesForOrganization as ue } from "../../../../../shared/util-validation/dist/index6.js";
19
- import { filterUsersForOrganization as de } from "../../../../../shared/util-validation/dist/index7.js";
20
- import { DEFAULT_FEATURE_LABELS as fe } from "./labels.js";
21
- import { LinkedAccountsWidgetAnalyticsEvent as i } from "./analytics/events.js";
22
- import { EMPTY_CONNECT_FORM as pe, EMPTY_EDIT_FORM as me, EMPTY_VERIFY_FORM as he, isConnectStep1Valid as ge, isRoutingNumberValid as _e, isVerifyAmountInRange as ve, isVerifyFormValid as ye, parseVerifyAmountToMinorUnits as a, sanitizeRoutingNumberInput as be, toEditForm as xe, toUpdateBody as Se } from "./forms.js";
23
- import { getLinkedAccountsPermissions as Ce } from "./permissions.js";
24
- import { toAccountRows as we } from "./rows.js";
25
- import { fromApiAccountHolderType as Te, toApiAccountHolderType as Ee, toSummaryTypeLabel as De, toTextParts as o } from "./summary.js";
26
- import { useConnectExternalBankAccountMutation as Oe } from "../../../data-access/dist/index3.js";
27
- import { useExternalBankAccountsQuery as ke } from "../../../data-access/dist/index4.js";
28
- import { useGrantExternalBankAccountAccessMutation as Ae } from "../../../data-access/dist/index5.js";
29
- import { useLinkExternalBankAccountMutation as je } from "../../../data-access/dist/index6.js";
30
- import { useUnlinkExternalBankAccountMutation as Me } from "../../../data-access/dist/index9.js";
31
- import { useUpdateExternalBankAccountMutation as Ne } from "../../../data-access/dist/index10.js";
32
- import { useValidateExternalBankAccountMutation as Pe } from "../../../data-access/dist/index11.js";
19
+ import { filterRolesForOrganization as fe } from "../../../../../shared/util-validation/dist/index6.js";
20
+ import { filterUsersForOrganization as pe } from "../../../../../shared/util-validation/dist/index7.js";
21
+ import { DEFAULT_FEATURE_LABELS as me } from "./labels.js";
22
+ import { LinkedAccountsWidgetAnalyticsEvent as r } from "./analytics/events.js";
23
+ import { EMPTY_CONNECT_FORM as he, EMPTY_EDIT_FORM as ge, EMPTY_VERIFY_FORM as i, isConnectStep1Valid as a, isRoutingNumberValid as _e, isVerifyAmountInRange as ve, isVerifyFormValid as ye, parseVerifyAmountToMinorUnits as be, sanitizeRoutingNumberInput as xe, toEditForm as Se, toUpdateBody as Ce } from "./forms.js";
24
+ import { getLinkedAccountsPermissions as we } from "./permissions.js";
25
+ import { toAccountRows as Te } from "./rows.js";
26
+ import { fromApiAccountHolderType as Ee, toApiAccountHolderType as De, toSummaryTypeLabel as Oe, toTextParts as o } from "./summary.js";
27
+ import { useConnectExternalBankAccountMutation as ke } from "../../../data-access/dist/index3.js";
28
+ import { useExternalBankAccountsQuery as Ae } from "../../../data-access/dist/index4.js";
29
+ import { useGrantExternalBankAccountAccessMutation as je } from "../../../data-access/dist/index5.js";
30
+ import { useLinkExternalBankAccountMutation as Me } from "../../../data-access/dist/index6.js";
31
+ import { useUnlinkExternalBankAccountMutation as Ne } from "../../../data-access/dist/index9.js";
32
+ import { useUpdateExternalBankAccountMutation as Pe } from "../../../data-access/dist/index10.js";
33
+ import { useValidateExternalBankAccountMutation as Fe } from "../../../data-access/dist/index11.js";
33
34
  import "../../../data-access/dist/index.js";
34
- import { useAdminEligibleUserIds as Fe } from "./useAdminEligibleUserIds.js";
35
- import { toAccessRows as Ie, toOrganizationRoleOptions as Le, toTeamMembers as Re } from "./teamMembers.js";
36
- import { DEFAULT_LABELS as ze } from "../../../ui/dist/index15.js";
35
+ import { useAdminEligibleUserIds as Ie } from "./useAdminEligibleUserIds.js";
36
+ import { toAccessRows as Le, toOrganizationRoleOptions as Re, toTeamMembers as ze } from "./teamMembers.js";
37
+ import { DEFAULT_LABELS as Be } from "../../../ui/dist/index15.js";
37
38
  import "../../../ui/dist/index.js";
38
- import { useCallback as Be, useEffect as Ve, useMemo as s, useState as c } from "react";
39
+ import { useCallback as Ve, useEffect as He, useMemo as s, useState as c } from "react";
39
40
  //#region ../../libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js
40
- function He(e) {
41
+ function Ue(e) {
41
42
  let t = e;
42
43
  return typeof e == "object" && !!e && "verificationStatus" in e && t.verificationStatus === "VERIFIED";
43
44
  }
44
45
  var l = "tesouro.linkedAccounts.locallySentMicroDepositAccountIds.v1";
45
- function Ue() {
46
+ function We() {
46
47
  if (typeof window > "u") return /* @__PURE__ */ new Set();
47
48
  try {
48
49
  let e = window.sessionStorage.getItem(l), t = e ? JSON.parse(e) : [];
@@ -59,158 +60,166 @@ function d(e) {
59
60
  window.sessionStorage.setItem(l, JSON.stringify([...e]));
60
61
  } catch {}
61
62
  }
62
- function f(e, t) {
63
+ function Ge(e, t) {
63
64
  let n = new Set(e).add(t);
64
65
  return d(n), n;
65
66
  }
66
- var We = r.ExternalBankAccountWriteOrg;
67
- function p({ labels: r, featureLabels: l }) {
67
+ var Ke = ie.ExternalBankAccountWriteOrg;
68
+ function f({ labels: ie, featureLabels: l }) {
68
69
  let u = {
69
- ...ze,
70
- ...r
70
+ ...Be,
71
+ ...ie
71
72
  }, d = {
72
- ...fe,
73
+ ...me,
73
74
  ...l
74
- }, p = oe(), { organizationId: m, widgetToken: Ge, initResponse: h } = se(), Ke = le(), { organizationStatus: qe } = re(), Je = ne(qe), Ye = !!ce(), g = !!(m && Ge), Xe = g || !!Ge && qe === te.Rotating, _ = s(() => Ce(h?.scopes), [h?.scopes]), v = Xe && _.canRead && !!h, [y, b] = c(), [x, Ze] = c(!1), [S, C] = c(1), [w, Qe] = c([]), [T, $e] = c(), [et, E] = c(), [D, tt] = c(Ue), [nt, O] = c(!1), [rt, it] = c(!1), [at, k] = c(!1), [ot, A] = c(!1), [j, M] = c(), [N, P] = c(pe), [F, I] = c(me), [L, R] = c(he);
75
- Ve(() => {
76
- p(i.Mounted);
77
- }, [p]);
78
- let z = ke({
75
+ }, f = ce(), { organizationId: p, widgetToken: qe, initResponse: m } = le(), Je = de(), { organizationStatus: Ye } = re(), Xe = ne(Ye), Ze = !!ue(), h = !!(p && qe), Qe = h || !!qe && Ye === te.Rotating, g = s(() => we(m?.scopes), [m?.scopes]), _ = Qe && g.canRead && !!m, [v, $e] = c(), [y, et] = c(!1), [b, x] = c(1), [S, tt] = c([]), [C, nt] = c(), [rt, w] = c(), [T, it] = c(We), [at, E] = c(!1), [ot, st] = c(!1), [ct, D] = c(!1), [lt, O] = c(!1), [k, A] = c(), [j, ut] = c(he), [M, N] = c(!1), [P, F] = c(ge), [I, L] = c(i);
76
+ He(() => {
77
+ f(r.Mounted);
78
+ }, [f]);
79
+ let R = Ae({
79
80
  limit: 100,
80
- enabled: v
81
- }), B = Oe(), V = Ae(), H = Ne(), U = Me(), W = je(), G = Pe(), K = x && S >= 2, q = ae({ enabled: K }), J = ie({ enabled: K }), { userIds: st, isResolving: ct, isError: lt } = Fe({
82
- enabled: K,
83
- permissionKey: We,
84
- organizationId: m
81
+ enabled: _
82
+ }), z = ke(), B = je(), V = Pe(), H = Ne(), U = Me(), W = Fe(), G = y && b >= 2, K = se({ enabled: G }), q = oe({ enabled: G }), dt = ae({ enabled: y && g.canReadOrganization }).data?.legalName ?? "", J = s(() => M ? j : {
83
+ ...j,
84
+ nameOnAccount: dt
85
+ }, [
86
+ M,
87
+ j,
88
+ dt
89
+ ]), { userIds: ft, isResolving: pt, isError: mt } = Ie({
90
+ enabled: G,
91
+ permissionKey: Ke,
92
+ organizationId: p
85
93
  }), Y = s(() => {
86
- let e = J.data?.data ?? [], t = m ? ue(e, {
87
- organizationId: m,
88
- organizationTypes: h?.organizationTypes ?? []
89
- }) : e, n = de(q.data?.data ?? [], m);
90
- return Re(n, Le(t), st);
94
+ let e = q.data?.data ?? [], t = p ? fe(e, {
95
+ organizationId: p,
96
+ organizationTypes: m?.organizationTypes ?? []
97
+ }) : e, n = pe(K.data?.data ?? [], p);
98
+ return ze(n, Re(t), ft);
91
99
  }, [
92
- st,
93
- J.data?.data,
100
+ ft,
94
101
  q.data?.data,
95
- m,
96
- h?.organizationTypes
97
- ]), ut = q.isLoading || q.isFetchingNextPage || !!q.hasNextPage || J.isResolving || ct, dt = !ut && !q.isError && !lt, X = v ? z.data?.data ?? [] : [], Z = s(() => X.map((e) => e.verificationStatus === "UNVERIFIED" && D.has(e.id) ? {
102
+ K.data?.data,
103
+ p,
104
+ m?.organizationTypes
105
+ ]), ht = K.isLoading || K.isFetchingNextPage || !!K.hasNextPage || q.isResolving || pt, gt = !ht && !K.isError && !mt, X = _ ? R.data?.data ?? [] : [], Z = s(() => X.map((e) => e.verificationStatus === "UNVERIFIED" && T.has(e.id) ? {
98
106
  ...e,
99
107
  verificationStatus: "VERIFICATION_SENT"
100
- } : e), [X, D]), ft = [.../* @__PURE__ */ new Set([...Y.filter((e) => e.locked).map((e) => e.id), ...w])], pt = Be((e) => {
101
- B.reset(), V.reset(), W.reset(), P({
108
+ } : e), [X, T]), _t = [.../* @__PURE__ */ new Set([...Y.filter((e) => e.locked).map((e) => e.id), ...S])], vt = Ve((e) => {
109
+ z.reset(), B.reset(), U.reset(), e.nameOnAccount !== J.nameOnAccount && N(!0), ut({
102
110
  ...e,
103
- routingNumber: be(e.routingNumber)
111
+ routingNumber: xe(e.routingNumber)
104
112
  });
105
113
  }, [
114
+ J.nameOnAccount,
115
+ z,
106
116
  B,
107
- V,
108
- W
109
- ]), mt = () => {
110
- C(3), n(t);
111
- }, ht = (e) => {
112
- if (!_.canMicroDeposit) {
113
- mt();
117
+ U
118
+ ]), Q = () => {
119
+ x(3), n(t);
120
+ }, yt = (e) => {
121
+ if (!g.canMicroDeposit) {
122
+ Q();
114
123
  return;
115
124
  }
116
- E("connect"), W.mutate({ path: { id: e } }, { onSuccess: () => {
117
- E(void 0), tt((t) => f(t, e)), p(i.AccountLinked, { accountId: e }), mt();
125
+ w("connect"), U.mutate({ path: { id: e } }, { onSuccess: () => {
126
+ w(void 0), it((t) => Ge(t, e)), f(r.AccountLinked, { accountId: e }), Q();
118
127
  } });
119
- }, Q = (e) => {
120
- V.mutate({
128
+ }, bt = (e) => {
129
+ B.mutate({
121
130
  path: { id: e },
122
- body: { userIds: ft }
123
- }, { onSuccess: () => ht(e) });
124
- }, gt = () => {
125
- if (g && _.canWrite) {
126
- if (S === 1) {
127
- if (!ge(N)) return;
128
- C(2);
131
+ body: { userIds: _t }
132
+ }, { onSuccess: () => yt(e) });
133
+ }, xt = () => {
134
+ if (h && g.canWrite) {
135
+ if (b === 1) {
136
+ if (!a(J)) return;
137
+ x(2);
129
138
  return;
130
139
  }
131
- if (S === 2 && dt) {
132
- if (T) {
133
- Q(T.id);
140
+ if (b === 2 && gt) {
141
+ if (C) {
142
+ bt(C.id);
134
143
  return;
135
144
  }
136
- B.mutate({ body: {
137
- nickname: N.nickname.trim(),
138
- accountNumber: N.accountNumber.trim(),
139
- routingNumber: N.routingNumber.trim(),
140
- nameOnAccount: N.nickname.trim(),
141
- type: N.type,
142
- accountHolderType: Ee(N.accountHolderType)
145
+ z.mutate({ body: {
146
+ nickname: J.nickname.trim(),
147
+ accountNumber: J.accountNumber.trim(),
148
+ routingNumber: J.routingNumber.trim(),
149
+ nameOnAccount: J.nameOnAccount.trim(),
150
+ type: J.type,
151
+ accountHolderType: De(J.accountHolderType)
143
152
  } }, { onSuccess: (e) => {
144
- p(i.AccountConnected, { accountId: e?.id }), $e(e), e?.id && Q(e.id);
153
+ f(r.AccountConnected, { accountId: e?.id }), nt(e), e?.id && bt(e.id);
145
154
  } });
146
155
  }
147
156
  }
148
- }, _t = () => {
149
- S === 2 && C(1);
150
- }, vt = (e, t) => {
151
- Y.find((t) => t.id === e)?.locked || Qe((n) => t ? [.../* @__PURE__ */ new Set([...n, e])] : n.filter((t) => t !== e));
152
- }, yt = (e) => {
153
- (!e || g) && (!e || _.canWrite) && (e && (C(1), P(pe), Qe([]), $e(void 0), E(void 0), B.reset(), V.reset(), W.reset()), Ze(e));
154
- }, bt = (e) => {
155
- if (!g || !_.canWrite) return;
156
- let t = X.find((t) => t.id === e);
157
- b(e), I(xe(t)), O(!0);
158
- }, xt = (e) => {
159
- (!e || g) && (!e || _.canWrite) && O(e);
160
157
  }, St = () => {
161
- if (!g || !_.canWrite || !y) return;
162
- let t = X.find((e) => e.id === y), n = Se(F, t);
163
- Object.keys(n).length !== 0 && H.mutate({
164
- path: { id: y },
158
+ b === 2 && x(1);
159
+ }, Ct = (e, t) => {
160
+ Y.find((t) => t.id === e)?.locked || tt((n) => t ? [.../* @__PURE__ */ new Set([...n, e])] : n.filter((t) => t !== e));
161
+ }, wt = (e) => {
162
+ (!e || h) && (!e || g.canWrite) && (e && (x(1), ut(he), N(!1), tt([]), nt(void 0), w(void 0), z.reset(), B.reset(), U.reset()), et(e));
163
+ }, Tt = (e) => {
164
+ if (!h || !g.canWrite) return;
165
+ let t = X.find((t) => t.id === e);
166
+ $e(e), F(Se(t)), E(!0);
167
+ }, Et = (e) => {
168
+ (!e || h) && (!e || g.canWrite) && E(e);
169
+ }, Dt = () => {
170
+ if (!h || !g.canWrite || !v) return;
171
+ let t = X.find((e) => e.id === v), n = Ce(P, t);
172
+ Object.keys(n).length !== 0 && V.mutate({
173
+ path: { id: v },
165
174
  body: n
166
175
  }, { onSuccess: () => {
167
- p(i.AccountUpdated, { accountId: y }), e.success(d.editSuccessToast), O(!1);
176
+ f(r.AccountUpdated, { accountId: v }), e.success(d.editSuccessToast), E(!1);
168
177
  } });
169
- }, Ct = (e) => {
170
- g && _.canWrite && (b(e), R(he), A(!1), k(!1), it(!0));
171
- }, wt = (e) => {
172
- (!e || g) && (!e || _.canWrite) && (e || (A(!1), k(!1)), it(e));
173
- }, Tt = (e) => {
174
- G.reset(), A(!1), R(e);
175
- }, Et = () => {
176
- if (!g || !_.canWrite || !y || !ye(L)) return;
177
- let e = a(L.firstAmount), t = a(L.secondAmount);
178
- e !== null && t !== null && (A(!1), G.mutate({
179
- path: { id: y },
178
+ }, Ot = (e) => {
179
+ h && g.canWrite && ($e(e), L(i), O(!1), D(!1), st(!0));
180
+ }, kt = (e) => {
181
+ (!e || h) && (!e || g.canWrite) && (e || (O(!1), D(!1)), st(e));
182
+ }, At = (e) => {
183
+ W.reset(), O(!1), L(e);
184
+ }, jt = () => {
185
+ if (!h || !g.canWrite || !v || !ye(I)) return;
186
+ let e = be(I.firstAmount), t = be(I.secondAmount);
187
+ e !== null && t !== null && (O(!1), W.mutate({
188
+ path: { id: v },
180
189
  body: {
181
190
  firstAmount: e,
182
191
  secondAmount: t
183
192
  }
184
193
  }, { onSuccess: (e) => {
185
- if (!He(e)) {
186
- A(!0);
194
+ if (!Ue(e)) {
195
+ O(!0);
187
196
  return;
188
197
  }
189
- p(i.AccountVerified, { accountId: y }), n("tesouro-new-external-bank-account-linked-success"), k(!0);
198
+ f(r.AccountVerified, { accountId: v }), n("tesouro-new-external-bank-account-linked-success"), D(!0);
190
199
  } }));
191
- }, Dt = (e) => {
192
- g && _.canMicroDeposit && (E("row"), W.mutate({ path: { id: e } }, { onSuccess: () => {
193
- E(void 0), tt((t) => f(t, e)), p(i.AccountLinked, { accountId: e });
200
+ }, Mt = (e) => {
201
+ h && g.canMicroDeposit && (w("row"), U.mutate({ path: { id: e } }, { onSuccess: () => {
202
+ w(void 0), it((t) => Ge(t, e)), f(r.AccountLinked, { accountId: e });
194
203
  } }));
195
- }, Ot = (e) => {
196
- g && _.canWrite && M(e);
197
- }, kt = (e) => {
198
- e || M(void 0);
199
- }, At = () => {
200
- if (!g || !_.canWrite || !j) return;
201
- let t = j;
202
- U.mutate({ path: { id: t } }, { onSuccess: () => {
203
- p(i.AccountUnlinked, { accountId: t }), e.success(d.unlinkSuccessToast), M(void 0);
204
+ }, Nt = (e) => {
205
+ h && g.canWrite && A(e);
206
+ }, Pt = (e) => {
207
+ e || A(void 0);
208
+ }, Ft = () => {
209
+ if (!h || !g.canWrite || !k) return;
210
+ let t = k;
211
+ H.mutate({ path: { id: t } }, { onSuccess: () => {
212
+ f(r.AccountUnlinked, { accountId: t }), e.success(d.unlinkSuccessToast), A(void 0);
204
213
  } });
205
- }, jt = B.isPending || V.isPending || H.isPending || G.isPending || U.isPending || W.isPending, Mt = _.canWrite, Nt = !g || jt, $ = W.isError && et === "connect", Pt = Ie(Y, {
206
- selectedUserIds: w,
207
- disabled: Nt || !Mt,
214
+ }, It = z.isPending || B.isPending || V.isPending || W.isPending || H.isPending || U.isPending, Lt = g.canWrite, Rt = !h || It, $ = U.isError && rt === "connect", zt = Le(Y, {
215
+ selectedUserIds: S,
216
+ disabled: Rt || !Lt,
208
217
  fallbackTooltip: u.teamMemberAccessTooltip,
209
- onUserToggle: vt
210
- }), Ft = Y.filter((e) => e.locked).length + w.length, It = T ? ((e) => {
218
+ onUserToggle: Ct
219
+ }), Bt = Y.filter((e) => e.locked).length + S.length, Vt = C ? ((e) => {
211
220
  let t = e.accountNumber.slice(-4), n = {
212
221
  type: {
213
- text: De(e.accountHolderType ? Te(e.accountHolderType) : N.accountHolderType, e.type ?? N.type, d),
222
+ text: Oe(e.accountHolderType ? Ee(e.accountHolderType) : J.accountHolderType, e.type ?? J.type, d),
214
223
  emphasized: !1
215
224
  },
216
225
  last4: {
@@ -218,7 +227,7 @@ function p({ labels: r, featureLabels: l }) {
218
227
  emphasized: !0
219
228
  }
220
229
  };
221
- return D.has(e.id) ? {
230
+ return T.has(e.id) ? {
222
231
  variant: "deposits-sent",
223
232
  description: o(d.summaryDescription, n),
224
233
  nextSteps: [{
@@ -235,72 +244,72 @@ function p({ labels: r, featureLabels: l }) {
235
244
  description: o(d.summaryAccountAddedDescription, n),
236
245
  nextSteps: []
237
246
  };
238
- })(T) : void 0, Lt = we(Z, d, _, {
247
+ })(C) : void 0, Ht = Te(Z, d, g, {
239
248
  labels: u,
240
- onEditSelect: bt,
241
- onVerifySelect: Ct,
242
- onLinkSelect: Dt,
243
- onUnlinkSelect: Ot
244
- }), Rt = s(() => {
245
- if (!B.isError && !V.isError && !$) return;
246
- let e = B.error ?? V.error ?? ($ ? W.error : void 0);
249
+ onEditSelect: Tt,
250
+ onVerifySelect: Ot,
251
+ onLinkSelect: Mt,
252
+ onUnlinkSelect: Nt
253
+ }), Ut = s(() => {
254
+ if (!z.isError && !B.isError && !$) return;
255
+ let e = z.error ?? B.error ?? ($ ? U.error : void 0);
247
256
  return ee(e) ?? u.actionErrorTitle;
248
257
  }, [
258
+ z.error,
259
+ z.isError,
249
260
  B.error,
250
261
  B.isError,
251
- V.error,
252
- V.isError,
253
262
  $,
254
- W.error,
263
+ U.error,
255
264
  u.actionErrorTitle
256
265
  ]);
257
266
  return {
258
- rows: Lt,
259
- isLoading: !Ye && (Je && !z.data || Ke && !h || v && z.isLoading),
260
- isError: Ye || v && z.isError,
261
- isConnectOpen: x,
262
- isEditOpen: nt,
263
- isVerifyOpen: rt,
264
- isVerifySuccess: at,
265
- verifyAccountName: Z.find((e) => e.id === y)?.nickname,
266
- verifyAccountNumber: Z.find((e) => e.id === y)?.accountNumber,
267
- isUnlinkOpen: !!j,
268
- unlinkAccountNumber: Z.find((e) => e.id === j)?.accountNumber,
269
- connectStep: S,
270
- accessRows: Pt,
271
- accessGrantedCount: Ft,
272
- connectSummary: It,
273
- isTeamMembersLoading: ut,
274
- isTeamMembersError: q.isError || lt,
275
- isConnectNextDisabled: S === 1 ? !ge(N) : S === 2 && !dt,
276
- isConnectRoutingNumberInvalid: N.routingNumber.trim() !== "" && !_e(N.routingNumber),
277
- connectErrorMessage: Rt,
278
- isVerifyFirstAmountInvalid: L.firstAmount.trim() !== "" && !ve(L.firstAmount),
279
- isVerifySecondAmountInvalid: L.secondAmount.trim() !== "" && !ve(L.secondAmount),
280
- isVerifySubmitDisabled: !ye(L),
281
- isActionDisabled: Nt,
282
- canConnect: Mt,
283
- isSubmitting: jt,
284
- isActionError: W.isError || U.isError || B.isError || V.isError || H.isError || G.isError || ot,
285
- isConnectError: B.isError || V.isError || $,
286
- isEditError: H.isError,
287
- isVerifyError: G.isError || ot,
288
- connectForm: N,
289
- editForm: F,
290
- verifyForm: L,
291
- onConnectOpenChange: yt,
292
- onEditOpenChange: xt,
293
- onVerifyOpenChange: wt,
294
- onUnlinkOpenChange: kt,
295
- onConnectFormChange: pt,
296
- onEditFormChange: I,
297
- onVerifyFormChange: Tt,
298
- onConnectNext: gt,
299
- onConnectBack: _t,
300
- onEditSubmit: St,
301
- onVerifySubmit: Et,
302
- onUnlinkConfirm: At
267
+ rows: Ht,
268
+ isLoading: !Ze && (Xe && !R.data || Je && !m || _ && R.isLoading),
269
+ isError: Ze || _ && R.isError,
270
+ isConnectOpen: y,
271
+ isEditOpen: at,
272
+ isVerifyOpen: ot,
273
+ isVerifySuccess: ct,
274
+ verifyAccountName: Z.find((e) => e.id === v)?.nickname,
275
+ verifyAccountNumber: Z.find((e) => e.id === v)?.accountNumber,
276
+ isUnlinkOpen: !!k,
277
+ unlinkAccountNumber: Z.find((e) => e.id === k)?.accountNumber,
278
+ connectStep: b,
279
+ accessRows: zt,
280
+ accessGrantedCount: Bt,
281
+ connectSummary: Vt,
282
+ isTeamMembersLoading: ht,
283
+ isTeamMembersError: K.isError || mt,
284
+ isConnectNextDisabled: b === 1 ? !a(J) : b === 2 && !gt,
285
+ isConnectRoutingNumberInvalid: J.routingNumber.trim() !== "" && !_e(J.routingNumber),
286
+ connectErrorMessage: Ut,
287
+ isVerifyFirstAmountInvalid: I.firstAmount.trim() !== "" && !ve(I.firstAmount),
288
+ isVerifySecondAmountInvalid: I.secondAmount.trim() !== "" && !ve(I.secondAmount),
289
+ isVerifySubmitDisabled: !ye(I),
290
+ isActionDisabled: Rt,
291
+ canConnect: Lt,
292
+ isSubmitting: It,
293
+ isActionError: U.isError || H.isError || z.isError || B.isError || V.isError || W.isError || lt,
294
+ isConnectError: z.isError || B.isError || $,
295
+ isEditError: V.isError,
296
+ isVerifyError: W.isError || lt,
297
+ connectForm: J,
298
+ editForm: P,
299
+ verifyForm: I,
300
+ onConnectOpenChange: wt,
301
+ onEditOpenChange: Et,
302
+ onVerifyOpenChange: kt,
303
+ onUnlinkOpenChange: Pt,
304
+ onConnectFormChange: vt,
305
+ onEditFormChange: F,
306
+ onVerifyFormChange: At,
307
+ onConnectNext: xt,
308
+ onConnectBack: St,
309
+ onEditSubmit: Dt,
310
+ onVerifySubmit: jt,
311
+ onUnlinkConfirm: Ft
303
312
  };
304
313
  }
305
314
  //#endregion
306
- export { l as LOCALLY_SENT_MICRO_DEPOSIT_ACCOUNT_IDS_STORAGE_KEY, p as useLinkedAccountsWidget };
315
+ export { l as LOCALLY_SENT_MICRO_DEPOSIT_ACCOUNT_IDS_STORAGE_KEY, f as useLinkedAccountsWidget };
@@ -1,145 +1,153 @@
1
1
  import { Scope as e } from "../../../../shared/data-access/dist/lib/scopes.js";
2
2
  import "../../../../shared/data-access/dist/index.js";
3
- import { AN_EXTERNAL_BANK_ACCOUNT as t, AN_ORGANIZATION_ROLE as n, AN_ORGANIZATION_USER as r } from "../../../../shared/data-access-mocks/dist/lib/fixtures.js";
4
- import { SCENARIO_LABELS as i } from "../../../../shared/data-access-mocks/dist/mocks/scenarios/labels.js";
5
- import { IDENTITY as a, LOADING_DELAY_MS as o, PROXY as s, answer as c, bodyOf as l, endpoint as u, initRoute as d, json as f, noContent as p, problem as m, wait as h } from "../../../../shared/data-access-mocks/dist/mocks/scenarios/scenario.js";
6
- import { MintKind as g, minter as _ } from "../../../../shared/data-access-mocks/dist/mocks/scenarios/worlds.js";
7
- import { LINKED_ACCOUNTS_LABELS as v } from "./labels.js";
3
+ import { AN_EXTERNAL_BANK_ACCOUNT as t, AN_ORGANIZATION as n, AN_ORGANIZATION_ROLE as r, AN_ORGANIZATION_USER as i } from "../../../../shared/data-access-mocks/dist/lib/fixtures.js";
4
+ import { SCENARIO_LABELS as a } from "../../../../shared/data-access-mocks/dist/mocks/scenarios/labels.js";
5
+ import { IDENTITY as o, LOADING_DELAY_MS as s, PROXY as c, answer as l, bodyOf as u, endpoint as d, initRoute as f, json as p, noContent as m, problem as h, wait as g } from "../../../../shared/data-access-mocks/dist/mocks/scenarios/scenario.js";
6
+ import { MintKind as _, minter as v } from "../../../../shared/data-access-mocks/dist/mocks/scenarios/worlds.js";
7
+ import { LINKED_ACCOUNTS_LABELS as y } from "./labels.js";
8
8
  //#region ../../libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/mocks/linkedAccounts.js
9
- var y = [e.ExternalBankAccountReadOrg], b = [...y, e.ExternalBankAccountWriteOrg], x = [...b, e.ExternalBankAccountMicroDepositOrg], S = (e) => `00000000-0000-4000-8000-0000000002${String(e).padStart(2, "0")}`, C = (e) => `••••••••${e.slice(-4)}`, w = (e) => [
9
+ var b = [e.ExternalBankAccountReadOrg], x = [
10
+ ...b,
11
+ e.ExternalBankAccountWriteOrg,
12
+ e.OrganizationReadOrg
13
+ ], S = [...x, e.ExternalBankAccountMicroDepositOrg], C = (e) => `00000000-0000-4000-8000-0000000002${String(e).padStart(2, "0")}`, w = (e) => `••••••••${e.slice(-4)}`, T = (e) => [
10
14
  t,
11
15
  {
12
16
  ...t,
13
- id: S(e),
14
- accountNumber: C("4321"),
17
+ id: C(e),
18
+ accountNumber: w("4321"),
15
19
  nickname: "Supplier payouts",
16
20
  type: "SAVINGS",
17
21
  verificationStatus: "UNVERIFIED"
18
22
  },
19
23
  {
20
24
  ...t,
21
- id: S(e + 1),
22
- accountNumber: C("5678"),
25
+ id: C(e + 1),
26
+ accountNumber: w("5678"),
23
27
  nickname: "Payroll funding",
24
28
  verificationStatus: "VERIFICATION_SENT"
25
29
  },
26
30
  {
27
31
  ...t,
28
- id: S(e + 2),
29
- accountNumber: C("8765"),
32
+ id: C(e + 2),
33
+ accountNumber: w("8765"),
30
34
  nickname: "Old savings",
31
35
  type: "SAVINGS",
32
36
  verificationStatus: "FAILED"
33
37
  },
34
38
  {
35
39
  ...t,
36
- id: S(e + 3),
37
- accountNumber: C("2468"),
40
+ id: C(e + 3),
41
+ accountNumber: w("2468"),
38
42
  nickname: "Closed checking",
39
43
  accountStatus: "INACTIVE"
40
44
  }
41
- ], T = {
42
- ...n,
43
- id: S(9),
45
+ ], E = {
46
+ ...r,
47
+ id: C(9),
44
48
  key: "embedded:employee",
45
49
  name: "Employee",
46
50
  description: "Can see their own cards and expenses."
47
- }, E = {
48
- ...r,
49
- id: S(10),
51
+ }, D = {
52
+ ...i,
53
+ id: C(10),
50
54
  name: "Grace Example",
51
55
  email: "grace@example.com",
52
- role: T.key
53
- }, D = (e) => ({
56
+ role: E.key
57
+ }, O = (e) => ({
54
58
  data: e,
55
59
  nextPaginationToken: null,
56
60
  prevPaginationToken: null
57
- }), O = () => [c((e) => e === `${a}/users`, ({ query: e }) => e.get("Status") === "INVITED" ? f(D([])) : f(D(e.has("Permissions") ? [r] : [r, E]))), c((e) => e === `${a}/roles`, () => f(D([n, T])))], k = `${s}/external-bank-accounts`, A = "tesouro.linkedAccounts.locallySentMicroDepositAccountIds.v1", j = () => {
61
+ }), k = () => [
62
+ l((e) => e === `${o}/users`, ({ query: e }) => e.get("Status") === "INVITED" ? p(O([])) : p(O(e.has("Permissions") ? [i] : [i, D]))),
63
+ l((e) => e === `${o}/roles`, () => p(O([r, E]))),
64
+ d("GET", `${o}/organizations/:id`, () => p(n))
65
+ ], A = `${c}/external-bank-accounts`, j = "tesouro.linkedAccounts.locallySentMicroDepositAccountIds.v1", M = () => {
58
66
  try {
59
- globalThis.sessionStorage?.removeItem(A);
67
+ globalThis.sessionStorage?.removeItem(j);
60
68
  } catch {}
61
- }, M = (e) => {
62
- j();
63
- let n = [...e], r = _(), i = () => m(404, "Not Found", "No such external bank account."), a = (e, t) => {
64
- let r = n.findIndex((t) => t.id === e), i = n[r];
69
+ }, N = (e) => {
70
+ M();
71
+ let r = [...e], i = v(), a = () => h(404, "Not Found", "No such external bank account."), o = (e, t) => {
72
+ let n = r.findIndex((t) => t.id === e), i = r[n];
65
73
  if (!i) return;
66
74
  let a = {
67
75
  ...i,
68
76
  ...t
69
77
  };
70
- return n[r] = a, a;
78
+ return r[n] = a, a;
71
79
  };
72
80
  return [
73
- ...O(),
74
- c((e) => e === k, () => f(D(n))),
75
- u("POST", k, async (e) => {
76
- await h(400);
77
- let i = l(e), a = (e, t) => typeof e == "string" && e ? e : t, o = {
81
+ ...k(),
82
+ l((e) => e === A, () => p(O(r))),
83
+ d("POST", A, async (e) => {
84
+ await g(400);
85
+ let a = u(e), o = (e, t) => typeof e == "string" && e ? e : t, s = {
78
86
  ...t,
79
- id: r(g.ExternalAccount),
80
- nickname: a(i.nickname, "New account"),
81
- nameOnAccount: a(i.nameOnAccount, "Example Organization"),
82
- accountNumber: C(a(i.accountNumber, "0000")),
83
- routingNumber: a(i.routingNumber, "123456780"),
84
- type: i.type === "SAVINGS" ? "SAVINGS" : "CHECKING",
85
- accountHolderType: i.accountHolderType === "BUSINESS" ? "BUSINESS" : "INDIVIDUAL",
87
+ id: i(_.ExternalAccount),
88
+ nickname: o(a.nickname, "New account"),
89
+ nameOnAccount: o(a.nameOnAccount, n.legalName),
90
+ accountNumber: w(o(a.accountNumber, "0000")),
91
+ routingNumber: o(a.routingNumber, "123456780"),
92
+ type: a.type === "SAVINGS" ? "SAVINGS" : "CHECKING",
93
+ accountHolderType: a.accountHolderType === "BUSINESS" ? "BUSINESS" : "INDIVIDUAL",
86
94
  verificationStatus: "UNVERIFIED"
87
95
  };
88
- return n.push(o), f(o, 201);
96
+ return r.push(s), p(s, 201);
89
97
  }),
90
- u("POST", `${k}/:id/access`, () => p()),
91
- u("POST", `${k}/:id/link`, async (e, { id: t }) => {
92
- await h(400);
93
- let n = a(t, { verificationStatus: "VERIFICATION_SENT" });
94
- return n ? f(n) : i();
98
+ d("POST", `${A}/:id/access`, () => m()),
99
+ d("POST", `${A}/:id/link`, async (e, { id: t }) => {
100
+ await g(400);
101
+ let n = o(t, { verificationStatus: "VERIFICATION_SENT" });
102
+ return n ? p(n) : a();
95
103
  }),
96
- u("POST", `${k}/:id/validate`, async (e, { id: t }) => {
97
- await h(400);
98
- let n = a(t, { verificationStatus: "VERIFIED" });
99
- return n ? f(n) : i();
104
+ d("POST", `${A}/:id/validate`, async (e, { id: t }) => {
105
+ await g(400);
106
+ let n = o(t, { verificationStatus: "VERIFIED" });
107
+ return n ? p(n) : a();
100
108
  }),
101
- u("PATCH", `${k}/:id`, (e, { id: t }) => {
102
- let { nickname: n } = l(e), r = a(t, typeof n == "string" ? { nickname: n } : {});
103
- return r ? f(r) : i();
109
+ d("PATCH", `${A}/:id`, (e, { id: t }) => {
110
+ let { nickname: n } = u(e), r = o(t, typeof n == "string" ? { nickname: n } : {});
111
+ return r ? p(r) : a();
104
112
  }),
105
- u("DELETE", `${k}/:id`, (e, { id: t }) => {
106
- let r = n.findIndex((e) => e.id === t);
107
- return r < 0 ? i() : (n.splice(r, 1), p());
113
+ d("DELETE", `${A}/:id`, (e, { id: t }) => {
114
+ let n = r.findIndex((e) => e.id === t);
115
+ return n < 0 ? a() : (r.splice(n, 1), m());
108
116
  })
109
117
  ];
110
- }, N = (e, t, n, r) => ({
118
+ }, P = (e, t, n, r) => ({
111
119
  key: e,
112
120
  ...t,
113
- routes: () => [d(n), ...M(r.empty ? [] : w(r.base))]
114
- }), P = v.blurbs, F = (e) => ({
115
- label: i[e].label,
116
- blurb: P[e] ?? i[e].blurb
117
- }), I = (e) => e === k, L = {
121
+ routes: () => [f(n), ...N(r.empty ? [] : T(r.base))]
122
+ }), F = y.blurbs, I = (e) => ({
123
+ label: a[e].label,
124
+ blurb: F[e] ?? a[e].blurb
125
+ }), L = (e) => e === A, R = {
118
126
  key: "loading",
119
- ...F("loading"),
127
+ ...I("loading"),
120
128
  routes: () => [
121
- d(x),
122
- c(I, async () => (await h(o), f(D(w(16))))),
123
- ...M(w(16))
129
+ f(S),
130
+ l(L, async () => (await g(s), p(O(T(16))))),
131
+ ...N(T(16))
124
132
  ]
125
- }, R = {
133
+ }, z = {
126
134
  key: "error",
127
- ...F("error"),
135
+ ...I("error"),
128
136
  routes: () => [
129
- d(x),
130
- c(I, () => m(500, "Internal Server Error", "Something went wrong.")),
131
- ...M(w(16))
137
+ f(S),
138
+ l(L, () => h(500, "Internal Server Error", "Something went wrong.")),
139
+ ...N(T(16))
132
140
  ]
133
- }, z = [
134
- N("populated", F("populated"), x, { base: 16 }),
135
- N("empty", F("empty"), x, {
141
+ }, B = [
142
+ P("populated", I("populated"), S, { base: 16 }),
143
+ P("empty", I("empty"), S, {
136
144
  base: 16,
137
145
  empty: !0
138
146
  }),
139
- L,
140
147
  R,
141
- N("control-hidden", F("control-hidden"), [...y, e.ExternalBankAccountMicroDepositOrg], { base: 22 }),
142
- N("no-micro-deposits", v.scenarios["no-micro-deposits"], b, { base: 27 })
148
+ z,
149
+ P("control-hidden", I("control-hidden"), [...b, e.ExternalBankAccountMicroDepositOrg], { base: 22 }),
150
+ P("no-micro-deposits", y.scenarios["no-micro-deposits"], x, { base: 27 })
143
151
  ];
144
152
  //#endregion
145
- export { z as linkedAccountsScenarios };
153
+ export { B as linkedAccountsScenarios };
@@ -6,6 +6,7 @@ var e = {
6
6
  learnMoreButton: "Learn more about linked accounts",
7
7
  connectTitle: "Link Account",
8
8
  nicknameLabel: "Account nickname",
9
+ nameOnAccountLabel: "Legal name on account",
9
10
  accountNumberLabel: "Account number",
10
11
  routingNumberLabel: "Routing number",
11
12
  routingNumberError: "Routing number must be a valid 9-digit ABA routing number.",
@@ -129,6 +129,16 @@ function u({ labels: e, connectForm: t, disabled: n, routingNumberError: r = !1,
129
129
  type: e
130
130
  })
131
131
  }),
132
+ /* @__PURE__ */ a(l, {
133
+ id: "linked-account-name-on-account",
134
+ label: e.nameOnAccountLabel,
135
+ value: t.nameOnAccount,
136
+ disabled: n,
137
+ onChange: (e) => i({
138
+ ...t,
139
+ nameOnAccount: e
140
+ })
141
+ }),
132
142
  /* @__PURE__ */ a(l, {
133
143
  id: "linked-account-nickname",
134
144
  label: e.nicknameLabel,
@@ -36,13 +36,14 @@ import { useAllExternalBankAccountsQuery as Ci } from "./lib/external-bank-accou
36
36
  import { useAllMerchantCategoryGroupsQuery as wi } from "./lib/merchant-category-group/useAllMerchantCategoryGroupsQuery.js";
37
37
  import { useAllLedgerAccountsQuery as Ti, useLedgerAccountsQuery as Ei } from "./lib/reference-data/useLedgerAccountsQuery.js";
38
38
  import { usePaymentTermsQuery as Di } from "./lib/reference-data/usePaymentTermsQuery.js";
39
- import { useAllOrganizationRolesQuery as Oi } from "./lib/role/useAllOrganizationRolesQuery.js";
40
- import { useRolePermissionsQueries as ki } from "./lib/role/useRolePermissionsQueries.js";
41
- import { useAllOrganizationUsersQuery as Ai } from "./lib/user/useAllOrganizationUsersQuery.js";
42
- import { personDisclosure as ji } from "./lib/disclosures/personDisclosure.js";
43
- import { useAcceptWidgetDisclosures as Mi } from "./lib/disclosures/useAcceptWidgetDisclosures.js";
44
- import { useDisclosuresQuery as Ni } from "./lib/disclosures/useDisclosuresQuery.js";
45
- import { OnboardingSuppressionReason as Pi } from "./lib/onboardingSuppressionReason.js";
46
- import { useOrganizationOnboardingSuppression as Fi } from "./lib/useOrganizationOnboardingSuppression.js";
47
- import { useOrganizationApplicationStatus as Ii } from "./lib/useOrganizationApplicationStatus.js";
48
- export { $r as EmbedApiProvider, Pi as OnboardingSuppressionReason, Ir as OrganizationStatus, hi as Scope, Je as activateCreditCardMutation, Ye as activateDebitCardMutation, Br as applicationStatusInvalidationKey, Vr as applicationStatusQueryOptions, Qr as attachTransportInterceptors, e as bulkUpdateDepartmentMembers, t as bulkUpdateLocationMembers, n as bulkUpdateRoleMembers, Ur as cancelAllClients, Xr as cloneEmbeddedClient, Xe as connectExternalBankAccountMutation, Ze as createAchMoneyMovementMutation, Qe as createApplicationMutation, $e as createBankAccountMutation, et as createBookTransferMutation, tt as createCheckDepositMutation, Hr as createClientSecretInstaller, nt as createDebitCardMutation, r as createDepartment, Zr as createEmbeddedClient, i as createLocation, a as createUser, rt as createVelocityControlMutation, o as deactivateDepartment, s as deactivateLocation, it as deleteApprovalPoliciesIdMutation, at as deleteBankAccountApplicationMutation, c as deleteCounterpartsId, l as deleteCounterpartsIdBankAccountsId, u as deleteEntitiesIdLogo, d as deleteFilesId, ot as deleteLedgerAccountsIdMutation, f as deleteMeasureUnitsId, p as deletePayablesId, m as deletePayablesIdFile, h as deleteProductsId, st as deleteReceiptsIdMutation, g as deleteReceivablesId, ct as disableUserMutation, _ as downloadBankAccountTransactions, ri as fetchWidgetInit, _i as getAllPagesNextPageParam, vi as getAllPagesNextPaginationTokenParam, lt as getAnalyticsPayablesOptions, ut as getAnalyticsPayablesQueryKey, dt as getAnalyticsReceiptsOptions, ft as getAnalyticsReceiptsQueryKey, pt as getAnalyticsReceivablesOptions, mt as getAnalyticsReceivablesQueryKey, ht as getAnalyticsTransactionsOptions, gt as getAnalyticsTransactionsQueryKey, v as getApplicationStatus, y as getApprovalPolicies, _t as getApprovalPoliciesOptions, vt as getApprovalPoliciesQueryKey, b as getApprovalRequests, yt as getApprovalRequestsOptions, bt as getApprovalRequestsQueryKey, x as getBankAccountAccess, xt as getBankAccountAccessQueryKey, St as getBankAccountApplicationOptions, Ct as getBankAccountOptions, wt as getBankAccountQueryKey, S as getBankAccountStatement, Tt as getBankAccountStatementsOptions, Et as getBankAccountTransactionsOptions, Dt as getBankAccountTransactionsQueryKey, Ot as getBankAccountsQueryKey, kt as getBankDetailsIdOptions, At as getBankDetailsOptions, jt as getBankDetailsQueryKey, C as getCounterparts, Mt as getCounterpartsIdAddressesOptions, Nt as getCounterpartsIdAddressesQueryKey, Pt as getCounterpartsIdBankAccountsOptions, Ft as getCounterpartsIdBankAccountsQueryKey, It as getCounterpartsIdOptions, Lt as getCounterpartsIdQueryKey, Rt as getCounterpartsOptions, zt as getCounterpartsQueryKey, Bt as getCreditCardByIdOptions, Vt as getCreditCardByIdQueryKey, Ht as getCreditCardsOptions, Ut as getCreditCardsQueryKey, Wt as getDebitCardByIdOptions, Gt as getDebitCardByIdQueryKey, Kt as getDebitCardCredentialsOptions, qt as getDebitCardsOptions, Jt as getDebitCardsQueryKey, w as getDepartment, Yt as getDepartmentOptions, Xt as getDepartmentQueryKey, T as getDepositableBankAccounts, Zt as getDepositableBankAccountsOptions, Qt as getDocumentsIdNextNumbersOptions, $t as getDocumentsIdNextNumbersQueryKey, en as getEntitiesIdPaymentMethodsOptions, tn as getEntitiesIdSettingsOptions, nn as getEntitiesIdSettingsQueryKey, rn as getEntityUsersOptions, E as getExternalBankAccountAccess, an as getExternalBankAccountAccessQueryKey, on as getExternalBankAccountOptions, sn as getExternalBankAccountsOptions, cn as getExternalBankAccountsQueryKey, ln as getFilesQueryKey, un as getLedgerAccountsQueryKey, D as getLocation, dn as getLocationOptions, fn as getLocationQueryKey, pn as getMeOptions, mn as getMeasureUnitsOptions, hn as getMeasureUnitsQueryKey, gn as getOrganizationOptions, _n as getOrganizationTransfersOptions, vn as getOrganizationTransfersQueryKey, yn as getOverdueRemindersOptions, bn as getOverdueRemindersQueryKey, O as getPayables, k as getPayablesId, A as getPayablesIdHistory, xn as getPayablesIdHistoryOptions, Sn as getPayablesIdHistoryQueryKey, j as getPayablesIdLineItems, Cn as getPayablesIdLineItemsOptions, wn as getPayablesIdLineItemsQueryKey, Tn as getPayablesIdOptions, En as getPayablesIdQueryKey, Dn as getPayablesIdSuggestionsOptions, On as getPayablesOptions, kn as getPayablesQueryKey, M as getPaymentRecords, An as getPaymentRecordsOptions, jn as getPaymentRecordsQueryKey, Mn as getPaymentRemindersOptions, Nn as getPaymentRemindersQueryKey, N as getProducts, Pn as getProductsIdOptions, Fn as getProductsIdQueryKey, In as getProductsOptions, Ln as getProductsQueryKey, P as getReceipts, Rn as getReceiptsIdQueryKey, zn as getReceiptsOptions, Bn as getReceiptsQueryKey, F as getReceivables, I as getReceivablesIdHistory, Vn as getReceivablesIdHistoryQueryKey, Hn as getReceivablesIdMailsQueryKey, Un as getReceivablesIdOptions, Wn as getReceivablesIdPdfLinkOptions, Gn as getReceivablesIdPdfLinkQueryKey, Kn as getReceivablesIdQueryKey, qn as getReceivablesOptions, Jn as getReceivablesQueryKey, Yn as getReceivablesRequiredFieldsOptions, Xn as getRecurrencesIdOptions, Zn as getRecurrencesIdQueryKey, Qn as getRecurrencesQueryKey, $n as getTransactionsIdExpenseHistoryOptions, er as getTransactionsIdExpenseHistoryQueryKey, tr as getTransactionsIdOptions, nr as getTransactionsIdQueryKey, rr as getTransactionsOptions, ir as getTransactionsQueryKey, ar as getTransactionsValidationsOptions, or as getTransactionsValidationsQueryKey, L as getUsers, sr as getUsersOptions, cr as getUsersQueryKey, lr as getVelocityControlsQueryKey, ur as grantBankAccountAccessMutation, dr as grantExternalBankAccountAccessMutation, ii as hasAnyScope, Wr as invalidateAllClients, yi as isAllPagesResolving, li as isApiConflictError, ui as isApiForbiddenError, di as isApiNotFoundError, fi as isApiUnprocessableError, Lr as isOrganizationOnItsWay, gi as isScope, fr as linkExternalBankAccountMutation, R as listDepartments, pr as listDepartmentsOptions, mr as listDepartmentsQueryKey, z as listLocations, hr as listLocationsOptions, gr as listLocationsQueryKey, B as listRoles, _r as listRolesQueryKey, V as manageBankAccountAccess, H as manageDebitCardAccess, vr as manageDebitCardAccessMutation, ai as myEntityInvalidationKey, ti as optionalOrganizationHeaders, ni as organizationHeaders, yr as patchApprovalPoliciesIdMutation, U as patchCounterpartsId, W as patchCounterpartsIdAddressesId, G as patchCounterpartsIdBankAccountsId, K as patchEntitiesIdSettings, br as patchLedgerAccountsIdMutation, q as patchMeasureUnitsId, J as patchPayablesId, Y as patchProductsId, xr as patchReceiptsIdMutation, X as patchReceivablesId, Z as patchRecurrencesId, Q as patchTransactionsId, ji as personDisclosure, Sr as postApprovalPoliciesMutation, $ as postApprovalRequestsIdApprove, ee as postApprovalRequestsIdReject, te as postBankDetails, ne as postCounterparts, re as postCounterpartsIdAddresses, ie as postCounterpartsIdBankAccounts, ae as postFiles, Cr as postLedgerAccountsMutation, oe as postMeasureUnits, se as postOverdueReminders, ce as postPayables, le as postPayablesIdApprovePaymentOperation, ue as postPayablesIdAttachFile, de as postPayablesIdCancel, fe as postPayablesIdDuplicatesIdConfirm, pe as postPayablesIdDuplicatesIdDismiss, me as postPayablesIdMarkAsPaid, he as postPayablesIdReject, ge as postPayablesIdReopen, _e as postPayablesIdSchedulePayment, ve as postPayablesIdSubmitForApproval, ye as postPayablesIdValidate, be as postPayablesUploadFromFile, xe as postPaymentIntentsIdCancel, Se as postPaymentLinks, Ce as postPaymentRecords, we as postPaymentReminders, Te as postProducts, wr as postReceiptsUploadFromFileMutation, Ee as postReceivables, De as postReceivablesIdAccept, Oe as postReceivablesIdCancel, ke as postReceivablesIdClone, Ae as postReceivablesIdDecline, je as postReceivablesIdIssue, Me as postReceivablesIdMarkAsPaid, Ne as postReceivablesIdMarkAsUncollectible, Pe as postReceivablesIdSend, Fe as postRecurrences, Ie as postRecurrencesIdCancel, Le as postRecurrencesIdPause, Re as postRecurrencesIdResume, ze as postTransactionsIdApprove, Be as postTransactionsIdReject, Ve as postTransactionsIdReopen, He as postTransactionsIdSubmit, Ue as putEntitiesIdLogo, We as putPayablesIdLineItems, Tr as putTransactionsValidationsMutation, Gr as registerQueryClient, Kr as removeInactiveFromAllClients, qr as resetAllClients, Jr as setAllClientsQueriesData, Er as setDebitCardLockStatusMutation, Dr as submitApplicationMutation, Or as unlinkExternalBankAccountMutation, Yr as unregisterQueryClient, kr as updateApplicationMutation, Ar as updateBankAccountMutation, jr as updateDebitCardMutation, Ge as updateDepartment, Mr as updateExternalBankAccountMutation, Ke as updateLocation, qe as updateUser, Mi as useAcceptWidgetDisclosures, xi as useAllBankAccountsQuery, Si as useAllDebitCardsQuery, Ci as useAllExternalBankAccountsQuery, Ti as useAllLedgerAccountsQuery, wi as useAllMerchantCategoryGroupsQuery, Oi as useAllOrganizationRolesQuery, Ai as useAllOrganizationUsersQuery, bi as useAutoFetchNextPage, oi as useCurrentUserQuery, Ni as useDisclosuresQuery, ei as useEmbedApi, pi as useGetUserDataQuery, Ei as useLedgerAccountsQuery, ci as useMailboxAddress, si as useMyEntityQuery, Ii as useOrganizationApplicationStatus, Fi as useOrganizationOnboardingSuppression, Di as usePaymentTermsQuery, ki as useRolePermissionsQueries, mi as useUpsertUserDataMutation, Nr as validateExternalBankAccountMutation, Pr as verifyDebitCardMutation, Fr as widgetTokenCacheId, Rr as withAuthEpoch, zr as withAuthEpochInfinite };
39
+ import { useOrganizationQuery as Oi } from "./lib/organization/useOrganizationQuery.js";
40
+ import { useAllOrganizationRolesQuery as ki } from "./lib/role/useAllOrganizationRolesQuery.js";
41
+ import { useRolePermissionsQueries as Ai } from "./lib/role/useRolePermissionsQueries.js";
42
+ import { useAllOrganizationUsersQuery as ji } from "./lib/user/useAllOrganizationUsersQuery.js";
43
+ import { personDisclosure as Mi } from "./lib/disclosures/personDisclosure.js";
44
+ import { useAcceptWidgetDisclosures as Ni } from "./lib/disclosures/useAcceptWidgetDisclosures.js";
45
+ import { useDisclosuresQuery as Pi } from "./lib/disclosures/useDisclosuresQuery.js";
46
+ import { OnboardingSuppressionReason as Fi } from "./lib/onboardingSuppressionReason.js";
47
+ import { useOrganizationOnboardingSuppression as Ii } from "./lib/useOrganizationOnboardingSuppression.js";
48
+ import { useOrganizationApplicationStatus as Li } from "./lib/useOrganizationApplicationStatus.js";
49
+ export { $r as EmbedApiProvider, Fi as OnboardingSuppressionReason, Ir as OrganizationStatus, hi as Scope, Je as activateCreditCardMutation, Ye as activateDebitCardMutation, Br as applicationStatusInvalidationKey, Vr as applicationStatusQueryOptions, Qr as attachTransportInterceptors, e as bulkUpdateDepartmentMembers, t as bulkUpdateLocationMembers, n as bulkUpdateRoleMembers, Ur as cancelAllClients, Xr as cloneEmbeddedClient, Xe as connectExternalBankAccountMutation, Ze as createAchMoneyMovementMutation, Qe as createApplicationMutation, $e as createBankAccountMutation, et as createBookTransferMutation, tt as createCheckDepositMutation, Hr as createClientSecretInstaller, nt as createDebitCardMutation, r as createDepartment, Zr as createEmbeddedClient, i as createLocation, a as createUser, rt as createVelocityControlMutation, o as deactivateDepartment, s as deactivateLocation, it as deleteApprovalPoliciesIdMutation, at as deleteBankAccountApplicationMutation, c as deleteCounterpartsId, l as deleteCounterpartsIdBankAccountsId, u as deleteEntitiesIdLogo, d as deleteFilesId, ot as deleteLedgerAccountsIdMutation, f as deleteMeasureUnitsId, p as deletePayablesId, m as deletePayablesIdFile, h as deleteProductsId, st as deleteReceiptsIdMutation, g as deleteReceivablesId, ct as disableUserMutation, _ as downloadBankAccountTransactions, ri as fetchWidgetInit, _i as getAllPagesNextPageParam, vi as getAllPagesNextPaginationTokenParam, lt as getAnalyticsPayablesOptions, ut as getAnalyticsPayablesQueryKey, dt as getAnalyticsReceiptsOptions, ft as getAnalyticsReceiptsQueryKey, pt as getAnalyticsReceivablesOptions, mt as getAnalyticsReceivablesQueryKey, ht as getAnalyticsTransactionsOptions, gt as getAnalyticsTransactionsQueryKey, v as getApplicationStatus, y as getApprovalPolicies, _t as getApprovalPoliciesOptions, vt as getApprovalPoliciesQueryKey, b as getApprovalRequests, yt as getApprovalRequestsOptions, bt as getApprovalRequestsQueryKey, x as getBankAccountAccess, xt as getBankAccountAccessQueryKey, St as getBankAccountApplicationOptions, Ct as getBankAccountOptions, wt as getBankAccountQueryKey, S as getBankAccountStatement, Tt as getBankAccountStatementsOptions, Et as getBankAccountTransactionsOptions, Dt as getBankAccountTransactionsQueryKey, Ot as getBankAccountsQueryKey, kt as getBankDetailsIdOptions, At as getBankDetailsOptions, jt as getBankDetailsQueryKey, C as getCounterparts, Mt as getCounterpartsIdAddressesOptions, Nt as getCounterpartsIdAddressesQueryKey, Pt as getCounterpartsIdBankAccountsOptions, Ft as getCounterpartsIdBankAccountsQueryKey, It as getCounterpartsIdOptions, Lt as getCounterpartsIdQueryKey, Rt as getCounterpartsOptions, zt as getCounterpartsQueryKey, Bt as getCreditCardByIdOptions, Vt as getCreditCardByIdQueryKey, Ht as getCreditCardsOptions, Ut as getCreditCardsQueryKey, Wt as getDebitCardByIdOptions, Gt as getDebitCardByIdQueryKey, Kt as getDebitCardCredentialsOptions, qt as getDebitCardsOptions, Jt as getDebitCardsQueryKey, w as getDepartment, Yt as getDepartmentOptions, Xt as getDepartmentQueryKey, T as getDepositableBankAccounts, Zt as getDepositableBankAccountsOptions, Qt as getDocumentsIdNextNumbersOptions, $t as getDocumentsIdNextNumbersQueryKey, en as getEntitiesIdPaymentMethodsOptions, tn as getEntitiesIdSettingsOptions, nn as getEntitiesIdSettingsQueryKey, rn as getEntityUsersOptions, E as getExternalBankAccountAccess, an as getExternalBankAccountAccessQueryKey, on as getExternalBankAccountOptions, sn as getExternalBankAccountsOptions, cn as getExternalBankAccountsQueryKey, ln as getFilesQueryKey, un as getLedgerAccountsQueryKey, D as getLocation, dn as getLocationOptions, fn as getLocationQueryKey, pn as getMeOptions, mn as getMeasureUnitsOptions, hn as getMeasureUnitsQueryKey, gn as getOrganizationOptions, _n as getOrganizationTransfersOptions, vn as getOrganizationTransfersQueryKey, yn as getOverdueRemindersOptions, bn as getOverdueRemindersQueryKey, O as getPayables, k as getPayablesId, A as getPayablesIdHistory, xn as getPayablesIdHistoryOptions, Sn as getPayablesIdHistoryQueryKey, j as getPayablesIdLineItems, Cn as getPayablesIdLineItemsOptions, wn as getPayablesIdLineItemsQueryKey, Tn as getPayablesIdOptions, En as getPayablesIdQueryKey, Dn as getPayablesIdSuggestionsOptions, On as getPayablesOptions, kn as getPayablesQueryKey, M as getPaymentRecords, An as getPaymentRecordsOptions, jn as getPaymentRecordsQueryKey, Mn as getPaymentRemindersOptions, Nn as getPaymentRemindersQueryKey, N as getProducts, Pn as getProductsIdOptions, Fn as getProductsIdQueryKey, In as getProductsOptions, Ln as getProductsQueryKey, P as getReceipts, Rn as getReceiptsIdQueryKey, zn as getReceiptsOptions, Bn as getReceiptsQueryKey, F as getReceivables, I as getReceivablesIdHistory, Vn as getReceivablesIdHistoryQueryKey, Hn as getReceivablesIdMailsQueryKey, Un as getReceivablesIdOptions, Wn as getReceivablesIdPdfLinkOptions, Gn as getReceivablesIdPdfLinkQueryKey, Kn as getReceivablesIdQueryKey, qn as getReceivablesOptions, Jn as getReceivablesQueryKey, Yn as getReceivablesRequiredFieldsOptions, Xn as getRecurrencesIdOptions, Zn as getRecurrencesIdQueryKey, Qn as getRecurrencesQueryKey, $n as getTransactionsIdExpenseHistoryOptions, er as getTransactionsIdExpenseHistoryQueryKey, tr as getTransactionsIdOptions, nr as getTransactionsIdQueryKey, rr as getTransactionsOptions, ir as getTransactionsQueryKey, ar as getTransactionsValidationsOptions, or as getTransactionsValidationsQueryKey, L as getUsers, sr as getUsersOptions, cr as getUsersQueryKey, lr as getVelocityControlsQueryKey, ur as grantBankAccountAccessMutation, dr as grantExternalBankAccountAccessMutation, ii as hasAnyScope, Wr as invalidateAllClients, yi as isAllPagesResolving, li as isApiConflictError, ui as isApiForbiddenError, di as isApiNotFoundError, fi as isApiUnprocessableError, Lr as isOrganizationOnItsWay, gi as isScope, fr as linkExternalBankAccountMutation, R as listDepartments, pr as listDepartmentsOptions, mr as listDepartmentsQueryKey, z as listLocations, hr as listLocationsOptions, gr as listLocationsQueryKey, B as listRoles, _r as listRolesQueryKey, V as manageBankAccountAccess, H as manageDebitCardAccess, vr as manageDebitCardAccessMutation, ai as myEntityInvalidationKey, ti as optionalOrganizationHeaders, ni as organizationHeaders, yr as patchApprovalPoliciesIdMutation, U as patchCounterpartsId, W as patchCounterpartsIdAddressesId, G as patchCounterpartsIdBankAccountsId, K as patchEntitiesIdSettings, br as patchLedgerAccountsIdMutation, q as patchMeasureUnitsId, J as patchPayablesId, Y as patchProductsId, xr as patchReceiptsIdMutation, X as patchReceivablesId, Z as patchRecurrencesId, Q as patchTransactionsId, Mi as personDisclosure, Sr as postApprovalPoliciesMutation, $ as postApprovalRequestsIdApprove, ee as postApprovalRequestsIdReject, te as postBankDetails, ne as postCounterparts, re as postCounterpartsIdAddresses, ie as postCounterpartsIdBankAccounts, ae as postFiles, Cr as postLedgerAccountsMutation, oe as postMeasureUnits, se as postOverdueReminders, ce as postPayables, le as postPayablesIdApprovePaymentOperation, ue as postPayablesIdAttachFile, de as postPayablesIdCancel, fe as postPayablesIdDuplicatesIdConfirm, pe as postPayablesIdDuplicatesIdDismiss, me as postPayablesIdMarkAsPaid, he as postPayablesIdReject, ge as postPayablesIdReopen, _e as postPayablesIdSchedulePayment, ve as postPayablesIdSubmitForApproval, ye as postPayablesIdValidate, be as postPayablesUploadFromFile, xe as postPaymentIntentsIdCancel, Se as postPaymentLinks, Ce as postPaymentRecords, we as postPaymentReminders, Te as postProducts, wr as postReceiptsUploadFromFileMutation, Ee as postReceivables, De as postReceivablesIdAccept, Oe as postReceivablesIdCancel, ke as postReceivablesIdClone, Ae as postReceivablesIdDecline, je as postReceivablesIdIssue, Me as postReceivablesIdMarkAsPaid, Ne as postReceivablesIdMarkAsUncollectible, Pe as postReceivablesIdSend, Fe as postRecurrences, Ie as postRecurrencesIdCancel, Le as postRecurrencesIdPause, Re as postRecurrencesIdResume, ze as postTransactionsIdApprove, Be as postTransactionsIdReject, Ve as postTransactionsIdReopen, He as postTransactionsIdSubmit, Ue as putEntitiesIdLogo, We as putPayablesIdLineItems, Tr as putTransactionsValidationsMutation, Gr as registerQueryClient, Kr as removeInactiveFromAllClients, qr as resetAllClients, Jr as setAllClientsQueriesData, Er as setDebitCardLockStatusMutation, Dr as submitApplicationMutation, Or as unlinkExternalBankAccountMutation, Yr as unregisterQueryClient, kr as updateApplicationMutation, Ar as updateBankAccountMutation, jr as updateDebitCardMutation, Ge as updateDepartment, Mr as updateExternalBankAccountMutation, Ke as updateLocation, qe as updateUser, Ni as useAcceptWidgetDisclosures, xi as useAllBankAccountsQuery, Si as useAllDebitCardsQuery, Ci as useAllExternalBankAccountsQuery, Ti as useAllLedgerAccountsQuery, wi as useAllMerchantCategoryGroupsQuery, ki as useAllOrganizationRolesQuery, ji as useAllOrganizationUsersQuery, bi as useAutoFetchNextPage, oi as useCurrentUserQuery, Pi as useDisclosuresQuery, ei as useEmbedApi, pi as useGetUserDataQuery, Ei as useLedgerAccountsQuery, ci as useMailboxAddress, si as useMyEntityQuery, Li as useOrganizationApplicationStatus, Ii as useOrganizationOnboardingSuppression, Oi as useOrganizationQuery, Di as usePaymentTermsQuery, Ai as useRolePermissionsQueries, mi as useUpsertUserDataMutation, Nr as validateExternalBankAccountMutation, Pr as verifyDebitCardMutation, Fr as widgetTokenCacheId, Rr as withAuthEpoch, zr as withAuthEpochInfinite };
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { getOrganizationOptions as e } from "../rest/@tanstack/react-query.gen.js";
6
+ import { withAuthEpoch as t } from "../withAuthEpoch.js";
7
+ import { useEmbedApi as n } from "../EmbedApiContext.js";
8
+ import { useQuery as r } from "@tanstack/react-query";
9
+ //#region ../../libs/tesouro-embedded-components-react/shared/data-access/dist/lib/organization/useOrganizationQuery.js
10
+ function i({ enabled: i } = {}) {
11
+ let { client: a, organizationId: o, widgetToken: s, authEpoch: c, organizationStatus: l } = n(), u = e({
12
+ client: a,
13
+ path: { organizationId: o ?? "" }
14
+ });
15
+ return r({
16
+ ...t(u, {
17
+ authEpoch: c,
18
+ organizationStatus: l
19
+ }),
20
+ enabled: !!(o && s) && (i === !0 || i === void 0)
21
+ });
22
+ }
23
+ //#endregion
24
+ export { i as useOrganizationQuery };
@@ -1,5 +1,5 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.7.44", n = "234ce1938135d29ed4c73ed506a604e107db4a3e", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.7.45", n = "65b4bd182e857936feb530d4ce54f0be7426b6b2", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.7.44",
3
+ "version": "0.7.45",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -1,25 +0,0 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { getOrganizationOptions as e } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
6
- import { withAuthEpoch as t } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
7
- import { useEmbedApi as n } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
8
- import "../../../../shared/data-access/dist/index.js";
9
- import { useQuery as r } from "@tanstack/react-query";
10
- //#region ../../libs/tesouro-embedded-components-react/cards-widget/create-card/data-access/dist/index7.js
11
- function i({ enabled: i } = {}) {
12
- let { client: a, organizationId: o, widgetToken: s, authEpoch: c, organizationStatus: l } = n(), u = e({
13
- client: a,
14
- path: { organizationId: o ?? "" }
15
- });
16
- return r({
17
- ...t(u, {
18
- authEpoch: c,
19
- organizationStatus: l
20
- }),
21
- enabled: !!(o && s) && (i === !0 || i === void 0)
22
- });
23
- }
24
- //#endregion
25
- export { i as useCreateCardOrganizationQuery };