@tesouro/embedded-components-react 0.5.225 → 0.5.227

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 (142) hide show
  1. package/README.md +21 -21
  2. package/dist/index.d.ts +23 -2
  3. package/dist/index.js +1 -1
  4. package/dist/lib/ReceivablesWidget.d.ts +23 -2
  5. package/dist/lib/ReceivablesWidget.js +1 -1
  6. package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/index3.js +41 -39
  7. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index12.js +2 -2
  8. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index2.js +2 -2
  9. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index3.js +2 -2
  10. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index4.js +2 -2
  11. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index9.js +150 -147
  12. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/data-access/dist/index5.js +46 -51
  13. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index7.js +130 -128
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index18.js +31 -32
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index19.js +2 -2
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index2.js +2 -2
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index21.js +2 -2
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index22.js +2 -2
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index3.js +2 -2
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index4.js +36 -37
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/data-access/dist/index2.js +2 -2
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index4.js +2 -2
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index2.js +6 -10
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index3.js +2 -2
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index4.js +2 -2
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index5.js +2 -2
  27. package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index6.js +2 -2
  28. package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index7.js +2 -2
  29. package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index8.js +2 -2
  30. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index13.js +154 -150
  31. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/data-access/dist/index7.js +2 -2
  32. package/dist/libs/tesouro-embedded-components-react/cards-widget/data-access/dist/index2.js +2 -2
  33. package/dist/libs/tesouro-embedded-components-react/cards-widget/data-access/dist/index3.js +2 -2
  34. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +151 -149
  35. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/data-access/dist/index2.js +4 -4
  36. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/data-access/dist/index3.js +4 -4
  37. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index15.js +2 -2
  38. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index17.js +2 -2
  39. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index18.js +2 -2
  40. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index19.js +2 -2
  41. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index2.js +2 -2
  42. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index3.js +2 -2
  43. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index4.js +2 -2
  44. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index5.js +2 -2
  45. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index6.js +2 -2
  46. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index8.js +2 -2
  47. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index9.js +2 -2
  48. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index24.js +1 -0
  49. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index27.js +89 -87
  50. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index5.js +133 -130
  51. package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index8.js +36 -34
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +4 -4
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +50 -36
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +6 -6
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js +2 -2
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index3.js +40 -39
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +51 -32
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +20 -1
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +17 -202
  61. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +220 -31
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +32 -145
  63. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +126 -44
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +145 -117
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +46 -58
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +113 -87
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +58 -116
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +98 -225
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +111 -27
  70. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js +225 -462
  71. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js +34 -41
  72. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index27.js +627 -34
  73. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js +39 -77
  74. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index29.js +34 -112
  75. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index30.js +75 -310
  76. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index31.js +124 -0
  77. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js +324 -0
  78. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +20 -15
  79. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +56 -53
  80. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +33 -29
  81. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +184 -162
  82. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +1 -3
  83. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +78 -69
  84. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/data-access/dist/index4.js +2 -2
  85. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +209 -207
  86. package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index4.js +10 -5
  87. package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index5.js +10 -5
  88. package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index6.js +11 -6
  89. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index2.js +2 -2
  90. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index3.js +2 -2
  91. package/dist/libs/tesouro-embedded-components-react/settings-widget/profile/data-access/dist/index2.js +2 -2
  92. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index12.js +2 -2
  93. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index13.js +2 -2
  94. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index14.js +30 -28
  95. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index17.js +28 -26
  96. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index18.js +37 -34
  97. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index21.js +28 -26
  98. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index22.js +37 -34
  99. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index17.js +294 -292
  100. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index5.js +58 -58
  101. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/data-access/dist/lib/approvalPoliciesApi.js +47 -48
  102. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index3.js +4 -4
  103. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index5.js +2 -2
  104. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index7.js +4 -4
  105. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/CounterpartSelector.js +7 -6
  106. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +20 -19
  107. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +40 -39
  108. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/EmbedApiContext.js +14 -13
  109. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/allPages.js +1 -1
  110. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/applicationStatusQueryOptions.js +16 -15
  111. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js +7 -5
  112. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/debit-card/useAllDebitCardsQuery.js +7 -5
  113. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js +2 -2
  114. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/external-bank-account/useAllExternalBankAccountsQuery.js +7 -5
  115. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/merchant-category-group/useAllMerchantCategoryGroupsQuery.js +28 -29
  116. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/organizationStatus.js +10 -0
  117. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js +26 -27
  118. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/reference-data/usePaymentTermsQuery.js +2 -2
  119. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +210 -199
  120. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +60 -52
  121. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js +31 -32
  122. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/role/useRolePermissionsQueries.js +2 -2
  123. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useCurrentUserQuery.js +2 -2
  124. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useGetUserDataQuery.js +2 -2
  125. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useMailboxAddress.js +2 -2
  126. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useMyEntityQuery.js +2 -2
  127. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js +33 -34
  128. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/withAuthEpoch.js +33 -22
  129. package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/data-access/dist/index3.js +2 -2
  130. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +43 -32
  131. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +138 -127
  132. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/deriveOrganizationStatus.js +6 -0
  133. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/useWidgetFetch.js +1 -1
  134. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  135. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index10.js +2 -2
  136. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index2.js +2 -2
  137. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index3.js +2 -2
  138. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index4.js +2 -2
  139. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index9.js +2 -2
  140. package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index6.js +2 -2
  141. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index6.js +60 -58
  142. package/package.json +1 -1
