@mx-cartographer/experiences 8.1.5 → 8.1.7
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/CHANGELOG.md +10 -0
- package/dist/AccountDetailsHeader-D8NIfmO8.mjs +95 -0
- package/dist/{AccountFields-nrrEXd46.mjs → AccountFields-BWmpVsS3.mjs} +51 -51
- package/dist/AccountListItem-DSuv36PF.mjs +95 -0
- package/dist/EmbeddedCard-BqVpA1Jn.mjs +811 -0
- package/dist/{ManageIncome-Deq2AZEM.mjs → ManageIncome-n1ueMTrW.mjs} +2 -2
- package/dist/{RecurringSettings-B8KJllGX.mjs → RecurringSettings-DxsDZAp1.mjs} +1 -1
- package/dist/TransactionDetails-Bpp1FDUI.mjs +1721 -0
- package/dist/{TransactionStore-BUsP-unK.mjs → TransactionStore-DfaO_9m-.mjs} +105 -101
- package/dist/accounts/index.es.js +424 -420
- package/dist/accounts/utils/AccountFields.d.ts +2 -2
- package/dist/budgets/index.es.js +3 -3
- package/dist/cashflow/index.es.js +4 -4
- package/dist/common/index.es.js +2 -2
- package/dist/core/types/localization/TransactionsCopy.d.ts +11 -6
- package/dist/debts/index.es.js +1 -1
- package/dist/finstrong/index.es.js +14 -6
- package/dist/insights/index.es.js +2 -2
- package/dist/recurringtransactions/index.es.js +4 -4
- package/dist/spending/index.es.js +2 -2
- package/dist/transactions/components/shared/TransactionList.d.ts +0 -1
- package/dist/transactions/components/shared/transactiondetails/actions/{HideAction.d.ts → ExcludeAction.d.ts} +2 -2
- package/dist/transactions/components/shared/transactiondetails/actions/index.d.ts +1 -1
- package/dist/transactions/components/shared/transactiontable/cells/PayeeCell.d.ts +4 -1
- package/dist/transactions/index.es.js +90 -84
- package/dist/transactions/stores/TransactionStore.d.ts +2 -0
- package/dist/trends/index.es.js +2 -2
- package/package.json +1 -1
- package/dist/AccountDetailsHeader-D_a0XUkL.mjs +0 -95
- package/dist/AccountListItem-D80egD01.mjs +0 -94
- package/dist/EmbeddedCard-CBS3uUbk.mjs +0 -810
- package/dist/TransactionDetails-DLnK244l.mjs +0 -1703
|
@@ -0,0 +1,811 @@
|
|
|
1
|
+
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import C, { useMemo as q, useState as K, useEffect as J } from "react";
|
|
3
|
+
import k from "@mui/material/Box";
|
|
4
|
+
import Y from "@mui/material/Button";
|
|
5
|
+
import c from "@mui/material/Stack";
|
|
6
|
+
import { Icon as M, P as N, H3 as P, Text as x, MerchantLogo as tt, H2 as et } from "@mxenabled/mxui";
|
|
7
|
+
import { Receipt as rt, Icon as nt } from "@mxenabled/mx-icons";
|
|
8
|
+
import { L as it, O as ot, e as at } from "./exportTransactionsToCSV-B2Lp7AMl.mjs";
|
|
9
|
+
import { observer as H } from "mobx-react-lite";
|
|
10
|
+
import { useVirtualizer as st } from "@tanstack/react-virtual";
|
|
11
|
+
import lt from "@mui/material/Divider";
|
|
12
|
+
import ct from "@mui/material/List";
|
|
13
|
+
import { G as dt, h as z, u as O, g as ht, b as ut } from "./hooks-HwStH7q_.mjs";
|
|
14
|
+
import mt from "@mui/material/ListItemAvatar";
|
|
15
|
+
import pt from "@mui/material/ListItemText";
|
|
16
|
+
import { useTheme as W } from "@mui/material/styles";
|
|
17
|
+
import { T as ft } from "./Transaction-Cn5_iFm0.mjs";
|
|
18
|
+
import { f as B } from "./NumberFormatting-CyrvFgfd.mjs";
|
|
19
|
+
import { fromUnixTime as R } from "date-fns/fromUnixTime";
|
|
20
|
+
import { isSameDay as Z } from "date-fns/isSameDay";
|
|
21
|
+
import { f as gt, D as xt } from "./DateFormats-CaOj_4eI.mjs";
|
|
22
|
+
import { i as bt } from "./DateUtil-D0TO0DaZ.mjs";
|
|
23
|
+
import { L as Q } from "./Loader-CxeBwuPG.mjs";
|
|
24
|
+
import { A as yt } from "./Analytics-CzGzz_sE.mjs";
|
|
25
|
+
import _t from "@mui/material/Tab";
|
|
26
|
+
import wt from "@mui/material/Tabs";
|
|
27
|
+
import Ct from "@mui/material/IconButton";
|
|
28
|
+
import { D as Tt } from "./Drawer-XPaLYjiO.mjs";
|
|
29
|
+
import { ChartContainer as vt, ChartsReferenceLine as j, ChartsXAxis as St, BarPlot as Dt } from "@mui/x-charts";
|
|
30
|
+
import It from "@mui/material/Card";
|
|
31
|
+
const Lt = ({ message: t, tipAriaLabel: n, onDismiss: r, onAction: i, sx: o }) => {
|
|
32
|
+
const l = i || r, h = i ? "chevron_right" : "close";
|
|
33
|
+
return /* @__PURE__ */ s(
|
|
34
|
+
c,
|
|
35
|
+
{
|
|
36
|
+
sx: {
|
|
37
|
+
backgroundColor: "primary.lighter",
|
|
38
|
+
borderRadius: "8px",
|
|
39
|
+
mb: 24,
|
|
40
|
+
mt: 12,
|
|
41
|
+
p: 12,
|
|
42
|
+
mx: 24,
|
|
43
|
+
alignItems: "flex-start",
|
|
44
|
+
justifyContent: "space-between",
|
|
45
|
+
flexDirection: "row",
|
|
46
|
+
gap: 8,
|
|
47
|
+
...o
|
|
48
|
+
},
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ s(c, { sx: { flexDirection: "row", gap: 4 }, children: [
|
|
51
|
+
/* @__PURE__ */ e(M, { color: "info", fill: !0, name: "lightbulb", size: 24 }),
|
|
52
|
+
/* @__PURE__ */ e(N, { color: "primary.dark", fontWeight: 400, noWrap: !1, variant: "subtitle2", children: t })
|
|
53
|
+
] }),
|
|
54
|
+
l && /* @__PURE__ */ e(
|
|
55
|
+
Ct,
|
|
56
|
+
{
|
|
57
|
+
"aria-label": n,
|
|
58
|
+
onClick: l,
|
|
59
|
+
size: "small",
|
|
60
|
+
sx: { minHeight: 0, minWidth: 0, p: 0 },
|
|
61
|
+
children: /* @__PURE__ */ e(M, { color: "primary", fill: !0, name: h, size: 20 })
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}, kt = ({
|
|
68
|
+
ariaLabel: t,
|
|
69
|
+
beat: n,
|
|
70
|
+
chart: r,
|
|
71
|
+
children: i,
|
|
72
|
+
data: o,
|
|
73
|
+
defaultSelectedIndex: l,
|
|
74
|
+
icon: h,
|
|
75
|
+
onTabChange: b,
|
|
76
|
+
tipSection: m
|
|
77
|
+
}) => {
|
|
78
|
+
const { heading: d, subHeading: g } = n, p = q(
|
|
79
|
+
() => l ?? (o.length ? o.length - 1 : 0),
|
|
80
|
+
[l, o.length]
|
|
81
|
+
), [a, f] = K(p), y = (v, S) => {
|
|
82
|
+
b?.(S), f(S);
|
|
83
|
+
}, I = (v) => {
|
|
84
|
+
f(v);
|
|
85
|
+
};
|
|
86
|
+
return /* @__PURE__ */ s(k, { sx: { bgcolor: "background.paper", width: "100%" }, children: [
|
|
87
|
+
/* @__PURE__ */ e(wt, { "aria-label": t, onChange: y, value: a, variant: "fullWidth", children: o.map((v, S) => /* @__PURE__ */ e(
|
|
88
|
+
_t,
|
|
89
|
+
{
|
|
90
|
+
id: `transaction-details-tab-${S}`,
|
|
91
|
+
label: v.label,
|
|
92
|
+
sx: { minWidth: "auto", px: 0 }
|
|
93
|
+
},
|
|
94
|
+
`${v.label}-${S}`
|
|
95
|
+
)) }),
|
|
96
|
+
/* @__PURE__ */ e(c, { sx: { pt: 16, px: 24 }, children: (d || g) && /* @__PURE__ */ s(c, { sx: { gap: 4 }, children: [
|
|
97
|
+
d && /* @__PURE__ */ e(P, { children: d }),
|
|
98
|
+
g && /* @__PURE__ */ s(c, { sx: { alignItems: "center", flexDirection: "row", gap: 8 }, children: [
|
|
99
|
+
h,
|
|
100
|
+
/* @__PURE__ */ e(x, { textTransform: "uppercase", variant: "body2", children: g.description })
|
|
101
|
+
] })
|
|
102
|
+
] }) }),
|
|
103
|
+
r?.(a, I),
|
|
104
|
+
m && /* @__PURE__ */ e(Lt, { ...m }),
|
|
105
|
+
i?.(a)
|
|
106
|
+
] });
|
|
107
|
+
}, V = () => {
|
|
108
|
+
if (!C.useContext(dt))
|
|
109
|
+
throw new Error("useTransactionsUiStore() must be used within the GlobalDataContext");
|
|
110
|
+
return z().uiStore;
|
|
111
|
+
};
|
|
112
|
+
function At() {
|
|
113
|
+
return window.opener && window.opener.location ? window.opener.location.toString() : document.referrer;
|
|
114
|
+
}
|
|
115
|
+
function X(t) {
|
|
116
|
+
const n = At().replace(/([^:]+:\/\/[^\/]+).*/, "$1"), r = window.parent || window.opener || !1;
|
|
117
|
+
return r && r.postMessage && n ? (r.postMessage(t, n), !0) : !1;
|
|
118
|
+
}
|
|
119
|
+
function Et(t) {
|
|
120
|
+
return X({
|
|
121
|
+
metadata: { beat_guid: t },
|
|
122
|
+
mx: !0,
|
|
123
|
+
type: "mx/moneyDashboard/insightOnTransaction"
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function we(t) {
|
|
127
|
+
return X({
|
|
128
|
+
metadata: { template: t },
|
|
129
|
+
mx: !0,
|
|
130
|
+
type: "mx/pulse/client_configured_cta"
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
const $t = ({ transaction: t, onClick: n }) => {
|
|
134
|
+
const i = W().palette.mode === "dark", { associatedBeats: o } = z(), { expandedSplits: l } = V(), { transactions: h } = O(), { showInsights: b } = V(), m = t.transaction_type === ft.CREDIT, d = C.useMemo(() => o.find((a) => a.associated_transaction_guid === t.guid), [o, t]), g = (a, f) => {
|
|
135
|
+
const y = [];
|
|
136
|
+
return a.is_flagged && y.push(
|
|
137
|
+
/* @__PURE__ */ e(
|
|
138
|
+
M,
|
|
139
|
+
{
|
|
140
|
+
fill: !0,
|
|
141
|
+
name: "flag",
|
|
142
|
+
size: 16,
|
|
143
|
+
sx: { color: f ? "primary.main" : "warning.dark" }
|
|
144
|
+
},
|
|
145
|
+
"flag"
|
|
146
|
+
)
|
|
147
|
+
), a.is_hidden && y.push(/* @__PURE__ */ e(M, { name: "visibility_off", size: 16 }, "hidden")), a.has_been_split && y.push(/* @__PURE__ */ e(M, { name: "call_split", size: 16 }, "split")), y;
|
|
148
|
+
}, p = (a, f) => a.is_hidden ? f.is_excluded : a.has_been_split ? f.split_transaction_category_label : a.category || "";
|
|
149
|
+
return (
|
|
150
|
+
//TODO: implement common/components/ListItemRow.tsx
|
|
151
|
+
/* @__PURE__ */ s(
|
|
152
|
+
it,
|
|
153
|
+
{
|
|
154
|
+
clickEventName: ot.ON_TRANSACTION_LIST_ITEM_CLICK,
|
|
155
|
+
onClick: n ? () => n(t.guid) : void 0,
|
|
156
|
+
sx: t.is_hidden ? { backgroundColor: "grey.50", color: "text.secondary" } : void 0,
|
|
157
|
+
children: [
|
|
158
|
+
/* @__PURE__ */ e(mt, { children: t.parent_guid && l.includes(t.parent_guid) ? /* @__PURE__ */ e(C.Fragment, {}) : /* @__PURE__ */ e(
|
|
159
|
+
tt,
|
|
160
|
+
{
|
|
161
|
+
categoryGuid: t.top_level_category_guid || "",
|
|
162
|
+
merchantGuid: t.merchant_guid || ""
|
|
163
|
+
}
|
|
164
|
+
) }),
|
|
165
|
+
/* @__PURE__ */ e(
|
|
166
|
+
pt,
|
|
167
|
+
{
|
|
168
|
+
disableTypography: !0,
|
|
169
|
+
secondary: /* @__PURE__ */ s(c, { direction: "row", justifyContent: "space-between", children: [
|
|
170
|
+
/* @__PURE__ */ s(c, { alignItems: "center", direction: "row", gap: 4, children: [
|
|
171
|
+
g(t, i),
|
|
172
|
+
/* @__PURE__ */ e(x, { variant: "caption", children: p(t, h) })
|
|
173
|
+
] }),
|
|
174
|
+
d && b && /* @__PURE__ */ e(
|
|
175
|
+
x,
|
|
176
|
+
{
|
|
177
|
+
bold: !0,
|
|
178
|
+
color: "action.active",
|
|
179
|
+
onClick: (a) => {
|
|
180
|
+
a.stopPropagation(), a.preventDefault(), Et(d.guid);
|
|
181
|
+
},
|
|
182
|
+
variant: "caption",
|
|
183
|
+
children: d.short_title
|
|
184
|
+
}
|
|
185
|
+
)
|
|
186
|
+
] }),
|
|
187
|
+
children: /* @__PURE__ */ s(c, { direction: "row", justifyContent: "space-between", sx: { gap: 8 }, children: [
|
|
188
|
+
/* @__PURE__ */ e(x, { bold: !0, variant: "body1", children: t.payee || t.description || t.feed_description }),
|
|
189
|
+
/* @__PURE__ */ s(
|
|
190
|
+
x,
|
|
191
|
+
{
|
|
192
|
+
bold: !0,
|
|
193
|
+
color: m ? "success.main" : "text.primary",
|
|
194
|
+
sx: { flexShrink: 0 },
|
|
195
|
+
variant: "body1",
|
|
196
|
+
children: [
|
|
197
|
+
m ? "+" : "",
|
|
198
|
+
B(t.amount, "0,0.00")
|
|
199
|
+
]
|
|
200
|
+
}
|
|
201
|
+
)
|
|
202
|
+
] })
|
|
203
|
+
}
|
|
204
|
+
)
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
)
|
|
208
|
+
);
|
|
209
|
+
}, Mt = H($t), Rt = ({
|
|
210
|
+
bgcolor: t = "background.default",
|
|
211
|
+
children: n
|
|
212
|
+
}) => /* @__PURE__ */ e(k, { display: "inline-block", sx: { bgcolor: t, py: 6, width: "100%" }, children: /* @__PURE__ */ e(x, { bold: !0, sx: { pl: 24 }, variant: "caption", children: n }) }), zt = ({ showIcon: t = !0, showSubtitle: n = !0 }) => {
|
|
213
|
+
const { transactions: r } = O();
|
|
214
|
+
return /* @__PURE__ */ s(c, { alignItems: "center", gap: 12, height: "auto", mb: 24, mt: 24, children: [
|
|
215
|
+
t && /* @__PURE__ */ e(rt, { color: "action", sx: { fontSize: 32 } }),
|
|
216
|
+
/* @__PURE__ */ e(x, { bold: !0, color: "text.secondary", variant: "body2", children: r.zero_state_no_transactions }),
|
|
217
|
+
n && /* @__PURE__ */ e(x, { color: "text.secondary", variant: "caption", children: r.zero_state_there_are_no_transactions })
|
|
218
|
+
] });
|
|
219
|
+
}, Wt = H(zt), G = (t, n) => {
|
|
220
|
+
const r = R(n[t].date), i = R(n[t - 1]?.date);
|
|
221
|
+
return !Z(r, i);
|
|
222
|
+
}, Bt = (t, n) => {
|
|
223
|
+
const r = R(n[t].date), i = R(n[t + 1]?.date);
|
|
224
|
+
return Z(r, i);
|
|
225
|
+
}, Ce = (t) => t?.data ? t.data.map((n) => Object.fromEntries((t.names || []).map((r, i) => [r, n[i]]))) : [], Te = (t, n = "") => t.map((i) => {
|
|
226
|
+
const o = gt(i.date, xt.MONTH_SHORT);
|
|
227
|
+
return {
|
|
228
|
+
ariaLabel: `
|
|
229
|
+
${o},
|
|
230
|
+
${B(i.amount, "0.00")},
|
|
231
|
+
${n}`,
|
|
232
|
+
label: o,
|
|
233
|
+
value: i.amount,
|
|
234
|
+
formattedAmount: B(i.amount, "0,0")
|
|
235
|
+
};
|
|
236
|
+
}), U = 65, F = 32, Vt = ({
|
|
237
|
+
bgcolor: t,
|
|
238
|
+
filter: n,
|
|
239
|
+
height: r = "calc(100dvh - 36px)",
|
|
240
|
+
loader: i = /* @__PURE__ */ e(Q, { label: "Loading", size: 40 }),
|
|
241
|
+
onClick: o,
|
|
242
|
+
showInsights: l = !1,
|
|
243
|
+
showLoader: h = !1,
|
|
244
|
+
transaction: b,
|
|
245
|
+
width: m = "100%",
|
|
246
|
+
zeroState: d = /* @__PURE__ */ e(Wt, {})
|
|
247
|
+
}) => {
|
|
248
|
+
const { isLoading: g, sortedTransactions: p } = z(), a = C.useMemo(() => {
|
|
249
|
+
const _ = n ? p.filter(n) : p;
|
|
250
|
+
return b ?? _;
|
|
251
|
+
}, [p, b]), { clearExpandedSplits: f, setShowInsights: y, toggleSplit: I } = V(), { onEvent: v } = ht(), S = (_) => {
|
|
252
|
+
const D = a.find((A) => A.guid === _);
|
|
253
|
+
if (D?.has_been_split) {
|
|
254
|
+
I(D.guid);
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
v(yt.ACCOUNT_DETAILS_CLICK_TRANSACTION, {
|
|
258
|
+
account_guid: D?.account_guid,
|
|
259
|
+
transaction_guid: _
|
|
260
|
+
}), o?.(_);
|
|
261
|
+
}, E = C.useRef(null), w = st({
|
|
262
|
+
count: a.length,
|
|
263
|
+
getScrollElement: () => E.current,
|
|
264
|
+
estimateSize: (_) => U + (G(_, a) ? F : 0),
|
|
265
|
+
overscan: 5
|
|
266
|
+
});
|
|
267
|
+
return C.useEffect(() => w.measure(), [a]), C.useEffect(() => y(l), [l]), C.useEffect(() => () => f(), []), /* @__PURE__ */ e(ct, { component: "div", role: "list", sx: { width: m }, children: /* @__PURE__ */ e(k, { height: r, overflow: "auto", ref: E, role: "presentation", width: m, children: /* @__PURE__ */ s(
|
|
268
|
+
k,
|
|
269
|
+
{
|
|
270
|
+
height: (
|
|
271
|
+
// set the height to auto when there are no transactions so the zero state isn't set to 0
|
|
272
|
+
w.getVirtualItems().length === 0 ? "auto" : w.getTotalSize()
|
|
273
|
+
),
|
|
274
|
+
position: "relative",
|
|
275
|
+
role: "presentation",
|
|
276
|
+
width: "100%",
|
|
277
|
+
children: [
|
|
278
|
+
(g || h) && i,
|
|
279
|
+
!g && !h && w.getVirtualItems().length === 0 && d,
|
|
280
|
+
!g && !h && w.getVirtualItems().length > 0 && w.getVirtualItems().map((_) => {
|
|
281
|
+
const D = a[_.index], A = G(_.index, a), u = Bt(_.index, a), T = U + (A ? F : 0);
|
|
282
|
+
return /* @__PURE__ */ s(
|
|
283
|
+
k,
|
|
284
|
+
{
|
|
285
|
+
role: "listitem",
|
|
286
|
+
sx: {
|
|
287
|
+
height: T,
|
|
288
|
+
position: "absolute",
|
|
289
|
+
transform: `translateY(${_.start}px)`,
|
|
290
|
+
width: "100%",
|
|
291
|
+
bgcolor: "background.paper"
|
|
292
|
+
},
|
|
293
|
+
children: [
|
|
294
|
+
A && /* @__PURE__ */ e(Rt, { bgcolor: t, children: bt(D.date) }),
|
|
295
|
+
/* @__PURE__ */ e(
|
|
296
|
+
Mt,
|
|
297
|
+
{
|
|
298
|
+
...o && { onClick: S },
|
|
299
|
+
transaction: D
|
|
300
|
+
}
|
|
301
|
+
),
|
|
302
|
+
/* @__PURE__ */ e(lt, { sx: { ml: u ? 68 : 0 } })
|
|
303
|
+
]
|
|
304
|
+
},
|
|
305
|
+
D.guid
|
|
306
|
+
);
|
|
307
|
+
})
|
|
308
|
+
]
|
|
309
|
+
}
|
|
310
|
+
) }) });
|
|
311
|
+
}, Nt = H(Vt), Ht = (t) => {
|
|
312
|
+
const [n, r] = K({ width: 0, height: 0 });
|
|
313
|
+
return J(() => {
|
|
314
|
+
const i = () => {
|
|
315
|
+
if (t.current) {
|
|
316
|
+
const { offsetWidth: o, offsetHeight: l } = t.current;
|
|
317
|
+
r({ width: o, height: l });
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
return i(), window.addEventListener("resize", i), () => {
|
|
321
|
+
window.removeEventListener("resize", i);
|
|
322
|
+
};
|
|
323
|
+
}, [t]), n;
|
|
324
|
+
}, Ot = ({
|
|
325
|
+
color: t,
|
|
326
|
+
legendStyle: n = {},
|
|
327
|
+
monthlyAmount: r,
|
|
328
|
+
monthlyAmountLabel: i,
|
|
329
|
+
trendAmount: o,
|
|
330
|
+
trendAmountLabel: l
|
|
331
|
+
}) => {
|
|
332
|
+
const h = W();
|
|
333
|
+
return /* @__PURE__ */ s(
|
|
334
|
+
c,
|
|
335
|
+
{
|
|
336
|
+
sx: {
|
|
337
|
+
alignItems: "center",
|
|
338
|
+
flexDirection: "row",
|
|
339
|
+
gap: 24,
|
|
340
|
+
justifyContent: "flex-start",
|
|
341
|
+
py: 4,
|
|
342
|
+
width: "100%",
|
|
343
|
+
...n
|
|
344
|
+
},
|
|
345
|
+
children: [
|
|
346
|
+
i && /* @__PURE__ */ s(c, { sx: { alignItems: "center", flexDirection: "row", gap: 8 }, children: [
|
|
347
|
+
/* @__PURE__ */ e(
|
|
348
|
+
"svg",
|
|
349
|
+
{
|
|
350
|
+
"aria-hidden": "true",
|
|
351
|
+
"aria-labelledby": "chartLegendLabel",
|
|
352
|
+
fill: "none",
|
|
353
|
+
height: "12",
|
|
354
|
+
role: "figure",
|
|
355
|
+
width: "12",
|
|
356
|
+
children: /* @__PURE__ */ e("rect", { fill: t, height: "12", rx: "2", width: "12" })
|
|
357
|
+
}
|
|
358
|
+
),
|
|
359
|
+
/* @__PURE__ */ s(x, { id: "chartLegendLabel", variant: "caption", children: [
|
|
360
|
+
i,
|
|
361
|
+
": ",
|
|
362
|
+
r
|
|
363
|
+
] })
|
|
364
|
+
] }),
|
|
365
|
+
l && /* @__PURE__ */ s(c, { sx: { alignItems: "center", flexDirection: "row", gap: 8 }, children: [
|
|
366
|
+
/* @__PURE__ */ e(
|
|
367
|
+
"svg",
|
|
368
|
+
{
|
|
369
|
+
"aria-hidden": "true",
|
|
370
|
+
"aria-labelledby": "chartLegendLabel",
|
|
371
|
+
fill: "none",
|
|
372
|
+
height: "12",
|
|
373
|
+
role: "figure",
|
|
374
|
+
width: "12",
|
|
375
|
+
children: /* @__PURE__ */ e("rect", { fill: h.palette.chart.chart7, height: "12", rx: "2", width: "12" })
|
|
376
|
+
}
|
|
377
|
+
),
|
|
378
|
+
/* @__PURE__ */ s(x, { id: "chartLegendLabel", variant: "caption", children: [
|
|
379
|
+
l,
|
|
380
|
+
": ",
|
|
381
|
+
o
|
|
382
|
+
] })
|
|
383
|
+
] })
|
|
384
|
+
]
|
|
385
|
+
}
|
|
386
|
+
);
|
|
387
|
+
}, jt = (t, n) => {
|
|
388
|
+
if (t <= 0 || n <= 0) return "";
|
|
389
|
+
const r = Math.min(4, t / 2, n / 2);
|
|
390
|
+
return `M${r},0 L${t - r},0 Q${t},0 ${t},${r} L${t},${n} L0,${n} L0,${r} Q0,0 ${r},0 Z`;
|
|
391
|
+
}, Gt = ({
|
|
392
|
+
colorRange: t,
|
|
393
|
+
data: n,
|
|
394
|
+
dataIndex: r,
|
|
395
|
+
removeSelectedTabColorChange: i,
|
|
396
|
+
selectedTabIndex: o,
|
|
397
|
+
style: l,
|
|
398
|
+
...h
|
|
399
|
+
}) => {
|
|
400
|
+
const b = W(), { ariaLabel: m, formattedAmount: d } = n[r], g = o === r ? "bold" : 400, p = l.x ?? 0, a = l.y ?? 0, f = l.width ?? 0, y = l.height ?? 0;
|
|
401
|
+
return /* @__PURE__ */ s("g", { "aria-label": m, children: [
|
|
402
|
+
/* @__PURE__ */ e(
|
|
403
|
+
"path",
|
|
404
|
+
{
|
|
405
|
+
...h,
|
|
406
|
+
d: jt(f, y),
|
|
407
|
+
fill: t[r],
|
|
408
|
+
transform: `translate(${p}, ${a})`
|
|
409
|
+
}
|
|
410
|
+
),
|
|
411
|
+
/* @__PURE__ */ e(
|
|
412
|
+
"text",
|
|
413
|
+
{
|
|
414
|
+
fill: b.palette.text.primary,
|
|
415
|
+
fontSize: 11,
|
|
416
|
+
fontWeight: i ? "bold" : g,
|
|
417
|
+
textAnchor: "middle",
|
|
418
|
+
x: p + f / 2,
|
|
419
|
+
y: a - 8,
|
|
420
|
+
children: d
|
|
421
|
+
}
|
|
422
|
+
)
|
|
423
|
+
] });
|
|
424
|
+
}, Ut = ({
|
|
425
|
+
amounts: t,
|
|
426
|
+
color: n,
|
|
427
|
+
data: r,
|
|
428
|
+
heightOverride: i,
|
|
429
|
+
margin: o = {
|
|
430
|
+
bottom: 30,
|
|
431
|
+
left: 40,
|
|
432
|
+
right: 40,
|
|
433
|
+
top: 20
|
|
434
|
+
},
|
|
435
|
+
onBarClick: l,
|
|
436
|
+
legendPosition: h = "bottom",
|
|
437
|
+
monthlyAmountLabel: b,
|
|
438
|
+
removeSelectedTabColorChange: m,
|
|
439
|
+
selectedTabIndex: d,
|
|
440
|
+
trendAmountLabel: g
|
|
441
|
+
}) => {
|
|
442
|
+
const p = C.useRef(null), { height: a, width: f } = Ht(p), y = W(), I = C.useMemo(() => {
|
|
443
|
+
const u = r.map(({ value: $ }) => $), T = Math.min(...u), L = Math.max(...u);
|
|
444
|
+
return {
|
|
445
|
+
series: [
|
|
446
|
+
{
|
|
447
|
+
data: u,
|
|
448
|
+
type: "bar"
|
|
449
|
+
}
|
|
450
|
+
],
|
|
451
|
+
xAxis: [
|
|
452
|
+
{
|
|
453
|
+
data: r.map(({ label: $ }) => $),
|
|
454
|
+
scaleType: "band",
|
|
455
|
+
categoryGapRatio: 0.45
|
|
456
|
+
}
|
|
457
|
+
],
|
|
458
|
+
yAxis: [
|
|
459
|
+
{
|
|
460
|
+
scaleType: "linear",
|
|
461
|
+
min: T < 0 ? T * 1.2 : 0,
|
|
462
|
+
max: L > 0 ? L : 0
|
|
463
|
+
}
|
|
464
|
+
]
|
|
465
|
+
};
|
|
466
|
+
}, [r]), v = C.useMemo(() => {
|
|
467
|
+
const u = `${n}80`;
|
|
468
|
+
return m ? r.map(() => n) : d == null ? [...new Array(r.length - 1).fill(u), n] : r.map((T, L) => L === d ? n : u);
|
|
469
|
+
}, [n, r, d]), S = C.useMemo(
|
|
470
|
+
() => r[d ?? r.length - 1],
|
|
471
|
+
[r, d]
|
|
472
|
+
), w = r.reduce((u, T) => Math.min(u, T.value), 1 / 0) < 0, _ = /* @__PURE__ */ e(
|
|
473
|
+
Ot,
|
|
474
|
+
{
|
|
475
|
+
color: n,
|
|
476
|
+
legendStyle: { pl: o.left },
|
|
477
|
+
monthlyAmount: S.formattedAmount,
|
|
478
|
+
monthlyAmountLabel: b,
|
|
479
|
+
trendAmount: t?.formattedAverage,
|
|
480
|
+
trendAmountLabel: g
|
|
481
|
+
}
|
|
482
|
+
), D = b || g, A = (u, { dataIndex: T }) => l?.(T);
|
|
483
|
+
return /* @__PURE__ */ s(c, { sx: { alignItems: "center", width: "100%" }, children: [
|
|
484
|
+
D && h === "top" && _,
|
|
485
|
+
/* @__PURE__ */ e(
|
|
486
|
+
k,
|
|
487
|
+
{
|
|
488
|
+
ref: p,
|
|
489
|
+
sx: {
|
|
490
|
+
height: i || 122,
|
|
491
|
+
mb: h === "top" ? 0 : 4,
|
|
492
|
+
mt: h === "top" ? 4 : 0,
|
|
493
|
+
touchAction: "pan-y",
|
|
494
|
+
width: "100%",
|
|
495
|
+
"& svg": {
|
|
496
|
+
touchAction: "pan-y",
|
|
497
|
+
userSelect: "none"
|
|
498
|
+
},
|
|
499
|
+
"& .recharts-wrapper": {
|
|
500
|
+
touchAction: "pan-y"
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
children: /* @__PURE__ */ s(
|
|
504
|
+
vt,
|
|
505
|
+
{
|
|
506
|
+
height: a,
|
|
507
|
+
margin: {
|
|
508
|
+
bottom: o.bottom,
|
|
509
|
+
left: o.left,
|
|
510
|
+
right: o.right,
|
|
511
|
+
top: o.top || 45
|
|
512
|
+
},
|
|
513
|
+
series: I.series,
|
|
514
|
+
width: f,
|
|
515
|
+
xAxis: I.xAxis,
|
|
516
|
+
yAxis: [{ width: 0 }],
|
|
517
|
+
children: [
|
|
518
|
+
t?.average && /* @__PURE__ */ e(
|
|
519
|
+
j,
|
|
520
|
+
{
|
|
521
|
+
labelAlign: "middle",
|
|
522
|
+
lineStyle: {
|
|
523
|
+
stroke: y.palette.chart.chart7,
|
|
524
|
+
strokeDasharray: "4",
|
|
525
|
+
strokeLinecap: "round",
|
|
526
|
+
strokeWidth: 1
|
|
527
|
+
},
|
|
528
|
+
y: t?.average
|
|
529
|
+
}
|
|
530
|
+
),
|
|
531
|
+
w && /* @__PURE__ */ e(
|
|
532
|
+
j,
|
|
533
|
+
{
|
|
534
|
+
labelAlign: "middle",
|
|
535
|
+
lineStyle: {
|
|
536
|
+
stroke: y.palette.chart.chart7
|
|
537
|
+
},
|
|
538
|
+
y: 0
|
|
539
|
+
}
|
|
540
|
+
),
|
|
541
|
+
/* @__PURE__ */ e(
|
|
542
|
+
St,
|
|
543
|
+
{
|
|
544
|
+
position: "bottom",
|
|
545
|
+
slots: {
|
|
546
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
547
|
+
axisTickLabel: ({ text: u, ownerState: T, ...L }) => {
|
|
548
|
+
const $ = r[d ?? r.length - 1]?.label;
|
|
549
|
+
return /* @__PURE__ */ e(
|
|
550
|
+
"text",
|
|
551
|
+
{
|
|
552
|
+
...L,
|
|
553
|
+
style: {
|
|
554
|
+
...L.style,
|
|
555
|
+
fontWeight: !m && $ === u ? "bold" : 400
|
|
556
|
+
},
|
|
557
|
+
children: u
|
|
558
|
+
}
|
|
559
|
+
);
|
|
560
|
+
}
|
|
561
|
+
},
|
|
562
|
+
sx: (u) => ({
|
|
563
|
+
"& .MuiChartsAxis-line": {
|
|
564
|
+
stroke: w ? "none" : u.palette.text?.primary
|
|
565
|
+
},
|
|
566
|
+
"& .MuiChartsAxis-tickContainer:first-of-type .MuiChartsAxis-tick": {
|
|
567
|
+
display: "none"
|
|
568
|
+
},
|
|
569
|
+
"& .MuiChartsAxis-tickLabel": {
|
|
570
|
+
transform: w ? "translateY(15px)" : {}
|
|
571
|
+
}
|
|
572
|
+
}),
|
|
573
|
+
tickLabelStyle: {
|
|
574
|
+
fontSize: 11
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
),
|
|
578
|
+
/* @__PURE__ */ e(
|
|
579
|
+
Dt,
|
|
580
|
+
{
|
|
581
|
+
onItemClick: A,
|
|
582
|
+
slots: {
|
|
583
|
+
bar: (u) => {
|
|
584
|
+
const { ownerState: T, ...L } = u;
|
|
585
|
+
return /* @__PURE__ */ e(
|
|
586
|
+
Gt,
|
|
587
|
+
{
|
|
588
|
+
...L,
|
|
589
|
+
colorRange: v,
|
|
590
|
+
data: r,
|
|
591
|
+
dataIndex: T.dataIndex,
|
|
592
|
+
removeSelectedTabColorChange: m,
|
|
593
|
+
selectedTabIndex: d ?? r.length - 1,
|
|
594
|
+
style: {
|
|
595
|
+
height: u.height,
|
|
596
|
+
x: u.x,
|
|
597
|
+
y: u.y,
|
|
598
|
+
width: u.width
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
)
|
|
606
|
+
]
|
|
607
|
+
}
|
|
608
|
+
)
|
|
609
|
+
}
|
|
610
|
+
),
|
|
611
|
+
D && h === "bottom" && _
|
|
612
|
+
] });
|
|
613
|
+
}, ve = ({
|
|
614
|
+
ariaLabel: t,
|
|
615
|
+
barChartProps: n,
|
|
616
|
+
beat: r,
|
|
617
|
+
data: i,
|
|
618
|
+
defaultSelectedIndex: o = 0,
|
|
619
|
+
icon: l,
|
|
620
|
+
isOpen: h = !1,
|
|
621
|
+
onClose: b,
|
|
622
|
+
onTabChange: m,
|
|
623
|
+
tipSection: d,
|
|
624
|
+
title: g,
|
|
625
|
+
transactionListProps: p = {}
|
|
626
|
+
}) => {
|
|
627
|
+
const { common: a, transactions: f } = O(), { isCopyLoaded: y } = ut(), { sortedTransactionsWithSplits: I, tags: v } = z();
|
|
628
|
+
return y ? /* @__PURE__ */ e(Tt, { ariaLabelClose: a.close_aria, isOpen: h, onClose: b, title: g, children: /* @__PURE__ */ e(
|
|
629
|
+
kt,
|
|
630
|
+
{
|
|
631
|
+
ariaLabel: t,
|
|
632
|
+
beat: r,
|
|
633
|
+
chart: (S, E) => /* @__PURE__ */ e(k, { sx: { pt: 16 }, children: /* @__PURE__ */ e(
|
|
634
|
+
Ut,
|
|
635
|
+
{
|
|
636
|
+
...n,
|
|
637
|
+
onBarClick: (w) => {
|
|
638
|
+
E(w), n.onBarClick?.(w);
|
|
639
|
+
},
|
|
640
|
+
selectedTabIndex: S
|
|
641
|
+
}
|
|
642
|
+
) }),
|
|
643
|
+
data: i,
|
|
644
|
+
defaultSelectedIndex: o,
|
|
645
|
+
icon: l,
|
|
646
|
+
onTabChange: m,
|
|
647
|
+
tipSection: d,
|
|
648
|
+
children: () => /* @__PURE__ */ s(C.Fragment, { children: [
|
|
649
|
+
/* @__PURE__ */ s(
|
|
650
|
+
c,
|
|
651
|
+
{
|
|
652
|
+
sx: {
|
|
653
|
+
alignItems: "center",
|
|
654
|
+
borderBottomColor: "divider",
|
|
655
|
+
borderBottomStyle: "solid",
|
|
656
|
+
borderBottomWidth: 1,
|
|
657
|
+
flexDirection: "row",
|
|
658
|
+
justifyContent: "space-between",
|
|
659
|
+
pb: 4,
|
|
660
|
+
pt: 16,
|
|
661
|
+
px: 24
|
|
662
|
+
},
|
|
663
|
+
children: [
|
|
664
|
+
/* @__PURE__ */ e(x, { bold: !0, variant: "body1", children: f.transactions_title }),
|
|
665
|
+
(p?.transaction || I.length > 0) && /* @__PURE__ */ e(
|
|
666
|
+
Y,
|
|
667
|
+
{
|
|
668
|
+
onClick: () => {
|
|
669
|
+
at(
|
|
670
|
+
p?.transaction || I,
|
|
671
|
+
v
|
|
672
|
+
);
|
|
673
|
+
},
|
|
674
|
+
startIcon: /* @__PURE__ */ e(nt, { name: "ios_share" }),
|
|
675
|
+
sx: { height: 28 },
|
|
676
|
+
children: /* @__PURE__ */ e(x, { bold: !0, variant: "body2", children: f.export_csv_btn })
|
|
677
|
+
}
|
|
678
|
+
)
|
|
679
|
+
]
|
|
680
|
+
}
|
|
681
|
+
),
|
|
682
|
+
/* @__PURE__ */ e(Nt, { ...p })
|
|
683
|
+
] })
|
|
684
|
+
}
|
|
685
|
+
) }) : /* @__PURE__ */ e(Q, {});
|
|
686
|
+
}, Se = ({
|
|
687
|
+
amount: t,
|
|
688
|
+
borderRadius: n = "2px",
|
|
689
|
+
count: r,
|
|
690
|
+
completeColor: i = "success.main",
|
|
691
|
+
icon: o,
|
|
692
|
+
label: l,
|
|
693
|
+
leftLabel: h,
|
|
694
|
+
percentComplete: b = 0,
|
|
695
|
+
rightLabel: m,
|
|
696
|
+
sx: d
|
|
697
|
+
}) => /* @__PURE__ */ s(c, { className: "details-container", sx: { p: 24, width: "100%", gap: 16, ...d }, children: [
|
|
698
|
+
/* @__PURE__ */ s(c, { sx: { alignItems: "center", flexDirection: "row", gap: 12 }, children: [
|
|
699
|
+
/* @__PURE__ */ e(k, { children: o }),
|
|
700
|
+
/* @__PURE__ */ s(c, { children: [
|
|
701
|
+
typeof l == "string" ? /* @__PURE__ */ e(N, { dangerouslySetInnerHTML: { __html: l }, variant: "body2" }) : l,
|
|
702
|
+
typeof t == "string" ? /* @__PURE__ */ e(et, { children: t }) : t
|
|
703
|
+
] })
|
|
704
|
+
] }),
|
|
705
|
+
/* @__PURE__ */ s(c, { sx: { gap: 4 }, children: [
|
|
706
|
+
/* @__PURE__ */ e(
|
|
707
|
+
c,
|
|
708
|
+
{
|
|
709
|
+
sx: {
|
|
710
|
+
bgcolor: "divider",
|
|
711
|
+
borderRadius: n,
|
|
712
|
+
flexDirection: "row",
|
|
713
|
+
height: r ? 20 : 16,
|
|
714
|
+
width: "100%"
|
|
715
|
+
},
|
|
716
|
+
children: /* @__PURE__ */ e(
|
|
717
|
+
k,
|
|
718
|
+
{
|
|
719
|
+
sx: {
|
|
720
|
+
alignItems: "center",
|
|
721
|
+
display: "flex",
|
|
722
|
+
py: 2,
|
|
723
|
+
px: 12,
|
|
724
|
+
bgcolor: i,
|
|
725
|
+
borderRadius: n,
|
|
726
|
+
height: r ? 20 : 16,
|
|
727
|
+
width: `${b}%`
|
|
728
|
+
},
|
|
729
|
+
children: /* @__PURE__ */ e(x, { sx: { color: "primary.dark" }, variant: "caption", children: r })
|
|
730
|
+
}
|
|
731
|
+
)
|
|
732
|
+
}
|
|
733
|
+
),
|
|
734
|
+
!r && /* @__PURE__ */ s(c, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: [
|
|
735
|
+
/* @__PURE__ */ e(x, { variant: "body2", children: h }),
|
|
736
|
+
/* @__PURE__ */ e(x, { variant: "body2", children: m })
|
|
737
|
+
] })
|
|
738
|
+
] })
|
|
739
|
+
] }), De = ({
|
|
740
|
+
title: t,
|
|
741
|
+
description: n,
|
|
742
|
+
callToAction: r,
|
|
743
|
+
instanceSlot: i = void 0,
|
|
744
|
+
onCtaClick: o = () => {
|
|
745
|
+
}
|
|
746
|
+
}) => /* @__PURE__ */ s(It, { sx: { pt: 8, pr: 16, pb: 12, pl: 8, borderRadius: "8px" }, children: [
|
|
747
|
+
/* @__PURE__ */ e(
|
|
748
|
+
c,
|
|
749
|
+
{
|
|
750
|
+
sx: {
|
|
751
|
+
flexDirection: "row",
|
|
752
|
+
alignItems: "center",
|
|
753
|
+
justifyContent: "space-between",
|
|
754
|
+
pt: 4,
|
|
755
|
+
pl: 8
|
|
756
|
+
},
|
|
757
|
+
children: /* @__PURE__ */ e(x, { bold: !0, variant: "body1", children: t })
|
|
758
|
+
}
|
|
759
|
+
),
|
|
760
|
+
/* @__PURE__ */ s(
|
|
761
|
+
c,
|
|
762
|
+
{
|
|
763
|
+
sx: {
|
|
764
|
+
gap: 16,
|
|
765
|
+
alignItems: "center",
|
|
766
|
+
flexDirection: "row",
|
|
767
|
+
justifyContent: "space-between"
|
|
768
|
+
},
|
|
769
|
+
children: [
|
|
770
|
+
/* @__PURE__ */ s(c, { children: [
|
|
771
|
+
/* @__PURE__ */ e(c, { sx: { pt: 2, pl: 8, pb: 8 }, children: /* @__PURE__ */ e(N, { sx: { fontWeight: 400 }, variant: "subtitle2", children: n }) }),
|
|
772
|
+
/* @__PURE__ */ e(c, { sx: { alignItems: "flex-start" }, children: /* @__PURE__ */ e(
|
|
773
|
+
Y,
|
|
774
|
+
{
|
|
775
|
+
onClick: o,
|
|
776
|
+
sx: {
|
|
777
|
+
p: 0,
|
|
778
|
+
height: 24,
|
|
779
|
+
px: 8,
|
|
780
|
+
py: 8,
|
|
781
|
+
fontWeight: 600,
|
|
782
|
+
fontSize: 13,
|
|
783
|
+
lineHeight: "16px"
|
|
784
|
+
},
|
|
785
|
+
variant: "text",
|
|
786
|
+
children: r
|
|
787
|
+
}
|
|
788
|
+
) })
|
|
789
|
+
] }),
|
|
790
|
+
i
|
|
791
|
+
]
|
|
792
|
+
}
|
|
793
|
+
)
|
|
794
|
+
] });
|
|
795
|
+
export {
|
|
796
|
+
Ut as B,
|
|
797
|
+
ve as C,
|
|
798
|
+
De as E,
|
|
799
|
+
Rt as S,
|
|
800
|
+
Nt as T,
|
|
801
|
+
Mt as a,
|
|
802
|
+
Se as b,
|
|
803
|
+
Ce as c,
|
|
804
|
+
Te as d,
|
|
805
|
+
Ht as e,
|
|
806
|
+
kt as f,
|
|
807
|
+
Bt as h,
|
|
808
|
+
we as p,
|
|
809
|
+
G as s,
|
|
810
|
+
V as u
|
|
811
|
+
};
|