@tesouro/embedded-components-react 0.5.182 → 0.5.183
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +6 -0
- package/dist/index.d.ts +30 -1
- package/dist/lib/BankAccountOnboardingWidget.d.ts +30 -1
- package/dist/lib/WidgetSuite.d.ts +30 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index.js +5 -4
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index10.js +3 -32
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index11.js +24 -33
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index12.js +44 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index8.js +13 -36
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index9.js +43 -3
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index12.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index23.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index25.js +339 -301
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index27.js +11 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index28.js +64 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +34 -34
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +188 -181
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +162 -154
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShell.js +67 -55
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/labels.js +1 -0
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -1286,6 +1286,9 @@
|
|
|
1286
1286
|
.ttw\:w-\[720px\] {
|
|
1287
1287
|
width: 720px;
|
|
1288
1288
|
}
|
|
1289
|
+
.ttw\:w-\[840px\] {
|
|
1290
|
+
width: 840px;
|
|
1291
|
+
}
|
|
1289
1292
|
.ttw\:w-\[880px\] {
|
|
1290
1293
|
width: 880px;
|
|
1291
1294
|
}
|
|
@@ -5767,6 +5770,9 @@
|
|
|
5767
5770
|
.ttw\:sm\:flex-row {
|
|
5768
5771
|
flex-direction: row;
|
|
5769
5772
|
}
|
|
5773
|
+
.ttw\:sm\:items-center {
|
|
5774
|
+
align-items: center;
|
|
5775
|
+
}
|
|
5770
5776
|
.ttw\:sm\:justify-between {
|
|
5771
5777
|
justify-content: space-between;
|
|
5772
5778
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1773,6 +1773,21 @@ interface UnsavedApplicationDialogLabels {
|
|
|
1773
1773
|
closeButton: string;
|
|
1774
1774
|
}
|
|
1775
1775
|
|
|
1776
|
+
interface DeleteApplicationDialogLabels {
|
|
1777
|
+
title: string;
|
|
1778
|
+
/**
|
|
1779
|
+
* The description is split around the emphasised name of the save control so
|
|
1780
|
+
* the bold run can be restyled without translators touching markup.
|
|
1781
|
+
*/
|
|
1782
|
+
descriptionBeforeEmphasis: string;
|
|
1783
|
+
descriptionEmphasis: string;
|
|
1784
|
+
descriptionAfterEmphasis: string;
|
|
1785
|
+
/** Closes the prompt and returns to the form. */
|
|
1786
|
+
keepEditingButton: string;
|
|
1787
|
+
/** Permanently deletes the application. */
|
|
1788
|
+
deleteButton: string;
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1776
1791
|
interface BankAccountOnboardingWidgetLabels {
|
|
1777
1792
|
stepIndicator: {
|
|
1778
1793
|
business: string;
|
|
@@ -1786,11 +1801,20 @@ interface BankAccountOnboardingWidgetLabels {
|
|
|
1786
1801
|
result: ResultLabels;
|
|
1787
1802
|
/** The prompt shown when closing with unsaved changes. */
|
|
1788
1803
|
unsavedApplicationDialog: Partial<UnsavedApplicationDialogLabels>;
|
|
1804
|
+
/**
|
|
1805
|
+
* The prompt confirming "Cancel and delete application". Its bold run
|
|
1806
|
+
* defaults to `saveAndClose`, so it names the footer's save control.
|
|
1807
|
+
*/
|
|
1808
|
+
deleteApplicationDialog: Partial<DeleteApplicationDialogLabels>;
|
|
1789
1809
|
back: string;
|
|
1790
1810
|
cancel: string;
|
|
1791
1811
|
next: string;
|
|
1792
1812
|
submit: string;
|
|
1793
1813
|
saveAndClose: string;
|
|
1814
|
+
/** The destructive footer control that opens the delete prompt. */
|
|
1815
|
+
deleteApplication: string;
|
|
1816
|
+
/** Shown once the application has been deleted. */
|
|
1817
|
+
applicationDeletedToast: string;
|
|
1794
1818
|
/** Shown after "Save and close" or the close prompt's "Save changes" writes the application. */
|
|
1795
1819
|
applicationSavedToast: string;
|
|
1796
1820
|
businessReviewTitle: string;
|
|
@@ -1852,6 +1876,11 @@ interface BankAccountOnboardingWidgetInnerProps {
|
|
|
1852
1876
|
applicationId: string;
|
|
1853
1877
|
authEpoch: number;
|
|
1854
1878
|
} | null) => void;
|
|
1879
|
+
/**
|
|
1880
|
+
* Called once the applicant has deleted the application, so the session
|
|
1881
|
+
* scope can start a fresh one. Set by the session scope, not by hosts.
|
|
1882
|
+
*/
|
|
1883
|
+
onApplicationDeleted?: () => void;
|
|
1855
1884
|
bankLogoSrc?: string;
|
|
1856
1885
|
/**
|
|
1857
1886
|
* Host-resolved disclosure URLs for the business-details agreement step.
|
|
@@ -1886,7 +1915,7 @@ interface BankAccountOnboardingWidgetInnerProps {
|
|
|
1886
1915
|
*/
|
|
1887
1916
|
isFullScreenInline?: boolean;
|
|
1888
1917
|
}
|
|
1889
|
-
type BankAccountOnboardingWidgetProps = WidgetProviderProps & Omit<BankAccountOnboardingWidgetInnerProps, 'initialApplicationId' | 'initialBoundAuthEpoch' | 'initialBusinessDetails' | 'initialPersonalDetails' | 'initialAdditionalOwners' | 'onEditableDraftChange'> & {
|
|
1918
|
+
type BankAccountOnboardingWidgetProps = WidgetProviderProps & Omit<BankAccountOnboardingWidgetInnerProps, 'initialApplicationId' | 'initialBoundAuthEpoch' | 'initialBusinessDetails' | 'initialPersonalDetails' | 'initialAdditionalOwners' | 'onEditableDraftChange' | 'onApplicationDeleted'> & {
|
|
1890
1919
|
initialBusinessDetails?: Partial<HostSupplied<BusinessDetailsValues>>;
|
|
1891
1920
|
initialPersonalDetails?: Partial<HostSupplied<PersonalDetailsValues>>;
|
|
1892
1921
|
initialAdditionalOwners?: HostSuppliedOwner[];
|
|
@@ -926,6 +926,21 @@ interface UnsavedApplicationDialogLabels {
|
|
|
926
926
|
closeButton: string;
|
|
927
927
|
}
|
|
928
928
|
|
|
929
|
+
interface DeleteApplicationDialogLabels {
|
|
930
|
+
title: string;
|
|
931
|
+
/**
|
|
932
|
+
* The description is split around the emphasised name of the save control so
|
|
933
|
+
* the bold run can be restyled without translators touching markup.
|
|
934
|
+
*/
|
|
935
|
+
descriptionBeforeEmphasis: string;
|
|
936
|
+
descriptionEmphasis: string;
|
|
937
|
+
descriptionAfterEmphasis: string;
|
|
938
|
+
/** Closes the prompt and returns to the form. */
|
|
939
|
+
keepEditingButton: string;
|
|
940
|
+
/** Permanently deletes the application. */
|
|
941
|
+
deleteButton: string;
|
|
942
|
+
}
|
|
943
|
+
|
|
929
944
|
interface BankAccountOnboardingWidgetLabels {
|
|
930
945
|
stepIndicator: {
|
|
931
946
|
business: string;
|
|
@@ -939,11 +954,20 @@ interface BankAccountOnboardingWidgetLabels {
|
|
|
939
954
|
result: ResultLabels;
|
|
940
955
|
/** The prompt shown when closing with unsaved changes. */
|
|
941
956
|
unsavedApplicationDialog: Partial<UnsavedApplicationDialogLabels>;
|
|
957
|
+
/**
|
|
958
|
+
* The prompt confirming "Cancel and delete application". Its bold run
|
|
959
|
+
* defaults to `saveAndClose`, so it names the footer's save control.
|
|
960
|
+
*/
|
|
961
|
+
deleteApplicationDialog: Partial<DeleteApplicationDialogLabels>;
|
|
942
962
|
back: string;
|
|
943
963
|
cancel: string;
|
|
944
964
|
next: string;
|
|
945
965
|
submit: string;
|
|
946
966
|
saveAndClose: string;
|
|
967
|
+
/** The destructive footer control that opens the delete prompt. */
|
|
968
|
+
deleteApplication: string;
|
|
969
|
+
/** Shown once the application has been deleted. */
|
|
970
|
+
applicationDeletedToast: string;
|
|
947
971
|
/** Shown after "Save and close" or the close prompt's "Save changes" writes the application. */
|
|
948
972
|
applicationSavedToast: string;
|
|
949
973
|
businessReviewTitle: string;
|
|
@@ -1005,6 +1029,11 @@ interface BankAccountOnboardingWidgetInnerProps {
|
|
|
1005
1029
|
applicationId: string;
|
|
1006
1030
|
authEpoch: number;
|
|
1007
1031
|
} | null) => void;
|
|
1032
|
+
/**
|
|
1033
|
+
* Called once the applicant has deleted the application, so the session
|
|
1034
|
+
* scope can start a fresh one. Set by the session scope, not by hosts.
|
|
1035
|
+
*/
|
|
1036
|
+
onApplicationDeleted?: () => void;
|
|
1008
1037
|
bankLogoSrc?: string;
|
|
1009
1038
|
/**
|
|
1010
1039
|
* Host-resolved disclosure URLs for the business-details agreement step.
|
|
@@ -1039,7 +1068,7 @@ interface BankAccountOnboardingWidgetInnerProps {
|
|
|
1039
1068
|
*/
|
|
1040
1069
|
isFullScreenInline?: boolean;
|
|
1041
1070
|
}
|
|
1042
|
-
type BankAccountOnboardingWidgetProps = WidgetProviderProps & Omit<BankAccountOnboardingWidgetInnerProps, 'initialApplicationId' | 'initialBoundAuthEpoch' | 'initialBusinessDetails' | 'initialPersonalDetails' | 'initialAdditionalOwners' | 'onEditableDraftChange'> & {
|
|
1071
|
+
type BankAccountOnboardingWidgetProps = WidgetProviderProps & Omit<BankAccountOnboardingWidgetInnerProps, 'initialApplicationId' | 'initialBoundAuthEpoch' | 'initialBusinessDetails' | 'initialPersonalDetails' | 'initialAdditionalOwners' | 'onEditableDraftChange' | 'onApplicationDeleted'> & {
|
|
1043
1072
|
initialBusinessDetails?: Partial<HostSupplied<BusinessDetailsValues>>;
|
|
1044
1073
|
initialPersonalDetails?: Partial<HostSupplied<PersonalDetailsValues>>;
|
|
1045
1074
|
initialAdditionalOwners?: HostSuppliedOwner[];
|
|
@@ -976,6 +976,21 @@ interface UnsavedApplicationDialogLabels {
|
|
|
976
976
|
closeButton: string;
|
|
977
977
|
}
|
|
978
978
|
|
|
979
|
+
interface DeleteApplicationDialogLabels {
|
|
980
|
+
title: string;
|
|
981
|
+
/**
|
|
982
|
+
* The description is split around the emphasised name of the save control so
|
|
983
|
+
* the bold run can be restyled without translators touching markup.
|
|
984
|
+
*/
|
|
985
|
+
descriptionBeforeEmphasis: string;
|
|
986
|
+
descriptionEmphasis: string;
|
|
987
|
+
descriptionAfterEmphasis: string;
|
|
988
|
+
/** Closes the prompt and returns to the form. */
|
|
989
|
+
keepEditingButton: string;
|
|
990
|
+
/** Permanently deletes the application. */
|
|
991
|
+
deleteButton: string;
|
|
992
|
+
}
|
|
993
|
+
|
|
979
994
|
interface BankAccountOnboardingWidgetLabels {
|
|
980
995
|
stepIndicator: {
|
|
981
996
|
business: string;
|
|
@@ -989,11 +1004,20 @@ interface BankAccountOnboardingWidgetLabels {
|
|
|
989
1004
|
result: ResultLabels;
|
|
990
1005
|
/** The prompt shown when closing with unsaved changes. */
|
|
991
1006
|
unsavedApplicationDialog: Partial<UnsavedApplicationDialogLabels>;
|
|
1007
|
+
/**
|
|
1008
|
+
* The prompt confirming "Cancel and delete application". Its bold run
|
|
1009
|
+
* defaults to `saveAndClose`, so it names the footer's save control.
|
|
1010
|
+
*/
|
|
1011
|
+
deleteApplicationDialog: Partial<DeleteApplicationDialogLabels>;
|
|
992
1012
|
back: string;
|
|
993
1013
|
cancel: string;
|
|
994
1014
|
next: string;
|
|
995
1015
|
submit: string;
|
|
996
1016
|
saveAndClose: string;
|
|
1017
|
+
/** The destructive footer control that opens the delete prompt. */
|
|
1018
|
+
deleteApplication: string;
|
|
1019
|
+
/** Shown once the application has been deleted. */
|
|
1020
|
+
applicationDeletedToast: string;
|
|
997
1021
|
/** Shown after "Save and close" or the close prompt's "Save changes" writes the application. */
|
|
998
1022
|
applicationSavedToast: string;
|
|
999
1023
|
businessReviewTitle: string;
|
|
@@ -1055,6 +1079,11 @@ interface BankAccountOnboardingWidgetInnerProps {
|
|
|
1055
1079
|
applicationId: string;
|
|
1056
1080
|
authEpoch: number;
|
|
1057
1081
|
} | null) => void;
|
|
1082
|
+
/**
|
|
1083
|
+
* Called once the applicant has deleted the application, so the session
|
|
1084
|
+
* scope can start a fresh one. Set by the session scope, not by hosts.
|
|
1085
|
+
*/
|
|
1086
|
+
onApplicationDeleted?: () => void;
|
|
1058
1087
|
bankLogoSrc?: string;
|
|
1059
1088
|
/**
|
|
1060
1089
|
* Host-resolved disclosure URLs for the business-details agreement step.
|
|
@@ -1089,7 +1118,7 @@ interface BankAccountOnboardingWidgetInnerProps {
|
|
|
1089
1118
|
*/
|
|
1090
1119
|
isFullScreenInline?: boolean;
|
|
1091
1120
|
}
|
|
1092
|
-
type BankAccountOnboardingWidgetProps = WidgetProviderProps & Omit<BankAccountOnboardingWidgetInnerProps, 'initialApplicationId' | 'initialBoundAuthEpoch' | 'initialBusinessDetails' | 'initialPersonalDetails' | 'initialAdditionalOwners' | 'onEditableDraftChange'> & {
|
|
1121
|
+
type BankAccountOnboardingWidgetProps = WidgetProviderProps & Omit<BankAccountOnboardingWidgetInnerProps, 'initialApplicationId' | 'initialBoundAuthEpoch' | 'initialBusinessDetails' | 'initialPersonalDetails' | 'initialAdditionalOwners' | 'onEditableDraftChange' | 'onApplicationDeleted'> & {
|
|
1093
1122
|
initialBusinessDetails?: Partial<HostSupplied<BusinessDetailsValues>>;
|
|
1094
1123
|
initialPersonalDetails?: Partial<HostSupplied<PersonalDetailsValues>>;
|
|
1095
1124
|
initialAdditionalOwners?: HostSuppliedOwner[];
|
|
@@ -5,7 +5,8 @@ import { ApplicationClientSecretProvider as n, useApplicationClientSecret as r }
|
|
|
5
5
|
import { useCreateApplication as i } from "./index5.js";
|
|
6
6
|
import { useUpdateApplication as a } from "./index6.js";
|
|
7
7
|
import { useSubmitApplication as o } from "./index7.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
8
|
+
import { useDeleteApplication as s } from "./index8.js";
|
|
9
|
+
import { usePollApplicationCompletion as c } from "./index9.js";
|
|
10
|
+
import { useResumableBankAccountApplication as l } from "./index11.js";
|
|
11
|
+
import { useStartedBankAccountApplication as u } from "./index12.js";
|
|
12
|
+
export { n as ApplicationClientSecretProvider, e as OnboardingSuppressionReason, r as useApplicationClientSecret, i as useCreateApplication, s as useDeleteApplication, t as useOrganizationOnboardingSuppression, c as usePollApplicationCompletion, l as useResumableBankAccountApplication, u as useStartedBankAccountApplication, o as useSubmitApplication, a as useUpdateApplication };
|
|
@@ -1,35 +1,6 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { applicationStatusQueryOptions as e } from "../../../shared/data-access/dist/lib/applicationStatusQueryOptions.js";
|
|
6
|
-
import { useEmbedApi as t } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
7
|
-
import "../../../shared/data-access/dist/index.js";
|
|
8
|
-
import { hasFreshAnswer as n } from "./index9.js";
|
|
9
|
-
import { useQuery as r } from "@tanstack/react-query";
|
|
10
1
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index10.js
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return e.find((e) => e.product === a && e.ownership === o && e.status === i && !!e.applicationId && !!e.clientSecret);
|
|
14
|
-
}
|
|
15
|
-
function c(e) {
|
|
16
|
-
return e.filter((e) => e.product === a && e.ownership === o).map((e) => e.applicationId).filter((e) => !!e);
|
|
17
|
-
}
|
|
18
|
-
function l() {
|
|
19
|
-
let { client: i, widgetToken: a, authEpoch: o } = t(), l = !!a, u = r({
|
|
20
|
-
...e({
|
|
21
|
-
client: i,
|
|
22
|
-
widgetToken: a,
|
|
23
|
-
authEpoch: o
|
|
24
|
-
}),
|
|
25
|
-
enabled: l
|
|
26
|
-
}), d = l && n(u), f = d && !u.isError ? u.data?.applications ?? null : null, p = f ? s(f) : void 0;
|
|
27
|
-
return {
|
|
28
|
-
applicationId: p?.applicationId ?? null,
|
|
29
|
-
clientSecret: p?.clientSecret ?? null,
|
|
30
|
-
isResolved: d,
|
|
31
|
-
ownApplicationIds: f ? c(f) : null
|
|
32
|
-
};
|
|
2
|
+
function e(e) {
|
|
3
|
+
return (e.isSuccess || e.isError) && !e.isFetching;
|
|
33
4
|
}
|
|
34
5
|
//#endregion
|
|
35
|
-
export {
|
|
6
|
+
export { e as hasFreshAnswer };
|
|
@@ -2,43 +2,34 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { useEmbedApi as n } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
8
|
-
import { optionalOrganizationHeaders as r } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
5
|
+
import { applicationStatusQueryOptions as e } from "../../../shared/data-access/dist/lib/applicationStatusQueryOptions.js";
|
|
6
|
+
import { useEmbedApi as t } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
9
7
|
import "../../../shared/data-access/dist/index.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { useMemo as o } from "react";
|
|
13
|
-
import { useQuery as s } from "@tanstack/react-query";
|
|
8
|
+
import { hasFreshAnswer as n } from "./index10.js";
|
|
9
|
+
import { useQuery as r } from "@tanstack/react-query";
|
|
14
10
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index11.js
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
let
|
|
24
|
-
...
|
|
25
|
-
client:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}), {
|
|
29
|
-
authEpoch: m,
|
|
30
|
-
organizationPending: h
|
|
11
|
+
var i = "DRAFT", a = "BANK_ACCOUNT", o = "STARTED_BY_YOU";
|
|
12
|
+
function s(e) {
|
|
13
|
+
return e.find((e) => e.product === a && e.ownership === o && e.status === i && !!e.applicationId && !!e.clientSecret);
|
|
14
|
+
}
|
|
15
|
+
function c(e) {
|
|
16
|
+
return e.filter((e) => e.product === a && e.ownership === o).map((e) => e.applicationId).filter((e) => !!e);
|
|
17
|
+
}
|
|
18
|
+
function l() {
|
|
19
|
+
let { client: i, widgetToken: a, authEpoch: o } = t(), l = !!a, u = r({
|
|
20
|
+
...e({
|
|
21
|
+
client: i,
|
|
22
|
+
widgetToken: a,
|
|
23
|
+
authEpoch: o
|
|
31
24
|
}),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
retry: 2,
|
|
35
|
-
retryDelay: 300
|
|
36
|
-
});
|
|
25
|
+
enabled: l
|
|
26
|
+
}), d = l && n(u), f = d && !u.isError ? u.data?.applications ?? null : null, p = f ? s(f) : void 0;
|
|
37
27
|
return {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
applicationId: p?.applicationId ?? null,
|
|
29
|
+
clientSecret: p?.clientSecret ?? null,
|
|
30
|
+
isResolved: d,
|
|
31
|
+
ownApplicationIds: f ? c(f) : null
|
|
41
32
|
};
|
|
42
33
|
}
|
|
43
34
|
//#endregion
|
|
44
|
-
export { l as
|
|
35
|
+
export { l as useResumableBankAccountApplication };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { getBankAccountApplicationOptions 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 { optionalOrganizationHeaders as r } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
9
|
+
import "../../../shared/data-access/dist/index.js";
|
|
10
|
+
import { useInstallApplicationClientSecret as i } from "./index3.js";
|
|
11
|
+
import { hasFreshAnswer as a } from "./index10.js";
|
|
12
|
+
import { useMemo as o } from "react";
|
|
13
|
+
import { useQuery as s } from "@tanstack/react-query";
|
|
14
|
+
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index12.js
|
|
15
|
+
var c = (e, t) => (n, r) => {
|
|
16
|
+
if (n === void 0 || r === void 0) return;
|
|
17
|
+
let [i] = r.queryKey;
|
|
18
|
+
if (i !== void 0 && i.baseUrl === e && i.path?.id === t) return n;
|
|
19
|
+
};
|
|
20
|
+
function l(l, u) {
|
|
21
|
+
let { client: d, organizationId: f, widgetToken: p, authEpoch: m, organizationPending: h } = n();
|
|
22
|
+
i(l, u);
|
|
23
|
+
let g = !!(p && l && u), _ = d.getConfig().baseUrl, v = o(() => c(_, l), [_, l]), y = s({
|
|
24
|
+
...t(e({
|
|
25
|
+
client: d,
|
|
26
|
+
path: { id: l ?? "" },
|
|
27
|
+
headers: r(f)
|
|
28
|
+
}), {
|
|
29
|
+
authEpoch: m,
|
|
30
|
+
organizationPending: h
|
|
31
|
+
}),
|
|
32
|
+
placeholderData: v,
|
|
33
|
+
enabled: g,
|
|
34
|
+
retry: 2,
|
|
35
|
+
retryDelay: 300
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
application: y.data ?? null,
|
|
39
|
+
isResolved: !g || a(y),
|
|
40
|
+
isUnavailable: g && y.isError
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { l as useStartedBankAccountApplication };
|
|
@@ -2,45 +2,22 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
5
|
+
import { deleteBankAccountApplicationMutation as e } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
6
6
|
import { useEmbedApi as t } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
7
|
+
import { optionalOrganizationHeaders as n } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
7
8
|
import "../../../shared/data-access/dist/index.js";
|
|
8
|
-
import {
|
|
9
|
+
import { refreshApplicationStatus as r } from "./index4.js";
|
|
10
|
+
import { useMutation as i } from "@tanstack/react-query";
|
|
9
11
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index8.js
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
clearTimeout(a), r(new DOMException("Aborted", "AbortError"));
|
|
19
|
-
}, a = setTimeout(() => {
|
|
20
|
-
t?.removeEventListener("abort", i), n();
|
|
21
|
-
}, e);
|
|
22
|
-
t?.addEventListener("abort", i, { once: !0 });
|
|
12
|
+
function a() {
|
|
13
|
+
let { client: a, organizationId: o } = t();
|
|
14
|
+
return i({
|
|
15
|
+
...e({
|
|
16
|
+
client: a,
|
|
17
|
+
headers: n(o)
|
|
18
|
+
}),
|
|
19
|
+
onSuccess: () => r(a)
|
|
23
20
|
});
|
|
24
21
|
}
|
|
25
|
-
function c() {
|
|
26
|
-
let { client: c } = t();
|
|
27
|
-
return n(async (t, n = {}) => {
|
|
28
|
-
let { signal: l } = n, u = !1;
|
|
29
|
-
for (let n = 0; n < i; n++) {
|
|
30
|
-
if (l?.aborted) throw new DOMException("Aborted", "AbortError");
|
|
31
|
-
try {
|
|
32
|
-
let n = await e({
|
|
33
|
-
client: c,
|
|
34
|
-
signal: l
|
|
35
|
-
});
|
|
36
|
-
if (u = !0, n.data?.applications.some((e) => e.product === o && e.applicationId === t && e.status === a)) return { status: "complete" };
|
|
37
|
-
} catch (e) {
|
|
38
|
-
if (e instanceof DOMException && e.name === "AbortError") throw e;
|
|
39
|
-
}
|
|
40
|
-
n < 5 && await s(r, l);
|
|
41
|
-
}
|
|
42
|
-
return u ? { status: "timeout" } : { status: "error" };
|
|
43
|
-
}, [c]);
|
|
44
|
-
}
|
|
45
22
|
//#endregion
|
|
46
|
-
export {
|
|
23
|
+
export { a as useDeleteApplication };
|
|
@@ -1,6 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { getApplicationStatus as e } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
|
|
6
|
+
import { useEmbedApi as t } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
7
|
+
import "../../../shared/data-access/dist/index.js";
|
|
8
|
+
import { useCallback as n } from "react";
|
|
1
9
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index9.js
|
|
2
|
-
|
|
3
|
-
|
|
10
|
+
var r = 1e3, i = 6, a = "COMPLETE", o = "BANK_ACCOUNT";
|
|
11
|
+
function s(e, t) {
|
|
12
|
+
return new Promise((n, r) => {
|
|
13
|
+
if (t?.aborted) {
|
|
14
|
+
r(new DOMException("Aborted", "AbortError"));
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
let i = () => {
|
|
18
|
+
clearTimeout(a), r(new DOMException("Aborted", "AbortError"));
|
|
19
|
+
}, a = setTimeout(() => {
|
|
20
|
+
t?.removeEventListener("abort", i), n();
|
|
21
|
+
}, e);
|
|
22
|
+
t?.addEventListener("abort", i, { once: !0 });
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function c() {
|
|
26
|
+
let { client: c } = t();
|
|
27
|
+
return n(async (t, n = {}) => {
|
|
28
|
+
let { signal: l } = n, u = !1;
|
|
29
|
+
for (let n = 0; n < i; n++) {
|
|
30
|
+
if (l?.aborted) throw new DOMException("Aborted", "AbortError");
|
|
31
|
+
try {
|
|
32
|
+
let n = await e({
|
|
33
|
+
client: c,
|
|
34
|
+
signal: l
|
|
35
|
+
});
|
|
36
|
+
if (u = !0, n.data?.applications.some((e) => e.product === o && e.applicationId === t && e.status === a)) return { status: "complete" };
|
|
37
|
+
} catch (e) {
|
|
38
|
+
if (e instanceof DOMException && e.name === "AbortError") throw e;
|
|
39
|
+
}
|
|
40
|
+
n < 5 && await s(r, l);
|
|
41
|
+
}
|
|
42
|
+
return u ? { status: "timeout" } : { status: "error" };
|
|
43
|
+
}, [c]);
|
|
4
44
|
}
|
|
5
45
|
//#endregion
|
|
6
|
-
export {
|
|
46
|
+
export { c as usePollApplicationCompletion };
|
|
@@ -5,6 +5,7 @@ var e = {
|
|
|
5
5
|
shellBack: "onboarding-shell-back",
|
|
6
6
|
shellCancel: "onboarding-shell-cancel",
|
|
7
7
|
shellSaveAndClose: "onboarding-shell-save-and-close",
|
|
8
|
+
shellDelete: "onboarding-shell-delete",
|
|
8
9
|
shellNext: "onboarding-shell-next",
|
|
9
10
|
shellScrollRegion: "onboarding-shell-scroll-region",
|
|
10
11
|
shellScrollFade: "onboarding-shell-scroll-fade",
|
|
@@ -14,6 +15,9 @@ var e = {
|
|
|
14
15
|
unsavedDialogSaveDraft: "unsaved-application-dialog-save-draft",
|
|
15
16
|
unsavedDialogDiscard: "unsaved-application-dialog-discard",
|
|
16
17
|
unsavedDialogClose: "unsaved-application-dialog-close",
|
|
18
|
+
deleteDialog: "delete-application-dialog",
|
|
19
|
+
deleteDialogConfirm: "delete-application-dialog-confirm",
|
|
20
|
+
deleteDialogCancel: "delete-application-dialog-cancel",
|
|
17
21
|
businessDetailsPanel: "business-details-panel",
|
|
18
22
|
businessDetailsEditButton: "business-details-edit-button",
|
|
19
23
|
businessDetailsSummary: "business-details-summary",
|
|
@@ -13,11 +13,14 @@ var t = {
|
|
|
13
13
|
additionalOwners: {},
|
|
14
14
|
result: e,
|
|
15
15
|
unsavedApplicationDialog: {},
|
|
16
|
+
deleteApplicationDialog: {},
|
|
16
17
|
back: "Back",
|
|
17
18
|
cancel: "Cancel",
|
|
18
19
|
next: "Next",
|
|
19
20
|
submit: "Submit application",
|
|
20
21
|
saveAndClose: "Save and close",
|
|
22
|
+
deleteApplication: "Cancel and delete application",
|
|
23
|
+
applicationDeletedToast: "Application deleted.",
|
|
21
24
|
applicationSavedToast: "Application saved. You can continue later.",
|
|
22
25
|
businessReviewTitle: "Review your business details",
|
|
23
26
|
businessReviewSubtitle: "Take a moment to make sure your business information is correct.",
|