@@ -4,198 +4,200 @@
4
4
  "use client";
5
5
  import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
6
  import { TESOURO_NEW_EMBEDDED_BANK_ACCOUNT_CREATED_SUCCESS_EVENT as t, emitWidgetDomEvent as n } from "../../../shared/util/dist/lib/widgetDomEvents.js";
7
- import { Scope as r } from "../../../shared/data-access/dist/lib/scopes.js";
8
- import { useAllBankAccountsQuery as ee } from "../../../shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js";
9
- import { useAllOrganizationRolesQuery as te } from "../../../shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js";
7
+ import { OrganizationStatus as r, isOrganizationOnItsWay as ee } from "../../../shared/data-access/dist/lib/organizationStatus.js";
8
+ import { useEmbedApi as te } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
9
+ import { Scope as ne } from "../../../shared/data-access/dist/lib/scopes.js";
10
+ import { useAllBankAccountsQuery as re } from "../../../shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js";
11
+ import { useAllOrganizationRolesQuery as ie } from "../../../shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js";
10
12
  import "../../../shared/data-access/dist/index.js";
11
13
  import { BankAccountsWidgetAnalyticsEvent as i } from "./index2.js";
12
- import { copyTextToClipboard as ne, formatAmountLabel as a, formatTotalAvailableBalanceLabel as re, maskAccountNumber as ie } from "./index3.js";
13
- import { DEFAULT_FEATURE_LABELS as ae } from "./index4.js";
14
- import { getBankAccountsPermissions as oe } from "./index5.js";
15
- import { toAccessRows as se, toOrganizationRoleOptions as ce, toTeamMembers as le } from "./index6.js";
16
- import { DEFAULT_LABELS as ue } from "../../ui/dist/lib/labels.js";
14
+ import { copyTextToClipboard as ae, formatAmountLabel as a, formatTotalAvailableBalanceLabel as oe, maskAccountNumber as o } from "./index3.js";
15
+ import { DEFAULT_FEATURE_LABELS as se } from "./index4.js";
16
+ import { getBankAccountsPermissions as ce } from "./index5.js";
17
+ import { toAccessRows as le, toOrganizationRoleOptions as ue, toTeamMembers as de } from "./index6.js";
18
+ import { DEFAULT_LABELS as fe } from "../../ui/dist/lib/labels.js";
17
19
  import "../../../shared/ui/dist/index.js";
18
20
  import "../../ui/dist/index.js";
19
- import { useAnalyticsTrack as de } from "../../../shared/feature/dist/lib/analytics/hooks.js";
20
- import { useWidgetConfig as fe, useWidgetError as pe, useWidgetLoading as me } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
21
+ import { useAnalyticsTrack as pe } from "../../../shared/feature/dist/lib/analytics/hooks.js";
22
+ import { useWidgetConfig as me, useWidgetError as he, useWidgetLoading as ge } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
21
23
  import "../../../shared/feature/dist/index.js";
22
- import { useCreateBankAccountMutation as he } from "../../data-access/dist/index3.js";
23
- import { useGrantBankAccountAccessMutation as ge } from "../../data-access/dist/index4.js";
24
- import { useAllOrganizationUsersQuery as o } from "../../data-access/dist/index5.js";
24
+ import { useCreateBankAccountMutation as _e } from "../../data-access/dist/index3.js";
25
+ import { useGrantBankAccountAccessMutation as ve } from "../../data-access/dist/index4.js";
26
+ import { useAllOrganizationUsersQuery as s } from "../../data-access/dist/index5.js";
25
27
  import "../../data-access/dist/index.js";
26
- import { filterRolesForOrganization as _e } from "../../../../shared/util-validation/dist/index6.js";
27
- import { useCallback as ve, useEffect as s, useMemo as c, useRef as ye, useState as l } from "react";
28
- import { useControllableState as be } from "@radix-ui/react-use-controllable-state";
28
+ import { filterRolesForOrganization as ye } from "../../../../shared/util-validation/dist/index6.js";
29
+ import { useCallback as be, useEffect as c, useMemo as l, useRef as xe, useState as u } from "react";
30
+ import { useControllableState as Se } from "@radix-ui/react-use-controllable-state";
29
31
  //#region ../../libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index7.js
