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