@tesouro/embedded-components-react 0.7.70 → 0.7.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -11
- package/dist/index.css +15 -6
- package/dist/index.d.ts +64 -2
- package/dist/lib/LinkedAccountsWidget.d.ts +9 -0
- package/dist/lib/TransfersWidget.d.ts +55 -2
- package/dist/lib/WidgetSuite.d.ts +63 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/LinkedAccountsWidget.js +6 -4
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js +199 -182
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/TransfersWidgetFeature.js +4 -3
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/TransfersWidgetInner.js +99 -108
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/testIds.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/transferViews.js +135 -0
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/useTransferMoneyModalController.js +140 -153
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransferAccountTile.js +15 -0
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransferDetailSheet.js +111 -0
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransferStatusBadge.js +18 -0
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransfersWidget.js +181 -126
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/labels.js +33 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/lib/WidgetSuite/sections/TransfersSection.js +16 -8
- package/dist/packages/shared-ui-shadcn/dist/index.js +328 -327
- package/package.json +1 -1
|
@@ -3,149 +3,140 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { TESOURO_NEW_EMBEDDED_BANK_ACCOUNT_CREATED_SUCCESS_EVENT as e, TESOURO_NEW_EXTERNAL_BANK_ACCOUNT_LINKED_SUCCESS_EVENT as t } from "../../../../../shared/util/dist/lib/widgetDomEvents.js";
|
|
6
|
-
import { isOrganizationOnItsWay as
|
|
7
|
-
import { useEmbedApi as
|
|
8
|
-
import { Scope as
|
|
6
|
+
import { isOrganizationOnItsWay as ee } from "../../../../../shared/data-access/dist/lib/organizationStatus.js";
|
|
7
|
+
import { useEmbedApi as n } from "../../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
8
|
+
import { Scope as r } from "../../../../../shared/data-access/dist/lib/scopes.js";
|
|
9
9
|
import "../../../../../shared/data-access/dist/index.js";
|
|
10
|
-
import { useAnalyticsTrack as
|
|
11
|
-
import { useWidgetConfig as
|
|
10
|
+
import { useAnalyticsTrack as te } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
11
|
+
import { useWidgetConfig as ne } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
12
12
|
import "../../../../../shared/feature/dist/index.js";
|
|
13
|
-
import { DEFAULT_FEATURE_LABELS as
|
|
14
|
-
import { TRANSFERS_ANALYTICS_EVENTS as
|
|
15
|
-
import { isPaginatedAccountsQueryInFlight as
|
|
16
|
-
import { useTransferBankAccountsQuery as
|
|
17
|
-
import { useTransferExternalAccountsQuery as
|
|
18
|
-
import { useOrganizationTransfersQuery as
|
|
13
|
+
import { DEFAULT_FEATURE_LABELS as i } from "./featureLabels.js";
|
|
14
|
+
import { TRANSFERS_ANALYTICS_EVENTS as re } from "../analytics/events.js";
|
|
15
|
+
import { isPaginatedAccountsQueryInFlight as a } from "../../../../data-access/dist/index2.js";
|
|
16
|
+
import { useTransferBankAccountsQuery as ie } from "../../../../data-access/dist/index4.js";
|
|
17
|
+
import { useTransferExternalAccountsQuery as ae } from "../../../../data-access/dist/index5.js";
|
|
18
|
+
import { useOrganizationTransfersQuery as oe } from "../../../../data-access/dist/index6.js";
|
|
19
19
|
import "../../../../data-access/dist/index.js";
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
20
|
+
import { useTransferMoneyModalController as se } from "./useTransferMoneyModalController.js";
|
|
21
|
+
import { buildAccountDirectory as ce, mapTransferToDetailView as o, mapTransferToRowView as s } from "./transferViews.js";
|
|
22
|
+
import { transfersWidgetTestIds as c } from "./testIds.js";
|
|
23
|
+
import { TRANSFERS_PAGE_SIZE_OPTIONS as le, useTransfersPageState as ue } from "./useTransfersPageState.js";
|
|
24
|
+
import { TRANSFERS_WIDGET_LABELS_EN as de } from "../../../../ui/dist/lib/TransfersWidget/labels.js";
|
|
25
|
+
import { TransfersWidget as fe } from "../../../../ui/dist/lib/TransfersWidget/TransfersWidget.js";
|
|
25
26
|
import "../../../../ui/dist/index.js";
|
|
26
|
-
import { useCallback as
|
|
27
|
-
import { jsx as
|
|
27
|
+
import { useCallback as pe, useEffect as l, useMemo as u, useState as d } from "react";
|
|
28
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
28
29
|
//#region ../../libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/TransfersWidgetInner.js
|
|
29
|
-
var
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
function y({ labels: e, featureLabels: t, isTransferMoneyOpen: y, defaultIsTransferMoneyOpen: le, onTransferMoneyOpenChange: ue }) {
|
|
34
|
-
let b = {
|
|
35
|
-
...o,
|
|
30
|
+
var p = [r.TransferWriteOrg, r.BankAccountReadOrg], m = [t, e];
|
|
31
|
+
function h({ labels: e, featureLabels: t, isTransferMoneyOpen: h, defaultIsTransferMoneyOpen: me, onTransferMoneyOpenChange: he, onLinkAccountClick: g }) {
|
|
32
|
+
let _ = {
|
|
33
|
+
...i,
|
|
36
34
|
...t
|
|
37
|
-
},
|
|
38
|
-
...
|
|
35
|
+
}, v = {
|
|
36
|
+
...de,
|
|
39
37
|
...e,
|
|
40
38
|
...t?.routeSeparator === void 0 ? {} : { listAccountsSeparator: t.routeSeparator }
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}, [
|
|
45
|
-
let
|
|
46
|
-
organizationId:
|
|
47
|
-
userId:
|
|
48
|
-
}), { data:
|
|
49
|
-
limit:
|
|
50
|
-
pagination_token:
|
|
51
|
-
}),
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
e.set(t.id, `${r} ···${n}`);
|
|
60
|
-
}
|
|
61
|
-
return e;
|
|
62
|
-
}, [
|
|
63
|
-
V,
|
|
64
|
-
x.accountFallbackName,
|
|
65
|
-
H
|
|
66
|
-
]), W = k?.data, G = p(() => (W ?? []).map((e) => ne(e, U, x, b)), [
|
|
67
|
-
U,
|
|
68
|
-
b,
|
|
69
|
-
x,
|
|
70
|
-
W
|
|
71
|
-
]), K = k?.nextPaginationToken ?? void 0, q = k?.prevPaginationToken ?? void 0, [J, ge] = m(O);
|
|
72
|
-
!M && (J.pageIndex !== O.pageIndex || J.pageSize !== O.pageSize) && ge(O);
|
|
73
|
-
let Y = J.pageIndex * J.pageSize, _e = {
|
|
74
|
-
pageSize: O.pageSize,
|
|
75
|
-
pageSizeOptions: ie,
|
|
76
|
-
rangeLabel: `${b.viewingRangeLabel} ${G.length === 0 ? "0-0" : `${Y + 1}-${Y + G.length}`}`,
|
|
39
|
+
}, y = te(), { initResponse: b } = ne(), { organizationId: ge, organizationStatus: _e } = n(), ve = ee(_e);
|
|
40
|
+
l(() => {
|
|
41
|
+
y(re.Mounted);
|
|
42
|
+
}, [y]);
|
|
43
|
+
let x = b?.scopes ?? [], S = x.includes(r.ExternalBankAccountReadOrg), ye = x.includes(r.PaymentRailAch), C = S && ye, w = p.every((e) => x.includes(e)), T = ue({
|
|
44
|
+
organizationId: ge,
|
|
45
|
+
userId: b?.userId
|
|
46
|
+
}), { data: E, isLoading: D, isError: O, isPlaceholderData: k, refetch: A } = oe({
|
|
47
|
+
limit: T.pageSize,
|
|
48
|
+
pagination_token: T.paginationToken
|
|
49
|
+
}), j = ie(), { data: M, isError: N, refetch: P } = j, F = ae({ enabled: S }), { data: I, isError: be, refetch: L } = F, R = M?.data ?? [], z = u(() => C ? (I?.data ?? []).filter((e) => e.verificationStatus === "VERIFIED" && e.accountStatus === "ACTIVE") : [], [C, I?.data]), xe = I?.data, B = ce(R, xe ?? [], v), V = E?.data, H = (V ?? []).map((e) => s(e, B, v, _)), [Se, U] = d(), W = `${T.pageSize}:${T.paginationToken ?? ""}`, [Ce, we] = d(W);
|
|
50
|
+
W !== Ce && (we(W), U(void 0));
|
|
51
|
+
let G = V?.find((e) => e.id === Se), Te = G ? o(G, B, v, _) : void 0, K = E?.nextPaginationToken ?? void 0, q = E?.prevPaginationToken ?? void 0, [J, Ee] = d(T);
|
|
52
|
+
!k && (J.pageIndex !== T.pageIndex || J.pageSize !== T.pageSize) && Ee(T);
|
|
53
|
+
let Y = J.pageIndex * J.pageSize, De = {
|
|
54
|
+
pageSize: T.pageSize,
|
|
55
|
+
pageSizeOptions: le,
|
|
56
|
+
rangeLabel: `${_.viewingRangeLabel} ${H.length === 0 ? "0-0" : `${Y + 1}-${Y + H.length}`}`,
|
|
77
57
|
isPreviousDisabled: !q,
|
|
78
58
|
isNextDisabled: !K,
|
|
79
|
-
isDisabled:
|
|
80
|
-
onPageSizeChange:
|
|
59
|
+
isDisabled: k,
|
|
60
|
+
onPageSizeChange: T.changePageSize,
|
|
81
61
|
onPreviousPageClick: () => {
|
|
82
|
-
q &&
|
|
62
|
+
q && T.goToPreviousPage(q);
|
|
83
63
|
},
|
|
84
64
|
onNextPageClick: () => {
|
|
85
|
-
K &&
|
|
65
|
+
K && T.goToNextPage(K);
|
|
86
66
|
}
|
|
87
|
-
}, X =
|
|
88
|
-
|
|
67
|
+
}, X = pe(() => {
|
|
68
|
+
A(), P(), S && L();
|
|
89
69
|
}, [
|
|
90
|
-
|
|
70
|
+
S,
|
|
71
|
+
P,
|
|
91
72
|
L,
|
|
92
|
-
|
|
93
|
-
N
|
|
73
|
+
A
|
|
94
74
|
]);
|
|
95
|
-
|
|
75
|
+
l(() => {
|
|
96
76
|
let e = () => {
|
|
97
77
|
X();
|
|
98
78
|
};
|
|
99
|
-
for (let t of
|
|
79
|
+
for (let t of m) window.addEventListener(t, e);
|
|
100
80
|
return () => {
|
|
101
|
-
for (let t of
|
|
81
|
+
for (let t of m) window.removeEventListener(t, e);
|
|
102
82
|
};
|
|
103
83
|
}, [X]);
|
|
104
|
-
let { modalProps:
|
|
105
|
-
labels:
|
|
106
|
-
featureLabels:
|
|
107
|
-
embeddedBankAccounts:
|
|
108
|
-
verifiedExternalBankAccounts:
|
|
109
|
-
track:
|
|
110
|
-
isTransferMoneyOpen:
|
|
111
|
-
defaultIsTransferMoneyOpen:
|
|
112
|
-
onTransferMoneyOpenChange:
|
|
113
|
-
}),
|
|
114
|
-
return /* @__PURE__ */
|
|
115
|
-
transferRows:
|
|
116
|
-
pagination:
|
|
117
|
-
|
|
84
|
+
let { modalProps: Z, openModal: Oe } = se({
|
|
85
|
+
labels: v,
|
|
86
|
+
featureLabels: _,
|
|
87
|
+
embeddedBankAccounts: R,
|
|
88
|
+
verifiedExternalBankAccounts: z,
|
|
89
|
+
track: y,
|
|
90
|
+
isTransferMoneyOpen: h,
|
|
91
|
+
defaultIsTransferMoneyOpen: me,
|
|
92
|
+
onTransferMoneyOpenChange: he
|
|
93
|
+
}), ke = a(j), Ae = S && a(F), je = ve && !M || D || ke || Ae, Q = O || N || S && be, Me = R.length + z.length, $ = !(R.length > 0) || Me <= 1;
|
|
94
|
+
return /* @__PURE__ */ f(fe, {
|
|
95
|
+
transferRows: H,
|
|
96
|
+
pagination: De,
|
|
97
|
+
selectedRowKey: G?.id,
|
|
98
|
+
onRowClick: U,
|
|
99
|
+
transferDetail: Te,
|
|
100
|
+
onTransferDetailClose: () => U(void 0),
|
|
101
|
+
onLinkAccountClick: g ? () => {
|
|
102
|
+
U(void 0), g();
|
|
103
|
+
} : void 0,
|
|
104
|
+
isLoading: je,
|
|
118
105
|
isError: Q,
|
|
119
106
|
onRetry: Q ? () => void X() : void 0,
|
|
120
|
-
showTransferMoneyCta:
|
|
107
|
+
showTransferMoneyCta: w,
|
|
121
108
|
isTransferMoneyCtaDisabled: $,
|
|
122
|
-
onTransferMoneyClick:
|
|
109
|
+
onTransferMoneyClick: w && !$ ? () => Oe() : void 0,
|
|
123
110
|
transferMoneyModal: {
|
|
124
|
-
...
|
|
111
|
+
...Z,
|
|
125
112
|
testIds: {
|
|
126
|
-
root:
|
|
127
|
-
closeButton:
|
|
128
|
-
fromAccountTrigger:
|
|
129
|
-
toAccountTrigger:
|
|
130
|
-
accountsConfirm:
|
|
131
|
-
amountInput:
|
|
113
|
+
root: c.modal,
|
|
114
|
+
closeButton: c.modalCloseButton,
|
|
115
|
+
fromAccountTrigger: c.modalFromAccountTrigger,
|
|
116
|
+
toAccountTrigger: c.modalToAccountTrigger,
|
|
117
|
+
accountsConfirm: c.modalAccountsConfirmButton,
|
|
118
|
+
amountInput: c.modalAmountInput,
|
|
132
119
|
reviewStep: {
|
|
133
|
-
confirm:
|
|
134
|
-
goBack:
|
|
120
|
+
confirm: c.modalConfirmTransferButton,
|
|
121
|
+
goBack: c.modalGoBackButton
|
|
135
122
|
},
|
|
136
|
-
resultStep: { backToTransfers:
|
|
123
|
+
resultStep: { backToTransfers: c.modalBackToTransfersButton }
|
|
137
124
|
}
|
|
138
125
|
},
|
|
139
126
|
labels: e,
|
|
140
127
|
testIds: {
|
|
141
|
-
transferMoneyButton:
|
|
142
|
-
skeleton:
|
|
143
|
-
error:
|
|
144
|
-
retry:
|
|
145
|
-
empty:
|
|
146
|
-
transferRow:
|
|
128
|
+
transferMoneyButton: c.transferMoneyButton,
|
|
129
|
+
skeleton: c.skeleton,
|
|
130
|
+
error: c.error,
|
|
131
|
+
retry: c.retry,
|
|
132
|
+
empty: c.empty,
|
|
133
|
+
transferRow: c.transferRow,
|
|
134
|
+
transferDetail: {
|
|
135
|
+
root: c.transferDetail,
|
|
136
|
+
returnedBanner: c.transferDetailReturnedBanner
|
|
137
|
+
}
|
|
147
138
|
}
|
|
148
139
|
});
|
|
149
140
|
}
|
|
150
141
|
//#endregion
|
|
151
|
-
export {
|
|
142
|
+
export { h as TransfersWidgetInner };
|
|
@@ -5,6 +5,8 @@ var e = {
|
|
|
5
5
|
retry: "transfers-widget-retry",
|
|
6
6
|
empty: "transfers-widget-empty",
|
|
7
7
|
transferRow: "embedded-banking-transfer-row",
|
|
8
|
+
transferDetail: "transfers-widget-transfer-detail",
|
|
9
|
+
transferDetailReturnedBanner: "transfers-widget-transfer-detail-returned-banner",
|
|
8
10
|
transferMoneyButton: "embedded-banking-transfer-money-button",
|
|
9
11
|
modal: "embedded-banking-transfer-money-modal",
|
|
10
12
|
modalCloseButton: "embedded-banking-transfer-money-modal-close-button",
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { formatLabel as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { amountOutputToMajorUnits as t } from "../../../../../shared/util/dist/lib/amountOutputToMajorUnits.js";
|
|
3
|
+
import { formatMoneyExact as n } from "../../../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
4
|
+
//#region ../../libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/transferViews.js
|
|
5
|
+
function r(e, t, n) {
|
|
6
|
+
let r = /* @__PURE__ */ new Map();
|
|
7
|
+
for (let t of e) r.set(t.id, {
|
|
8
|
+
kind: "internal",
|
|
9
|
+
name: t.nickname?.trim() || n.accountFallbackName,
|
|
10
|
+
last4: t.accountNumber.slice(-4)
|
|
11
|
+
});
|
|
12
|
+
for (let e of t) r.set(e.id, {
|
|
13
|
+
kind: "external",
|
|
14
|
+
name: e.nickname?.trim() || n.externalAccountFallbackName,
|
|
15
|
+
last4: e.accountNumber.slice(-4)
|
|
16
|
+
});
|
|
17
|
+
return r;
|
|
18
|
+
}
|
|
19
|
+
function i(t, n, r) {
|
|
20
|
+
let i = n.get(t.id), a = i?.kind ?? "external";
|
|
21
|
+
return {
|
|
22
|
+
kind: a,
|
|
23
|
+
kindLabel: a === "internal" ? r.accountKindInternal : r.accountKindExternal,
|
|
24
|
+
name: i?.name ?? (t.nickname?.trim() || r.externalAccountFallbackName),
|
|
25
|
+
...i && { maskLabel: e(r.accountMaskTemplate, { last4: i.last4 }) },
|
|
26
|
+
...a === "external" && { badgeLabel: r.externalAccountBadge }
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
var a = (e) => e.maskLabel ? `${e.name} ${e.maskLabel}` : e.name, o = {
|
|
30
|
+
COMPLETED: "success",
|
|
31
|
+
PENDING: "warning",
|
|
32
|
+
FAILED: "destructive",
|
|
33
|
+
RETURNED: "returned"
|
|
34
|
+
};
|
|
35
|
+
function s(e, t) {
|
|
36
|
+
return {
|
|
37
|
+
COMPLETED: t.rowStatusCompleted,
|
|
38
|
+
PENDING: t.rowStatusPending,
|
|
39
|
+
FAILED: t.rowStatusFailed,
|
|
40
|
+
RETURNED: t.rowStatusReturned
|
|
41
|
+
}[e] ?? t.rowStatusPending;
|
|
42
|
+
}
|
|
43
|
+
function c(e, t) {
|
|
44
|
+
switch (e) {
|
|
45
|
+
case "ACCOUNT_CLOSED": return {
|
|
46
|
+
short: t.returnShortReasonAccountClosed,
|
|
47
|
+
title: t.returnedTitleAccountClosed,
|
|
48
|
+
explanation: t.returnedExplanationAccountClosed
|
|
49
|
+
};
|
|
50
|
+
case "INVALID_ACCOUNT_DETAILS": return {
|
|
51
|
+
short: t.returnShortReasonInvalidAccountDetails,
|
|
52
|
+
title: t.returnedTitleInvalidAccountDetails,
|
|
53
|
+
explanation: t.returnedExplanationInvalidAccountDetails
|
|
54
|
+
};
|
|
55
|
+
case "ACCOUNT_CANNOT_RECEIVE": return {
|
|
56
|
+
short: t.returnShortReasonAccountCannotReceive,
|
|
57
|
+
title: t.returnedTitleAccountCannotReceive,
|
|
58
|
+
explanation: t.returnedExplanationAccountCannotReceive
|
|
59
|
+
};
|
|
60
|
+
case "REFUSED_BY_RECEIVER": return {
|
|
61
|
+
short: t.returnShortReasonRefusedByReceiver,
|
|
62
|
+
title: t.returnedTitleRefusedByReceiver,
|
|
63
|
+
explanation: t.returnedExplanationRefusedByReceiver
|
|
64
|
+
};
|
|
65
|
+
default: return {
|
|
66
|
+
short: void 0,
|
|
67
|
+
title: t.returnedTitleGeneric,
|
|
68
|
+
explanation: t.returnedExplanationGeneric
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function l(e, t, n) {
|
|
73
|
+
let r = new Date(e);
|
|
74
|
+
return Number.isNaN(r.getTime()) ? n : new Intl.DateTimeFormat(void 0, t).format(r);
|
|
75
|
+
}
|
|
76
|
+
function u(e, r) {
|
|
77
|
+
let i = e.amount?.value;
|
|
78
|
+
return i == null || !Number.isFinite(Number(i)) ? r.unavailableLabel : n(t(e.amount), {
|
|
79
|
+
currencyCode: e.amount.currencyCode,
|
|
80
|
+
includeSpaceAfterCurrencySymbol: !1
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function d(e, t, n, r) {
|
|
84
|
+
return {
|
|
85
|
+
from: i(e.fromAccount, t, n),
|
|
86
|
+
to: i(e.toAccount, t, n),
|
|
87
|
+
statusLabel: s(e.status, n),
|
|
88
|
+
statusTone: o[e.status] ?? "warning",
|
|
89
|
+
amountLabel: u(e, r),
|
|
90
|
+
isAmountStruckThrough: e.status === "FAILED"
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function f(t, n, r, i) {
|
|
94
|
+
let a = d(t, n, r, i);
|
|
95
|
+
return {
|
|
96
|
+
...a,
|
|
97
|
+
rowKey: t.id,
|
|
98
|
+
dateLabel: l(t.createdDateTime, { dateStyle: "medium" }, i.unavailableLabel),
|
|
99
|
+
statusReasonLabel: t.status === "RETURNED" ? c(t.returnCategory, r).short : void 0,
|
|
100
|
+
ariaLabel: e(r.rowAriaLabel, {
|
|
101
|
+
amount: a.amountLabel,
|
|
102
|
+
from: a.from.name,
|
|
103
|
+
to: a.to.name
|
|
104
|
+
})
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function p(t, n, r, i) {
|
|
108
|
+
let o = d(t, n, r, i), s = {
|
|
109
|
+
...o,
|
|
110
|
+
initiatedByLabel: t.initiatedBy,
|
|
111
|
+
initiatedOnLabel: l(t.createdDateTime, {
|
|
112
|
+
month: "short",
|
|
113
|
+
day: "numeric",
|
|
114
|
+
year: "numeric",
|
|
115
|
+
hour: "numeric",
|
|
116
|
+
minute: "2-digit",
|
|
117
|
+
timeZoneName: "short"
|
|
118
|
+
}, i.unavailableLabel)
|
|
119
|
+
};
|
|
120
|
+
if (t.status !== "RETURNED") return s;
|
|
121
|
+
let u = c(t.returnCategory, r), f = o.from.kind === "external" ? o.from : o.to, p = o.from.kind === "internal" ? ` ${e(r.returnedRefundSentence, {
|
|
122
|
+
amount: o.amountLabel,
|
|
123
|
+
account: a(o.from)
|
|
124
|
+
})}` : "";
|
|
125
|
+
return {
|
|
126
|
+
...s,
|
|
127
|
+
returnedBanner: {
|
|
128
|
+
title: u.title,
|
|
129
|
+
description: `${u.explanation}${p}`,
|
|
130
|
+
nextStep: e(r.returnedPausedSentence, { account: a(f) })
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
export { r as buildAccountDirectory, p as mapTransferToDetailView, f as mapTransferToRowView };
|