30
- var u = { nickname: "" }, xe = r.BankAccountWriteOrg;
31
- function d(e, t) {
32
+ var d = { nickname: "" }, Ce = ne.BankAccountWriteOrg;
33
+ function f(e, t) {
32
34
  return e !== void 0 && t !== void 0 && e !== t;
33
35
  }
34
- function f({ labels: r, featureLabels: a, isBankingTaglineVisible: ie = !0, bankLogoSrc: f, bankLogoAlt: Ce, depositAgreementUrl: we, selectedAccountId: Te, defaultSelectedAccountId: Ee, onSelectedAccountIdChange: De, "data-testid": Oe } = {}) {
35
- let ke = {
36
- ...ue,
37
- ...r
38
- }, p = {
39
- ...ae,
36
+ function p({ labels: ne, featureLabels: a, isBankingTaglineVisible: o = !0, bankLogoSrc: p, bankLogoAlt: Te, depositAgreementUrl: Ee, selectedAccountId: De, defaultSelectedAccountId: Oe, onSelectedAccountIdChange: ke, "data-testid": Ae } = {}) {
37
+ let je = {
38
+ ...fe,
39
+ ...ne
40
+ }, m = {
41
+ ...se,
40
42
  ...a
41
- }, m = de(), { organizationId: h, widgetToken: Ae, initResponse: g } = fe(), je = me(), _ = !!pe(), v = !!(h && Ae), y = c(() => oe(g?.scopes), [g?.scopes]), Me = v && y.canRead && !!g, b = g?.userId ?? void 0, [x, Ne] = l(h);
42
- h !== void 0 && h !== x && Ne(h);
43
- let [S, Pe] = l(b);
44
- b !== void 0 && b !== S && Pe(b);
45
- let [Fe, C] = be({
46
- prop: Te,
47
- defaultProp: Ee ?? null,
48
- onChange: De,
43
+ }, h = pe(), { organizationId: g, widgetToken: _, initResponse: v } = me(), Me = ge(), { organizationStatus: y } = te(), Ne = ee(y), b = !!he(), x = !!(g && _), Pe = x || !!_ && y === r.Rotating, S = l(() => ce(v?.scopes), [v?.scopes]), Fe = Pe && S.canRead && !!v, C = v?.userId ?? void 0, [w, Ie] = u(g);
44
+ g !== void 0 && g !== w && Ie(g);
45
+ let [T, Le] = u(C);
46
+ C !== void 0 && C !== T && Le(C);
47
+ let [Re, E] = Se({
48
+ prop: De,
49
+ defaultProp: Oe ?? null,
50
+ onChange: ke,
49
51
  caller: "BankAccountsWidget"
50
- }), w = ye({
51
- organizationId: x,
52
- userId: S
53
- }), Ie = d(w.current.organizationId, x) || d(w.current.userId, S);
54
- s(() => {
55
- let e = w.current;
56
- w.current = {
57
- organizationId: x,
58
- userId: S
59
- }, (d(e.organizationId, x) || d(e.userId, S)) && C(null);
52
+ }), D = xe({
53
+ organizationId: w,
54
+ userId: T
55
+ }), ze = f(D.current.organizationId, w) || f(D.current.userId, T);
56
+ c(() => {
57
+ let e = D.current;
58
+ D.current = {
59
+ organizationId: w,
60
+ userId: T
61
+ }, (f(e.organizationId, w) || f(e.userId, T)) && E(null);
60
62
  }, [
61
- x,
62
- S,
63
- C
63
+ w,
64
+ T,
65
+ E
64
66
  ]);
65
- let T = Ie ? null : Fe, E = Me && !T, D = ve((e) => {
66
- C(e);
67
- }, [C]), [O, k] = l(!1), [A, j] = l(u), [Le, M] = l([]), [Re, N] = l(!1), [P, F] = l(), [I, ze] = l({}), [L, R] = l({});
68
- s(() => {
69
- m(i.Mounted);
70
- }, [m]);
71
- let z = ee({ enabled: E }), B = he(), V = ge(), H = O, U = o({ enabled: H }), W = te({ enabled: H }), G = o({
72
- enabled: H,
73
- permissions: [xe]
74
- }), K = c(() => new Set((G.data?.data ?? []).filter((e) => e.organizationId === h).map((e) => e.id)), [G.data?.data, h]), q = c(() => {
75
- let e = W.data?.data ?? [], t = h ? _e(e, {
76
- organizationId: h,
77
- organizationTypes: g?.organizationTypes ?? []
67
+ let Be = ze ? null : Re, O = Fe && !Be, k = be((e) => {
68
+ E(e);
69
+ }, [E]), [A, j] = u(!1), [M, N] = u(d), [Ve, P] = u([]), [He, F] = u(!1), [Ue, I] = u(), [L, We] = u({}), [R, z] = u({});
70
+ c(() => {
71
+ h(i.Mounted);
72
+ }, [h]);
73
+ let B = re({ enabled: O }), V = _e(), H = ve(), U = A, W = s({ enabled: U }), G = ie({ enabled: U }), K = s({
74
+ enabled: U,
75
+ permissions: [Ce]
76
+ }), q = l(() => new Set((K.data?.data ?? []).filter((e) => e.organizationId === g).map((e) => e.id)), [K.data?.data, g]), J = l(() => {
77
+ let e = G.data?.data ?? [], t = g ? ye(e, {
78
+ organizationId: g,
79
+ organizationTypes: v?.organizationTypes ?? []
78
80
  }) : e;
79
- return le(U.data?.data ?? [], ce(t), K);
81
+ return de(W.data?.data ?? [], ue(t), q);
80
82
  }, [
81
- K,
83
+ q,
84
+ G.data?.data,
82
85
  W.data?.data,
83
- U.data?.data,
84
- h,
85
- g?.organizationTypes
86
- ]), J = U.isLoading || U.isFetchingNextPage || !!U.hasNextPage || W.isResolving || G.isLoading || G.isFetchingNextPage || !!G.hasNextPage, Be = !J && !U.isError && !G.isError, Y = E ? z.data?.data ?? [] : [], X = [.../* @__PURE__ */ new Set([...q.filter((e) => e.locked).map((e) => e.id), ...Le])], Ve = g?.bankName?.trim() ?? "", He = g?.vspName?.trim() ?? "", Ue = we?.trim() || void 0, Z = v && y.canWrite, Q = !z.hasNextPage && !z.isFetchingNextPage, We = c(() => Q ? re(Y) : void 0, [Y, Q]), Ge = Y.length > 1 && y.canRead && Q, $ = ve(async (t, n, r) => {
87
- await ne(r) && (e.success(n === "account" ? p.copyAccountNumberToast : p.copyRoutingNumberToast), R((e) => ({
86
+ g,
87
+ v?.organizationTypes
88
+ ]), Ge = W.isLoading || W.isFetchingNextPage || !!W.hasNextPage || G.isResolving || K.isLoading || K.isFetchingNextPage || !!K.hasNextPage, Ke = !Ge && !W.isError && !K.isError, Y = O ? B.data?.data ?? [] : [], X = [.../* @__PURE__ */ new Set([...J.filter((e) => e.locked).map((e) => e.id), ...Ve])], qe = v?.bankName?.trim() ?? "", Je = v?.vspName?.trim() ?? "", Ye = Ee?.trim() || void 0, Z = x && S.canWrite, Q = !B.hasNextPage && !B.isFetchingNextPage, Xe = l(() => Q ? oe(Y) : void 0, [Y, Q]), Ze = Y.length > 1 && S.canRead && Q, $ = be(async (t, n, r) => {
89
+ await ae(r) && (e.success(n === "account" ? m.copyAccountNumberToast : m.copyRoutingNumberToast), z((e) => ({
88
90
  ...e,
89
91
  [t]: n
90
92
  })), window.setTimeout(() => {
91
- R((e) => ({
93
+ z((e) => ({
92
94
  ...e,
93
95
  [t]: void 0
94
96
  }));
95
97
  }, 2e3));
96
- }, [p.copyAccountNumberToast, p.copyRoutingNumberToast]), Ke = c(() => Y.map((e) => Se(e, p, {
97
- isAccountNumberVisible: I[e.id] ?? !1,
98
- isAccountNumberCopied: L[e.id] === "account",
99
- isRoutingNumberCopied: L[e.id] === "routing",
100
- onToggleAccountNumberVisibility: () => ze((t) => ({
98
+ }, [m.copyAccountNumberToast, m.copyRoutingNumberToast]), Qe = l(() => Y.map((e) => we(e, m, {
99
+ isAccountNumberVisible: L[e.id] ?? !1,
100
+ isAccountNumberCopied: R[e.id] === "account",
101
+ isRoutingNumberCopied: R[e.id] === "routing",
102
+ onToggleAccountNumberVisibility: () => We((t) => ({
101
103
  ...t,
102
104
  [e.id]: !t[e.id]
103
105
  })),
104
106
  onCopyAccountNumber: () => void $(e.id, "account", e.accountNumber),
105
107
  onCopyRoutingNumber: () => void $(e.id, "routing", e.routingNumber),
106
108
  onSelect: () => {
107
- D(e.id), m(i.AccountSelected, { accountId: e.id });
109
+ k(e.id), h(i.AccountSelected, { accountId: e.id });
108
110
  }
109
111
  })), [
110
112
  Y,
111
- I,
112
113
  L,
113
- p,
114
+ R,
115
+ m,
114
116
  $,
115
- D,
116
- m
117
- ]), qe = (r) => {
118
- V.mutate({
117
+ k,
118
+ h
119
+ ]), $e = (r) => {
120
+ H.mutate({
119
121
  path: { id: r },
120
122
  body: { userIds: X }
121
123
  }, { onSuccess: () => {
122
- n(t), e.success(p.createSuccessToast), j(u), M([]), F(void 0), N(!1), k(!1);
124
+ n(t), e.success(m.createSuccessToast), N(d), P([]), I(void 0), F(!1), j(!1);
123
125
  } });
124
- }, Je = () => {
125
- if (Z && Be) {
126
- if (A.nickname.trim() === "") {
127
- N(!0);
126
+ }, et = () => {
127
+ if (Z && Ke) {
128
+ if (M.nickname.trim() === "") {
129
+ F(!0);
128
130
  return;
129
131
  }
130
132
  if (X.length === 0) {
131
133
  console.warn("No team members selected on submit");
132
134
  return;
133
135
  }
134
- if (P) {
135
- qe(P);
136
+ if (Ue) {
137
+ $e(Ue);
136
138
  return;
137
139
  }
138
- B.mutate({ body: { nickname: A.nickname.trim() } }, { onSuccess: (e) => {
139
- m(i.AccountCreated, { accountId: e?.id }), e?.id && (F(e.id), qe(e.id));
140
+ V.mutate({ body: { nickname: M.nickname.trim() } }, { onSuccess: (e) => {
141
+ h(i.AccountCreated, { accountId: e?.id }), e?.id && (I(e.id), $e(e.id));
140
142
  } });
141
143
  }
142
- }, Ye = (e, t) => {
143
- q.find((t) => t.id === e)?.locked || M((n) => t ? [.../* @__PURE__ */ new Set([...n, e])] : n.filter((t) => t !== e));
144
- }, Xe = (e) => {
145
- (!e || Z) && (e && (j(u), M([]), F(void 0), N(!1), B.reset(), V.reset()), k(e));
146
- }, Ze = B.isPending || V.isPending, Qe = se(q, {
147
- selectedUserIds: Le,
148
- disabled: Ze || !y.canWrite,
149
- fallbackTooltip: ke.teamMemberAccessTooltip,
150
- onUserToggle: Ye
144
+ }, tt = (e, t) => {
145
+ J.find((t) => t.id === e)?.locked || P((n) => t ? [.../* @__PURE__ */ new Set([...n, e])] : n.filter((t) => t !== e));
146
+ }, nt = (e) => {
147
+ (!e || Z) && (e && (N(d), P([]), I(void 0), F(!1), V.reset(), H.reset()), j(e));
148
+ }, rt = V.isPending || H.isPending, it = le(J, {
149
+ selectedUserIds: Ve,
150
+ disabled: rt || !S.canWrite,
151
+ fallbackTooltip: je.teamMemberAccessTooltip,
152
+ onUserToggle: tt
151
153
  });
152
154
  return {
153
- "data-testid": Oe,
154
- selectedAccountId: T,
155
- bankDisplayName: Ve,
156
- bankLogoSrc: f,
157
- bankLogoAlt: Ce,
158
- availableBalanceLabel: We,
159
- shouldDisplayAvailableBalance: Ge,
160
- isBankingTaglineVisible: ie,
161
- accountCards: Ke,
162
- shouldDisplayAddAccountCard: y.canWrite,
163
- isLoading: !_ && (!v || je && !g || E && (z.isLoading || z.isFetchingNextPage || z.hasNextPage)),
164
- isError: _ || E && z.isError,
165
- isCreateOpen: O,
166
- createForm: A,
155
+ "data-testid": Ae,
156
+ selectedAccountId: Be,
157
+ bankDisplayName: qe,
158
+ bankLogoSrc: p,
159
+ bankLogoAlt: Te,
160
+ availableBalanceLabel: Xe,
161
+ shouldDisplayAvailableBalance: Ze,
162
+ isBankingTaglineVisible: o,
163
+ accountCards: Qe,
164
+ shouldDisplayAddAccountCard: S.canWrite,
165
+ isLoading: !b && (Ne && !B.data || Me && !v || O && (B.isLoading || B.isFetchingNextPage || B.hasNextPage)),
166
+ isError: b || O && B.isError,
167
+ isCreateOpen: A,
168
+ createForm: M,
167
169
  legalCopy: {
168
- bankName: Ve,
169
- vspName: He,
170
- agreementUrl: Ue
170
+ bankName: qe,
171
+ vspName: Je,
172
+ agreementUrl: Ye
171
173
  },
172
- accessRows: Qe,
173
- isTeamMembersLoading: J,
174
- isTeamMembersError: U.isError || G.isError,
175
- isCreateSubmitDisabled: !Z || !Be || A.nickname.trim() === "" || X.length === 0,
176
- isCreateError: B.isError || V.isError,
177
- hasNicknameError: Re,
178
- isSubmitting: Ze,
174
+ accessRows: it,
175
+ isTeamMembersLoading: Ge,
176
+ isTeamMembersError: W.isError || K.isError,
177
+ isCreateSubmitDisabled: !Z || !Ke || M.nickname.trim() === "" || X.length === 0,
178
+ isCreateError: V.isError || H.isError,
179
+ hasNicknameError: He,
180
+ isSubmitting: rt,
179
181
  isCreateDisabled: !Z,
180
- onCreateOpenChange: Xe,
182
+ onCreateOpenChange: nt,
181
183
  onCreateFormChange: (e) => {
182
- N(!1), j(e);
184
+ F(!1), N(e);
183
185
  },
184
- onCreateSubmit: Je,
185
- onAddAccountClick: () => Xe(!0),
186
- onSelectAccount: D
186
+ onCreateSubmit: et,
187
+ onAddAccountClick: () => nt(!0),
188
+ onSelectAccount: k
187
189
  };
188
190
  }
189
- function Se(e, t, n) {
191
+ function we(e, t, n) {
190
192
  return {
191
193
  id: e.id,
192
194
  name: e.nickname?.trim() || t.accountFallback,
193
195
  balanceLabel: a(e.balance),
194
196
  accountNumberLabel: e.accountNumber,
195
- maskedAccountNumberLabel: ie(e.accountNumber),
197
+ maskedAccountNumberLabel: o(e.accountNumber),
196
198
  routingNumberLabel: e.routingNumber,
197
199
  ...n
198
200
  };
199
201
  }
200
202
  //#endregion
201
- export { f as useBankAccountsWidget };
203
+ export { p as useBankAccountsWidget };
@@ -4,39 +4,38 @@
4
4
  "use client";
5
5
  import { getPaymentRecords as e } from "../../../../shared/data-access/dist/lib/rest/sdk.gen.js";
6
6
  import { getPaymentRecordsOptions as t } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
7
- import { authEpochPlaceholder as n, withAuthEpoch as r } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
8
- import { useEmbedApi as i } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
9
- import { organizationHeaders as a } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
10
- import { getAllPagesNextPaginationTokenParam as o, isAllPagesResolving as s, useAutoFetchNextPage as c } from "../../../../shared/data-access/dist/lib/allPages.js";
7
+ import { withAuthEpochInfinite as n } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
8
+ import { useEmbedApi as r } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
9
+ import { organizationHeaders as i } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
10
+ import { getAllPagesNextPaginationTokenParam as a, isAllPagesResolving as o, useAutoFetchNextPage as s } from "../../../../shared/data-access/dist/lib/allPages.js";
11
11
  import "../../../../shared/data-access/dist/index.js";
12
- import { useMemo as l } from "react";
13
- import { useInfiniteQuery as u } from "@tanstack/react-query";
12
+ import { useMemo as c } from "react";
13
+ import { useInfiniteQuery as l } from "@tanstack/react-query";
14
14
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index18.js
15
- var d = 100;
16
- function f(f, { enabled: p } = {}) {
17
- let { client: m, organizationId: h, widgetToken: g, authEpoch: _, organizationPending: v } = i(), y = a(h), b = !!(h && g && f) && p !== !1, x = {
18
- limit: d,
19
- object_id__in: f ? [f] : [],
15
+ var u = 100;
16
+ function d(d, { enabled: f } = {}) {
17
+ let { client: p, organizationId: m, widgetToken: h, authEpoch: g, organizationStatus: _ } = r(), v = i(m), y = !!(m && h && d) && f !== !1, b = {
18
+ limit: u,
19
+ object_id__in: d ? [d] : [],
20
20
  order: "desc",
21
21
  sort: "paid_at"
22
- }, S = t({
23
- client: m,
24
- headers: y,
25
- query: x
26
- }), C = u({
27
- queryKey: [...r(S, {
28
- authEpoch: _,
29
- organizationPending: v
30
- }).queryKey, "all"],
31
- placeholderData: n(S.queryKey, v),
32
- enabled: b,
22
+ }, x = t({
23
+ client: p,
24
+ headers: v,
25
+ query: b
26
+ }), S = l({
27
+ ...n(x.queryKey, {
28
+ authEpoch: g,
29
+ organizationStatus: _
30
+ }, { suffix: ["all"] }),
31
+ enabled: y,
33
32
  initialPageParam: void 0,
34
33
  queryFn: async ({ signal: t, pageParam: n }) => {
35
34
  let { data: r } = await e({
36
- client: m,
37
- headers: y,
35
+ client: p,
36
+ headers: v,
38
37
  query: {
39
- ...x,
38
+ ...b,
40
39
  ...n ? { pagination_token: n } : {}
41
40
  },
42
41
  signal: t,
@@ -44,15 +43,15 @@ function f(f, { enabled: p } = {}) {
44
43
  });
45
44
  return r;
46
45
  },
47
- getNextPageParam: o
46
+ getNextPageParam: a
48
47
  });
49
- c(C, b);
50
- let w = l(() => C.data?.pages.flatMap((e) => e.data ?? []) ?? [], [C.data]);
48
+ s(S, y);
49
+ let C = c(() => S.data?.pages.flatMap((e) => e.data ?? []) ?? [], [S.data]);
51
50
  return {
52
- ...C,
53
- paymentRecords: w,
54
- isResolving: b && s(C)
51
+ ...S,
52
+ paymentRecords: C,
53
+ isResolving: y && o(S)
55
54
  };
56
55
  }
57
56
  //#endregion
58
- export { f as usePayablePaymentRecordsQuery };
57
+ export { d as usePayablePaymentRecordsQuery };
@@ -11,13 +11,13 @@ import "../../../../shared/data-access/dist/index.js";
11
11
  import { useQuery as a } from "@tanstack/react-query";
12
12
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index19.js
13
13
  function o(o, { enabled: s = !0 } = {}) {
14
- let { client: c, organizationId: l, widgetToken: u, authEpoch: d, organizationPending: f } = n(), p = !!(l && u && o) && s, m = e({
14
+ let { client: c, organizationId: l, widgetToken: u, authEpoch: d, organizationStatus: f } = n(), p = !!(l && u && o) && s, m = e({
15
15
  client: c,
16
16
  headers: r(l),
17
17
  path: { payable_id: o ?? "" }
18
18
  }), { queryKey: h, queryFn: g } = t(m, {
19
19
  authEpoch: d,
20
- organizationPending: f
20
+ organizationStatus: f
21
21
  });
22
22
  return a({
23
23
  queryKey: h,
@@ -16,7 +16,7 @@ import "../../../data-access/dist/index.js";
16
16
  import { useMutation as d, useQuery as f } from "@tanstack/react-query";
17
17
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index2.js
18
18
  function p(e, { enabled: t } = {}) {
19
- let { client: c, organizationId: l, widgetToken: u, authEpoch: d, organizationPending: p } = i(), m = !!(l && u && e) && t !== !1, h = n({
19
+ let { client: c, organizationId: l, widgetToken: u, authEpoch: d, organizationStatus: p } = i(), m = !!(l && u && e) && t !== !1, h = n({
20
20
  client: c,
21
21
  headers: a(l),
22
22
  query: {
@@ -28,7 +28,7 @@ function p(e, { enabled: t } = {}) {
28
28
  return f({
29
29
  ...r(h, {
30
30
  authEpoch: d,
31
- organizationPending: p
31
+ organizationStatus: p
32
32
  }),
33
33
  enabled: m
34
34
  });
@@ -13,7 +13,7 @@ import { payablePolicyAssignmentQueryOptions as a } from "./index20.js";
13
13
  import { useQuery as o } from "@tanstack/react-query";
14
14
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index21.js
15
15
  function s(s, { enabled: c = !0, pollWhileOcrProcessing: l = !1, pollWhilePolicyAssignmentUnsettled: u = !1 } = {}) {
16
- let { client: d, organizationId: f, widgetToken: p, authEpoch: m, organizationPending: h } = n(), g = !!(f && p && s) && c, _ = l ? i({
16
+ let { client: d, organizationId: f, widgetToken: p, authEpoch: m, organizationStatus: h } = n(), g = !!(f && p && s) && c, _ = l ? i({
17
17
  client: d,
18
18
  organizationId: f,
19
19
  payableId: s ?? ""
@@ -35,7 +35,7 @@ function s(s, { enabled: c = !0, pollWhileOcrProcessing: l = !1, pollWhilePolicy
35
35
  return o({
36
36
  ...t(b, {
37
37
  authEpoch: m,
38
- organizationPending: h
38
+ organizationStatus: h
39
39
  }),
40
40
  enabled: g
41
41
  });
@@ -10,7 +10,7 @@ import "../../../../shared/data-access/dist/index.js";
10
10
  import { useQueries as i } from "@tanstack/react-query";
11
11
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index22.js
12
12
  function a(a, { enabled: o = !0 } = {}) {
13
- let { client: s, organizationId: c, widgetToken: l, authEpoch: u, organizationPending: d } = n(), f = !!(c && l) && o, p = r(c);
13
+ let { client: s, organizationId: c, widgetToken: l, authEpoch: u, organizationStatus: d } = n(), f = !!(c && l) && o, p = r(c);
14
14
  return i({ queries: a.map((n) => ({
15
15
  ...t(e({
16
16
  client: s,
@@ -18,7 +18,7 @@ function a(a, { enabled: o = !0 } = {}) {
18
18
  path: { payable_id: n }
19
19
  }), {
20
20
  authEpoch: u,
21
- organizationPending: d
21
+ organizationStatus: d
22
22
  }),
23
23
  enabled: f
24
24
  })) });
@@ -11,7 +11,7 @@ import { useQuery as i } from "@tanstack/react-query";
11
11
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index3.js
12
12
  var a = 100;
13
13
  function o(o, { enabled: s } = {}) {
14
- let { client: c, organizationId: l, widgetToken: u, authEpoch: d, organizationPending: f } = n(), p = !!(l && u && o) && s !== !1, m = e({
14
+ let { client: c, organizationId: l, widgetToken: u, authEpoch: d, organizationStatus: f } = n(), p = !!(l && u && o) && s !== !1, m = e({
15
15
  client: c,
16
16
  headers: r(l),
17
17
  path: { payable_id: o ?? "" },
@@ -24,7 +24,7 @@ function o(o, { enabled: s } = {}) {
24
24
  return i({
25
25
  ...t(m, {
26
26
  authEpoch: d,
27
- organizationPending: f
27
+ organizationStatus: f
28
28
  }),
29
29
  enabled: p
30
30
  });
@@ -4,38 +4,37 @@
4
4
  "use client";
5
5
  import { getPayablesIdLineItems as e, putPayablesIdLineItems as t } from "../../../../shared/data-access/dist/lib/rest/sdk.gen.js";
6
6
  import { getPayablesIdLineItemsOptions as n } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
7
- import { authEpochPlaceholder as r, withAuthEpoch as i } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
8
- import { useEmbedApi as a } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
9
- import { organizationHeaders as o } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
10
- import { getAllPagesNextPaginationTokenParam as s, isAllPagesResolving as c, useAutoFetchNextPage as l } from "../../../../shared/data-access/dist/lib/allPages.js";
7
+ import { withAuthEpochInfinite as r } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
8
+ import { useEmbedApi as i } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
9
+ import { organizationHeaders as a } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
10
+ import { getAllPagesNextPaginationTokenParam as o, isAllPagesResolving as s, useAutoFetchNextPage as c } from "../../../../shared/data-access/dist/lib/allPages.js";
11
11
  import "../../../../shared/data-access/dist/index.js";
12
- import { invalidatePayableQueries as u } from "../../../data-access/dist/lib/invalidatePayableQueries/invalidatePayableQueries.js";
12
+ import { invalidatePayableQueries as l } from "../../../data-access/dist/lib/invalidatePayableQueries/invalidatePayableQueries.js";
13
13
  import "../../../data-access/dist/invalidation.js";
14
- import { useMemo as d } from "react";
15
- import { useInfiniteQuery as f, useMutation as p } from "@tanstack/react-query";
14
+ import { useMemo as u } from "react";
15
+ import { useInfiniteQuery as d, useMutation as f } from "@tanstack/react-query";
16
16
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index4.js
17
- var m = 100;
18
- function h(t, { enabled: u } = {}) {
19
- let { client: p, organizationId: h, widgetToken: g, authEpoch: _, organizationPending: v } = a(), y = o(h), b = !!(h && g && t) && u !== !1, x = n({
20
- client: p,
21
- headers: y,
17
+ var p = 100;
18
+ function m(t, { enabled: l } = {}) {
19
+ let { client: f, organizationId: m, widgetToken: h, authEpoch: g, organizationStatus: _ } = i(), v = a(m), y = !!(m && h && t) && l !== !1, b = n({
20
+ client: f,
21
+ headers: v,
22
22
  path: { payable_id: t ?? "" },
23
- query: { limit: m }
24
- }), S = f({
25
- queryKey: [...i(x, {
26
- authEpoch: _,
27
- organizationPending: v
28
- }).queryKey, "all"],
29
- placeholderData: r(x.queryKey, v),
30
- enabled: b,
23
+ query: { limit: p }
24
+ }), x = d({
25
+ ...r(b.queryKey, {
26
+ authEpoch: g,
27
+ organizationStatus: _
28
+ }, { suffix: ["all"] }),
29
+ enabled: y,
31
30
  initialPageParam: void 0,
32
31
  queryFn: async ({ signal: n, pageParam: r }) => {
33
32
  let { data: i } = await e({
34
- client: p,
35
- headers: y,
33
+ client: f,
34
+ headers: v,
36
35
  path: { payable_id: t ?? "" },
37
36
  query: {
38
- limit: m,
37
+ limit: p,
39
38
  ...r ? { pagination_token: r } : {}
40
39
  },
41
40
  signal: n,
@@ -43,31 +42,31 @@ function h(t, { enabled: u } = {}) {
43
42
  });
44
43
  return i;
45
44
  },
46
- getNextPageParam: s
45
+ getNextPageParam: o
47
46
  });
48
- l(S, b);
49
- let C = d(() => S.data?.pages.flatMap((e) => e.data ?? []) ?? [], [S.data]);
47
+ c(x, y);
48
+ let S = u(() => x.data?.pages.flatMap((e) => e.data ?? []) ?? [], [x.data]);
50
49
  return {
51
- ...S,
52
- lineItems: C,
53
- isResolving: c(S)
50
+ ...x,
51
+ lineItems: S,
52
+ isResolving: s(x)
54
53
  };
55
54
  }
56
- function g() {
57
- let { client: e, organizationId: n } = a();
58
- return p({
55
+ function h() {
56
+ let { client: e, organizationId: n } = i();
57
+ return f({
59
58
  mutationFn: async ({ path: r, body: i }) => {
60
- let { data: a } = await t({
59
+ let { data: o } = await t({
61
60
  client: e,
62
- headers: o(n),
61
+ headers: a(n),
63
62
  path: r,
64
63
  body: i,
65
64
  throwOnError: !0
66
65
  });
67
- return a;
66
+ return o;
68
67
  },
69
68
  onSuccess: async (t, r) => {
70
- await u({
69
+ await l({
71
70
  client: e,
72
71
  organizationId: n,
73
72
  payableId: r.path.payable_id,
@@ -77,4 +76,4 @@ function g() {
77
76
  });
78
77
  }
79
78
  //#endregion
80
- export { h as useAllPayableLineItemsQuery, g as useReplacePayableLineItemsMutation };
79
+ export { m as useAllPayableLineItemsQuery, h as useReplacePayableLineItemsMutation };