@mx-cartographer/experiences 8.1.5 → 8.1.6

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.
@@ -1,1703 +0,0 @@
1
- import { jsx as e, jsxs as u } from "react/jsx-runtime";
2
- import d, { useMemo as Me } from "react";
3
- import { observer as O } from "mobx-react-lite";
4
- import Y from "@mui/material/Box";
5
- import he from "@mui/material/Divider";
6
- import ye from "@mui/material/List";
7
- import pe from "@mui/material/Paper";
8
- import E from "@mui/material/Stack";
9
- import { useTheme as H, alpha as Se } from "@mui/material/styles";
10
- import { P as ae, Text as x, H2 as He, MerchantLogo as Te, Toast as Ue, CategoryIcon as ve, CategoryIconVariants as ke, TextField as Ee, Icon as ge } from "@mxenabled/mxui";
11
- import { endOfMonth as Pe } from "date-fns/endOfMonth";
12
- import { getUnixTime as Ae } from "date-fns/getUnixTime";
13
- import { isBefore as ze } from "date-fns/isBefore";
14
- import { startOfMonth as Ne } from "date-fns/startOfMonth";
15
- import { l as Ve, d as We, C as Ye, c as je, i as qe } from "./BudgetUtil-DalEN9--.mjs";
16
- import ue from "@mui/material/Button";
17
- import Qe from "@mui/material/FormGroup";
18
- import de from "@mui/material/IconButton";
19
- import Ge from "@mui/material/TextField";
20
- import { u as fe } from "./useAriaLive-MkYebyUR.mjs";
21
- import { O as C } from "./exportTransactionsToCSV-B2Lp7AMl.mjs";
22
- import { u as v, h as M, m as Xe, d as Ze, l as Oe, g as k, b as Je, o as et } from "./hooks-HwStH7q_.mjs";
23
- import { A as j } from "./Analytics-CzGzz_sE.mjs";
24
- import tt from "@mui/material/ToggleButton";
25
- import { ChevronRight as Be, Icon as R, Delete as be, Cancel as Ce, Search as at, Edit as rt, Flag as nt } from "@mxenabled/mx-icons";
26
- import { fromUnixTime as Ie } from "date-fns/fromUnixTime";
27
- import q from "@mui/material/Avatar";
28
- import U from "@mui/material/ListItem";
29
- import Q from "@mui/material/ListItemAvatar";
30
- import z from "@mui/material/ListItemText";
31
- import { f as Le, D as we } from "./DateFormats-CaOj_4eI.mjs";
32
- import { BarChart as ot } from "@mui/x-charts";
33
- import { b as it, T as st, u as oe, c as lt, d as ct, E as dt, C as ut } from "./EmbeddedCard-CBS3uUbk.mjs";
34
- import { L as mt } from "./Loader-CxeBwuPG.mjs";
35
- import { f as W } from "./NumberFormatting-CyrvFgfd.mjs";
36
- import { b as D } from "./Localization-CkQ49EKr.mjs";
37
- import X from "@mui/material/ListItemButton";
38
- import Z from "@mui/material/ListItemIcon";
39
- import { b as $e } from "./CategorySelectorDrawer-DjeHNx71.mjs";
40
- import { D as ne } from "./Dialog-iLlBR8TG.mjs";
41
- import { D as me } from "./Drawer-XPaLYjiO.mjs";
42
- import _t from "@mui/material/styles/useTheme";
43
- import Re from "@mui/material/InputAdornment";
44
- import pt from "@mui/material/Checkbox";
45
- import { j as gt } from "./DateUtil-D0TO0DaZ.mjs";
46
- import xe from "@mui/material/Grid";
47
- import { C as ht } from "./CurrencyInput-CSJ3zMgE.mjs";
48
- import yt from "@mui/material/Switch";
49
- var ce = /* @__PURE__ */ ((t) => (t[t.Category = 0] = "Category", t[t.Date = 1] = "Date", t[t.Memo = 2] = "Memo", t[t.Tags = 3] = "Tags", t))(ce || {}), se = /* @__PURE__ */ ((t) => (t[t.MerchantBudget = 0] = "MerchantBudget", t[t.SplitTransaction = 1] = "SplitTransaction", t[t.HideTransaction = 2] = "HideTransaction", t[t.MerchantLogo = 3] = "MerchantLogo", t))(se || {});
50
- const Tt = [
51
- 0,
52
- 1,
53
- 2,
54
- 3
55
- /* Tags */
56
- ], bt = [
57
- 1,
58
- 2,
59
- 3
60
- /* MerchantLogo */
61
- ], Ct = ({
62
- startDate: t,
63
- onViewHistory: r,
64
- totalTransaction: s,
65
- amount: a,
66
- spentPercentage: o,
67
- remainingAmount: n,
68
- iconColor: l,
69
- icon: m
70
- }) => {
71
- const { budgets: c } = v();
72
- return /* @__PURE__ */ e(d.Fragment, { children: /* @__PURE__ */ u(
73
- Y,
74
- {
75
- sx: {
76
- bgcolor: "background.paper",
77
- borderBottomColor: "divider",
78
- borderBottomStyle: "solid",
79
- borderBottomWidth: 1
80
- },
81
- children: [
82
- /* @__PURE__ */ u(
83
- E,
84
- {
85
- sx: {
86
- alignItems: "center",
87
- flexDirection: "row",
88
- gap: 12,
89
- justifyContent: "space-between",
90
- pt: 16,
91
- px: 24
92
- },
93
- children: [
94
- /* @__PURE__ */ e(ae, { bold: !0, variant: "subtitle1", children: gt(t) }),
95
- r && /* @__PURE__ */ e(ue, { endIcon: /* @__PURE__ */ e(Be, {}), onClick: r, sx: { height: 28 }, children: /* @__PURE__ */ e(x, { bold: !0, variant: "body2", children: c.spending_history }) })
96
- ]
97
- }
98
- ),
99
- /* @__PURE__ */ e(
100
- it,
101
- {
102
- amount: /* @__PURE__ */ u(E, { sx: { alignItems: "baseline", flexDirection: "row", gap: 4 }, children: [
103
- /* @__PURE__ */ e(He, { children: W(s, "0,0.00") }),
104
- /* @__PURE__ */ e(ae, { color: "text.secondary", variant: "body2", children: "/" }),
105
- /* @__PURE__ */ e(ae, { color: "text.secondary", variant: "body2", children: W(a, "0,0.00") })
106
- ] }),
107
- completeColor: `${l}.main`,
108
- icon: m,
109
- label: c.spent_label,
110
- leftLabel: D(c.percent_spent, o.toFixed()),
111
- percentComplete: o,
112
- rightLabel: D(
113
- c.balance_left,
114
- W(n, "0,0.00")
115
- ),
116
- sx: {
117
- pb: 24,
118
- pt: 16,
119
- px: 24
120
- }
121
- }
122
- )
123
- ]
124
- }
125
- ) });
126
- }, ft = ({
127
- merchantBudget: t,
128
- transaction: r,
129
- onClose: s,
130
- isOpen: a,
131
- setCurrencyDialogAction: o,
132
- renderingToast: n
133
- }) => {
134
- const { budgets: l, common: m } = v(), { sortedTransactions: c } = M(), i = d.useMemo(() => c.reduce((T, I) => I.parent_guid ? T : T + I.amount, 0), [c]), { remainingAmount: _, spentPercentage: p, iconColor: y } = Ve(
135
- i,
136
- t.amount ?? 0
137
- );
138
- return /* @__PURE__ */ u(
139
- me,
140
- {
141
- ariaLabelClose: m.close_aria,
142
- footerStyles: {
143
- px: 24,
144
- py: 16
145
- },
146
- isOpen: a,
147
- onClose: s,
148
- onPrimaryAction: () => o(De.EDIT),
149
- onSecondaryAction: () => {
150
- o(De.DELETE);
151
- },
152
- primaryText: l.details_edit_button,
153
- secondaryColor: "error",
154
- secondaryText: l.details_delete_button,
155
- sx: {
156
- "& .list-wrapper": {
157
- pr: 24
158
- }
159
- },
160
- title: D(l.details_type_title, t.merchant_name),
161
- children: [
162
- /* @__PURE__ */ e(
163
- Ct,
164
- {
165
- amount: t.amount,
166
- icon: /* @__PURE__ */ e(
167
- Te,
168
- {
169
- categoryGuid: r.top_level_category_guid || "",
170
- merchantGuid: r.merchant_guid || ""
171
- }
172
- ),
173
- iconColor: y,
174
- remainingAmount: _,
175
- spentPercentage: p,
176
- startDate: r.date,
177
- totalTransaction: i
178
- }
179
- ),
180
- /* @__PURE__ */ e(st, {}),
181
- n?.()
182
- ]
183
- }
184
- );
185
- }, St = O(ft);
186
- var De = /* @__PURE__ */ ((t) => (t.CREATE = "create", t.EDIT = "edit", t.DELETE = "delete", t))(De || {});
187
- const xt = O(({ transaction: t }) => {
188
- const [r, s] = d.useState(null), [a, o] = d.useState(""), [n, l] = d.useState(!1), m = d.useRef(!1), [c, i] = d.useState(null), _ = H(), {
189
- addMerchantBudget: p,
190
- updateMerchantBudget: y,
191
- deleteMerchantBudget: T,
192
- getMerchantBudgetByMerchantGuid: I,
193
- alert: L,
194
- setAlert: P
195
- } = Xe(), { setFilter: w } = M(), { accounts: f } = Ze(), A = _.palette.mode === "dark" ? "grey.800" : "grey.100", { budgets: b, common: J } = v(), { announce: le, ariaLive: $ } = fe(), [S, K] = d.useState(!1), G = t?.merchant_guid ? I(t.merchant_guid) : void 0, ee = () => {
196
- i(r), s(null), o("");
197
- }, ie = () => {
198
- G ? K(!0) : s(
199
- "create"
200
- /* CREATE */
201
- );
202
- }, te = {
203
- create: {
204
- content: D(
205
- b.create_budget_content,
206
- /* @__PURE__ */ e("strong", { children: t.description }),
207
- `${W(t.amount, "0,0.00")}`
208
- ),
209
- title: b.dialog_create_budget_title,
210
- primaryButtonText: b.dialog_primary_button_text,
211
- errorAlertMessage: D(
212
- b.alert_merchant_budget_not_created,
213
- t.description
214
- ),
215
- errorRetryAction: () => s(
216
- "create"
217
- /* CREATE */
218
- ),
219
- successAlertMessage: D(
220
- b.alert_budget_created,
221
- t.description
222
- ),
223
- apiTrigger: async () => await p(t.merchant_guid, Number(a))
224
- },
225
- edit: {
226
- content: D(
227
- b.edit_budget_content,
228
- /* @__PURE__ */ e("strong", { children: t.description })
229
- ),
230
- title: b.details_edit_title,
231
- primaryButtonText: b.add_save_button,
232
- errorAlertMessage: D(
233
- b.error_alert_edit_merchant_budget,
234
- t.description
235
- ),
236
- errorRetryAction: () => s(
237
- "edit"
238
- /* EDIT */
239
- ),
240
- successAlertMessage: D(
241
- b.success_alert_edit_merchant_budget,
242
- t.description
243
- ),
244
- apiTrigger: async () => await y({
245
- ...G,
246
- amount: Number(a)
247
- })
248
- },
249
- delete: {
250
- content: D(
251
- b.delete_description,
252
- /* @__PURE__ */ e("strong", { children: t.description })
253
- ),
254
- title: b.delete_title,
255
- primaryButtonText: b.details_delete_button,
256
- errorAlertMessage: D(
257
- b.error_alert_delete_merchant_budget,
258
- t.description
259
- ),
260
- errorRetryAction: () => s(
261
- "delete"
262
- /* DELETE */
263
- ),
264
- successAlertMessage: D(
265
- b.success_alert_delete_merchant_budget,
266
- t.description
267
- ),
268
- apiTrigger: async () => await T(G.guid)
269
- }
270
- }, re = async () => {
271
- if (m.current) return;
272
- m.current = !0;
273
- const { apiTrigger: g, successAlertMessage: h, errorAlertMessage: B } = te[r], { isSuccess: F } = await g(), V = F ? h : B;
274
- ee(), l(!F), P(V), le(V), F && r === "delete" && K(!1), m.current = !1;
275
- };
276
- d.useEffect(() => {
277
- const g = {
278
- start: Ne(new Date(t.date * 1e3)),
279
- end: Pe(new Date(t.date * 1e3))
280
- };
281
- S && w({
282
- accounts: f.map((h) => h.guid),
283
- custom: S ? (h) => h.merchant_guid === t.merchant_guid : (h) => h.guid === t.guid,
284
- dateRange: g
285
- });
286
- }, [S, t, f]);
287
- const N = () => /* @__PURE__ */ e(
288
- Ue,
289
- {
290
- actionText: b.autogenerate_budgets_error_primary_button,
291
- autoHideDuration: 3500,
292
- closeAriaLabel: J.close_aria,
293
- handleClose: () => P(""),
294
- message: L,
295
- onActionClick: te[c]?.errorRetryAction,
296
- open: !!L,
297
- severity: n ? "error" : "success",
298
- showAction: n,
299
- showClose: !0
300
- }
301
- );
302
- return /* @__PURE__ */ u(d.Fragment, { children: [
303
- $,
304
- /* @__PURE__ */ e(U, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ u(X, { onClick: ie, children: [
305
- /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(q, { sx: { bgcolor: A }, variant: "rounded", children: /* @__PURE__ */ e(R, { name: "bubble_chart", sx: { color: "text.primary" } }) }) }),
306
- /* @__PURE__ */ e(
307
- z,
308
- {
309
- primary: b.add_merchant_budget_primary_text,
310
- primaryTypographyProps: { variant: "caption" },
311
- secondary: /* @__PURE__ */ e(x, { bold: !0, sx: { color: "text.primary" }, variant: "body1", children: G ? `${W(G.amount, "0,0.00")} / ${J.month_text}` : b.add_merchant_budget_secondary_text })
312
- }
313
- ),
314
- /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(R, { name: "chevron_right", sx: { color: "text.primary" } }) })
315
- ] }) }),
316
- !!G && /* @__PURE__ */ e(
317
- St,
318
- {
319
- isOpen: S,
320
- merchantBudget: G,
321
- onClose: () => K(!1),
322
- renderingToast: () => L && N(),
323
- setCurrencyDialogAction: (g) => {
324
- g === "edit" && o(G?.amount.toString() || ""), s(g);
325
- },
326
- transaction: t
327
- }
328
- ),
329
- r && /* @__PURE__ */ e(
330
- We,
331
- {
332
- closeAriaLabel: J.close_aria,
333
- content: te[r].content,
334
- handleInputChange: o,
335
- handleModalClose: ee,
336
- handlePrimaryAction: re,
337
- handleSecondaryAction: ee,
338
- inputLabel: r !== "delete" ? J.amount_text : "",
339
- inputValue: a,
340
- isOpen: !!r,
341
- primaryText: te[r].primaryButtonText,
342
- secondaryText: J.cancel_button,
343
- title: te[r].title
344
- }
345
- ),
346
- !!L && N()
347
- ] });
348
- }), At = ({ transaction: t }) => {
349
- const { addOrUpdateTransactionRule: r, updateTransaction: s } = M(), { categories: a } = Oe(), { onEvent: o } = k(), { setShouldDisableDrawerScroll: n, updateManualTransaction: l } = oe(), { transactions: m } = v(), c = H(), [i, _] = d.useState(!1), [p, y] = d.useState(""), T = async (f) => {
350
- await s({ ...t, category_guid: p }), f && await r(p, t), y(""), o(j.TRANSACTION_DETAILS_CLICK_CATEGORY, {
351
- transaction_guid: t.guid
352
- });
353
- }, I = (f) => {
354
- if (t.is_manual && !t.guid) {
355
- const A = a.find((b) => b.guid === f);
356
- l({
357
- ...t,
358
- category: A?.name,
359
- category_guid: f,
360
- top_level_category_guid: A?.parent_guid || f
361
- });
362
- } else
363
- y(f);
364
- L();
365
- }, L = () => {
366
- _(!1), n(!1);
367
- }, P = d.useMemo(
368
- () => a.find((f) => f.guid === p),
369
- [p]
370
- ), w = c.palette.mode === "dark" ? "grey.800" : "grey.100";
371
- return /* @__PURE__ */ u(U, { disableGutters: !0, disablePadding: !0, children: [
372
- /* @__PURE__ */ u(
373
- X,
374
- {
375
- onClick: () => {
376
- o(C.ON_TRANSACTION_CATEGORY_CLICK), _(!0);
377
- },
378
- children: [
379
- /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(q, { sx: { bgcolor: w }, variant: "rounded", children: /* @__PURE__ */ e(
380
- ve,
381
- {
382
- categoryGuid: t.top_level_category_guid,
383
- size: 24,
384
- sx: { color: "text.primary" },
385
- variant: ke.Transparent
386
- }
387
- ) }) }),
388
- /* @__PURE__ */ e(
389
- z,
390
- {
391
- primary: m.category_title,
392
- primaryTypographyProps: { variant: "caption" },
393
- secondary: /* @__PURE__ */ e(x, { bold: !0, sx: { color: "text.primary" }, variant: "body1", children: t.category ?? m.actions_select_a_category })
394
- }
395
- ),
396
- /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(R, { name: "chevron_right", sx: { color: "text.primary" } }) })
397
- ]
398
- }
399
- ),
400
- /* @__PURE__ */ e(
401
- $e,
402
- {
403
- initialSelected: t.category_guid,
404
- onClose: L,
405
- onSelect: I,
406
- showDrawer: i,
407
- title: m.actions_select_a_category
408
- }
409
- ),
410
- /* @__PURE__ */ e(
411
- ne,
412
- {
413
- copy: {
414
- title: D(
415
- m.actions_apply_to_all_transaction_types,
416
- t.description
417
- )
418
- },
419
- isOpen: !!p,
420
- onClose: () => y(""),
421
- onPrimaryAction: () => T(!0),
422
- onSecondaryAction: () => T(!1),
423
- primaryText: m.actions_apply_to_all,
424
- secondaryText: m.actions_this_time_only,
425
- children: /* @__PURE__ */ e(ae, { variant: "subtitle1", children: D(
426
- m.actions_all_past_and_future,
427
- t.description,
428
- P?.name
429
- ) })
430
- }
431
- )
432
- ] });
433
- }, Nt = ({ transaction: t }) => {
434
- const { onEvent: r } = k(), { updateTransaction: s } = M(), { updateManualTransaction: a } = oe(), { common: o, transactions: n } = v(), l = H(), [m, c] = d.useState(!1), [i, _] = d.useState(t.date), p = (I) => {
435
- _(Ae(I));
436
- }, y = async () => {
437
- if (t.is_manual && !t.guid) {
438
- a({ ...t, date: i }), c(!1);
439
- return;
440
- }
441
- await s({ ...t, date: i }), r(j.TRANSACTION_DETAILS_CLICK_DATE, { transaction_guid: t.guid }), c(!1);
442
- }, T = l.palette.mode === "dark" ? "grey.800" : "grey.100";
443
- return /* @__PURE__ */ u(U, { className: "mx-txn-date-action", disableGutters: !0, disablePadding: !0, children: [
444
- /* @__PURE__ */ u(
445
- X,
446
- {
447
- onClick: () => {
448
- r(C.ON_TRANSACTION_DATE_CLICK), c(!0);
449
- },
450
- children: [
451
- /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(q, { sx: { bgcolor: T }, variant: "rounded", children: /* @__PURE__ */ e(R, { name: "calendar_month", sx: { color: "text.primary" } }) }) }),
452
- /* @__PURE__ */ e(
453
- z,
454
- {
455
- primary: n.date_title,
456
- primaryTypographyProps: { variant: "caption" },
457
- secondary: /* @__PURE__ */ e(x, { bold: !0, sx: { color: "text.primary" }, variant: "body1", children: Le(Ie(t.date), we.YEAR_MONTH_DAY) })
458
- }
459
- ),
460
- /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(R, { name: "chevron_right", sx: { color: "text.primary" } }) })
461
- ]
462
- }
463
- ),
464
- /* @__PURE__ */ e(
465
- me,
466
- {
467
- ariaLabelClose: o.close_aria,
468
- isOpen: m,
469
- onClose: () => c(!1),
470
- onPrimaryAction: y,
471
- primaryText: o.save_button,
472
- secondaryText: o.cancel_button,
473
- title: n.date_edit_title,
474
- children: /* @__PURE__ */ e(E, { alignItems: "center", mt: 40, children: /* @__PURE__ */ e(
475
- Ye,
476
- {
477
- beginDate: Ie(i),
478
- copy: {
479
- nextAria: n.date_next_aria,
480
- prevAria: n.date_prev_aria,
481
- today: o.date_range_picker.today
482
- },
483
- onDateSelected: p,
484
- selectionType: je.Single
485
- }
486
- ) })
487
- }
488
- )
489
- ] });
490
- }, It = ({ transaction: t }) => {
491
- const { onEvent: r } = k(), { removeTransaction: s } = M(), { setShouldDisableDrawerScroll: a } = oe(), { common: o, transactions: n } = v(), [l, m] = d.useState(!1), c = async () => {
492
- await s(t.guid), r(C.ON_TRANSACTION_DELETE_DELETED);
493
- };
494
- return /* @__PURE__ */ u(Y, { className: "mx-txn-delete", children: [
495
- t && /* @__PURE__ */ e(U, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ u(
496
- X,
497
- {
498
- onClick: () => {
499
- r(C.ON_TRANSACTION_DELETE_CLICK), a(!0), m(!0);
500
- },
501
- children: [
502
- /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(q, { variant: "rounded", children: /* @__PURE__ */ e(be, { color: "secondary", fontSize: "small" }) }) }),
503
- /* @__PURE__ */ e(
504
- z,
505
- {
506
- primary: n.manual_transaction_delete_title,
507
- secondary: n.manual_transaction_delete_subtitle
508
- }
509
- ),
510
- /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(be, {}) })
511
- ]
512
- }
513
- ) }),
514
- /* @__PURE__ */ e(
515
- ne,
516
- {
517
- copy: { title: n.manual_transaction_delete_title },
518
- isOpen: l,
519
- onClose: () => {
520
- a(!1), m(!1);
521
- },
522
- onPrimaryAction: c,
523
- onSecondaryAction: () => r(C.ON_TRANSACTION_DELETE_CANCEL),
524
- primaryText: o.delete_button,
525
- secondaryText: o.cancel_button,
526
- children: /* @__PURE__ */ e(x, { sx: { whiteSpace: "normal" }, variant: "subtitle1", children: n.manual_transaction_delete_description })
527
- }
528
- )
529
- ] });
530
- }, Dt = O(It), vt = ({ transaction: t }) => {
531
- const { onEvent: r } = k(), { updateTransaction: s } = M(), { setShouldDisableDrawerScroll: a } = oe(), { common: o, transactions: n } = v(), l = H(), [m, c] = d.useState(!1), i = async () => {
532
- await s({ ...t, merchant_guid: "" }), r(j.TRANSACTION_DETAILS_CLICK_DELETE_LOGO, {
533
- transaction_guid: t.guid
534
- });
535
- }, _ = l.palette.mode === "dark" ? "grey.800" : "grey.100";
536
- return /* @__PURE__ */ e(d.Fragment, { children: t && /* @__PURE__ */ u(U, { className: "mx-txn-delete-logo", disableGutters: !0, disablePadding: !0, children: [
537
- /* @__PURE__ */ u(
538
- X,
539
- {
540
- onClick: () => {
541
- r(C.ON_TRANSACTION_DELETE_LOGO_CLICK), c(!0);
542
- },
543
- children: [
544
- /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(q, { sx: { bgcolor: _ }, variant: "rounded", children: /* @__PURE__ */ e(R, { name: "delete", sx: { color: "text.primary" } }) }) }),
545
- /* @__PURE__ */ e(z, { primary: n.merchant_logo_title, secondary: n.merchant_logo_desc }),
546
- /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(R, { name: "chevron_right", sx: { color: "text.primary" } }) })
547
- ]
548
- }
549
- ),
550
- /* @__PURE__ */ u(
551
- ne,
552
- {
553
- copy: { title: n.merchant_logo_modal_title },
554
- isOpen: m,
555
- onClose: () => {
556
- a(!1), c(!1);
557
- },
558
- onPrimaryAction: i,
559
- onSecondaryAction: () => r(C.ON_TRANSACTION_DELETE_LOGO_CANCEL),
560
- primaryText: o.delete_button,
561
- secondaryText: o.cancel_button,
562
- title: n.merchant_logo_modal_title,
563
- children: [
564
- /* @__PURE__ */ e(x, { sx: { whiteSpace: "normal" }, variant: "subtitle1", children: n.merchant_logo_modal_desc }),
565
- /* @__PURE__ */ e(x, { bold: !0, sx: { whiteSpace: "normal" }, variant: "subtitle1", children: ` ${n.merchant_logo_modal_desc_bold}` })
566
- ]
567
- }
568
- )
569
- ] }) });
570
- }, Et = O(vt), Ot = ({ transaction: t }) => {
571
- const { onEvent: r } = k(), { updateTransaction: s } = M(), { setShouldDisableDrawerScroll: a } = oe(), { common: o, transactions: n } = v(), l = H(), [m, c] = d.useState(!1), i = t.is_hidden, _ = async () => {
572
- await s({ ...t, is_hidden: !t.is_hidden }), r(
573
- i ? C.ON_TRANSACTION_UNHIDDEN : C.ON_TRANSACTION_HIDDEN
574
- );
575
- }, p = l.palette.mode === "dark" ? "grey.800" : "grey.100";
576
- return /* @__PURE__ */ e(d.Fragment, { children: t && /* @__PURE__ */ u(U, { className: "mx-txn-hide-transaction", disableGutters: !0, disablePadding: !0, children: [
577
- /* @__PURE__ */ u(
578
- X,
579
- {
580
- "aria-checked": i,
581
- "aria-labelledby": "hide-transaction-text",
582
- onClick: () => {
583
- r(
584
- i ? C.ON_TRANSACTION_UNHIDE_CLICK : C.ON_TRANSACTION_HIDE_CLICK
585
- ), r(
586
- i ? "transaction_details_click_unhide_transaction" : "transaction_details_click_hide_transaction",
587
- {
588
- transaction_guid: t.guid
589
- }
590
- ), c(!0);
591
- },
592
- role: "switch",
593
- children: [
594
- /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(q, { sx: { bgcolor: p }, variant: "rounded", children: i ? /* @__PURE__ */ e(R, { name: "visibility_off", sx: { color: "text.primary" } }) : /* @__PURE__ */ e(R, { name: "visibility", sx: { color: "text.primary" } }) }) }),
595
- /* @__PURE__ */ e(
596
- z,
597
- {
598
- id: "hide-transaction-text",
599
- primary: i ? n.hide_trnx_subtitle_unhide_trnx : n.hide_trnx_subtitle_hide_trnx,
600
- secondary: i ? n.hide_trnx_desc_unhiding : n.hide_trnx_desc_hiding
601
- }
602
- ),
603
- /* @__PURE__ */ e(Z, { "aria-hidden": "true", children: /* @__PURE__ */ e(
604
- yt,
605
- {
606
- checked: i,
607
- inputProps: { tabIndex: -1 },
608
- sx: { pointerEvents: "none" },
609
- tabIndex: -1
610
- }
611
- ) })
612
- ]
613
- }
614
- ),
615
- /* @__PURE__ */ e(
616
- ne,
617
- {
618
- copy: {
619
- title: i ? n.hide_trnx_subtitle_unhide_trnx : n.hide_trnx_subtitle_hide_trnx
620
- },
621
- isOpen: m,
622
- onClose: () => {
623
- a(!1), c(!1);
624
- },
625
- onPrimaryAction: _,
626
- onSecondaryAction: () => r(
627
- i ? C.ON_TRANSACTION_UNHIDE_CANCEL_CLICK : C.ON_TRANSACTION_HIDE_CANCEL_CLICK
628
- ),
629
- primaryText: i ? o.unhide_button : o.hide_button,
630
- secondaryText: o.cancel_button,
631
- children: /* @__PURE__ */ e(x, { truncate: !1, variant: "subtitle1", children: i ? n.hide_trnx_desc_unhiding : n.hide_trnx_desc_hiding })
632
- }
633
- )
634
- ] }) });
635
- }, Lt = O(Ot), Ke = ({ transaction: t }) => {
636
- const { amount: r, description: s, isIncome: a, merchant_guid: o, payee: n, top_level_category_guid: l } = t;
637
- return /* @__PURE__ */ u(E, { className: "mx-txn-amount-header", direction: "row", gap: 12, px: 16, py: 24, children: [
638
- /* @__PURE__ */ e(
639
- Te,
640
- {
641
- categoryGuid: l || "",
642
- merchantGuid: o || "",
643
- size: 64
644
- }
645
- ),
646
- /* @__PURE__ */ u(E, { overflow: "hidden'", children: [
647
- /* @__PURE__ */ e(x, { bold: !0, mb: 4, truncate: !0, variant: "body1", children: s || n }),
648
- /* @__PURE__ */ u(ae, { color: a ? "success.main" : "text.primary", truncate: !0, variant: "h1", children: [
649
- a ? "+" : "",
650
- W(r, "0,0.00")
651
- ] })
652
- ] })
653
- ] });
654
- }, wt = ({ transaction: t }) => {
655
- const { onEvent: r } = k(), { updateTransaction: s } = M(), { updateManualTransaction: a } = oe(), { common: o, transactions: n } = v(), l = H(), [m, c] = d.useState(!1), [i, _] = d.useState("");
656
- d.useEffect(() => {
657
- m && _(t.memo ? t.memo : "");
658
- }, [m]);
659
- const p = async () => {
660
- if (t.is_manual && !t.guid) {
661
- a({ ...t, memo: i }), c(!1);
662
- return;
663
- }
664
- await s({ ...t, memo: i }), r(j.TRANSACTION_DETAILS_CLICK_MEMO, { transaction_guid: t.guid }), c(!1);
665
- }, y = l.palette.mode === "dark" ? "grey.800" : "grey.100";
666
- return /* @__PURE__ */ u(U, { className: "mx-txn-memo-action", disableGutters: !0, disablePadding: !0, children: [
667
- /* @__PURE__ */ u(
668
- X,
669
- {
670
- onClick: () => {
671
- r(C.ON_TRANSACTION_MEMO_CLICK), c(!0);
672
- },
673
- children: [
674
- /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(q, { sx: { bgcolor: y }, variant: "rounded", children: /* @__PURE__ */ e(R, { name: "article", sx: { color: "text.primary" } }) }) }),
675
- /* @__PURE__ */ e(
676
- z,
677
- {
678
- primary: n.memo_title,
679
- primaryTypographyProps: { variant: "caption" },
680
- secondary: /* @__PURE__ */ e(
681
- x,
682
- {
683
- bold: !0,
684
- sx: { overflowWrap: "break-word", whiteSpace: "wrap", color: "text.primary" },
685
- variant: "body1",
686
- children: t.memo ? t.memo : n.memo_desc
687
- }
688
- )
689
- }
690
- ),
691
- /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(R, { name: "chevron_right", sx: { color: "text.primary" } }) })
692
- ]
693
- }
694
- ),
695
- /* @__PURE__ */ u(
696
- me,
697
- {
698
- ariaLabelClose: o.close_aria,
699
- isOpen: m,
700
- onClose: () => c(!1),
701
- onPrimaryAction: p,
702
- title: n.memo_title,
703
- children: [
704
- /* @__PURE__ */ e(Ke, { transaction: t }),
705
- /* @__PURE__ */ e(
706
- Ge,
707
- {
708
- "aria-label": n.memo_desc_aria,
709
- focused: !0,
710
- multiline: !0,
711
- name: "memo",
712
- onChange: (T) => _(T.target.value),
713
- placeholder: n.memo_desc,
714
- rows: 4,
715
- sx: { mx: 16, width: "calc(100% - 32px)" },
716
- value: i
717
- }
718
- )
719
- ]
720
- }
721
- )
722
- ] });
723
- }, Mt = O(wt), Rt = ({
724
- index: t,
725
- onDeleteRow: r,
726
- onCategoryChanged: s,
727
- onUpdateAmount: a,
728
- split: o
729
- }) => {
730
- const { onEvent: n } = k(), { transactions: l } = v(), [m, c] = d.useState(`${o.amount}`), [i, _] = d.useState(!1), p = t === 0, y = (T) => {
731
- isNaN(Number(T)) || (c(T), a(t, Number(T)));
732
- };
733
- return /* @__PURE__ */ u(Y, { bgcolor: "background.paper", className: "mx-txn-split-manager-row", pb: 4, px: 8, children: [
734
- /* @__PURE__ */ u(xe, { alignItems: p ? "center" : "start", container: !0, children: [
735
- /* @__PURE__ */ e(xe, { item: !0, xs: 7, children: /* @__PURE__ */ u(E, { alignItems: "start", children: [
736
- /* @__PURE__ */ e(
737
- ue,
738
- {
739
- endIcon: /* @__PURE__ */ e(Be, {}),
740
- onClick: () => _(!0),
741
- startIcon: /* @__PURE__ */ e(ve, { categoryGuid: o.top_level_category_guid }),
742
- sx: { px: 12, py: 8 },
743
- children: o.category
744
- }
745
- ),
746
- /* @__PURE__ */ e(Y, { children: !o.category_guid && /* @__PURE__ */ u(E, { color: "error.main", direction: "row", gap: 8, p: 12, children: [
747
- /* @__PURE__ */ e("span", { "aria-label": "error", role: "img", children: /* @__PURE__ */ e(Ce, { sx: { fontSize: 15 } }) }),
748
- /* @__PURE__ */ e(x, { variant: "body2", children: l.split_transaction_errors_select_category })
749
- ] }) })
750
- ] }) }),
751
- /* @__PURE__ */ e(xe, { item: !0, xs: 5, children: p ? /* @__PURE__ */ e("div", { className: "mx-txn-split-manager-row-top-container", children: /* @__PURE__ */ e(x, { children: W(o.amount, "0,0.00") }) }) : /* @__PURE__ */ u(E, { alignItems: "start", children: [
752
- /* @__PURE__ */ u(E, { alignItems: "start", direction: "row", gap: 8, children: [
753
- /* @__PURE__ */ e(
754
- ht,
755
- {
756
- amount: m,
757
- ariaLabel: l.split_transaction_edit_split_amount,
758
- label: l.split_transaction_edit_split_amount,
759
- minAmount: 0.01,
760
- name: "split-amount-input",
761
- setAmount: y,
762
- sx: {
763
- ".MuiOutlinedInput-input": { p: 12 }
764
- },
765
- type: "number"
766
- }
767
- ),
768
- /* @__PURE__ */ e(
769
- de,
770
- {
771
- "aria-label": l.split_transaction_delete_split_btn,
772
- color: "secondary",
773
- onClick: () => {
774
- n(C.ON_TRANSACTION_SPLIT_DELETE_CLICK), r(t);
775
- },
776
- sx: { w: 44, h: 44 },
777
- children: /* @__PURE__ */ e(be, {})
778
- }
779
- )
780
- ] }),
781
- !m && /* @__PURE__ */ u(E, { color: "error.main", direction: "row", gap: 8, py: 12, children: [
782
- /* @__PURE__ */ e("span", { "aria-label": "error", role: "img", children: /* @__PURE__ */ e(Ce, { sx: { fontSize: 15 } }) }),
783
- /* @__PURE__ */ e(x, { variant: "body2", children: l.split_transaction_errors_enter_an_amount })
784
- ] })
785
- ] }) })
786
- ] }),
787
- /* @__PURE__ */ e(
788
- $e,
789
- {
790
- initialSelected: o.category_guid,
791
- onClose: () => _(!1),
792
- onSelect: (T) => {
793
- s(t, T), _(!1);
794
- },
795
- showDrawer: i,
796
- title: l.actions_select_a_category
797
- }
798
- )
799
- ] });
800
- }, kt = O(Rt), Pt = ({
801
- onAddSplit: t,
802
- onCategoryChanged: r,
803
- onDeleteSplit: s,
804
- onUpdateAmount: a,
805
- splits: o,
806
- transaction: n
807
- }) => {
808
- const { transactions: l } = v(), { onEvent: m } = k(), [c, i] = d.useState(""), { announce: _, ariaLive: p } = fe();
809
- return d.useEffect(() => {
810
- if (o.length <= 1)
811
- i(l.split_transaction_errors_min_splits), _(l.split_transaction_errors_min_splits);
812
- else if (o[0].amount < 0) {
813
- const y = D(
814
- l.split_transaction_errors_totals_must_equal_amount,
815
- W(n.amount, "0,0.00")
816
- );
817
- i(y), _(y);
818
- } else
819
- i(""), _("");
820
- }, [o]), /* @__PURE__ */ u(Y, { className: "mx-txn-split-manager", children: [
821
- p,
822
- o.map((y, T) => /* @__PURE__ */ e(
823
- kt,
824
- {
825
- index: T,
826
- onCategoryChanged: r,
827
- onDeleteRow: s,
828
- onUpdateAmount: a,
829
- split: y
830
- },
831
- T
832
- )),
833
- c && /* @__PURE__ */ u(E, { bgcolor: "background.paper", color: "error.main", direction: "row", gap: 8, p: 16, children: [
834
- /* @__PURE__ */ e("span", { "aria-label": "error", role: "img", children: /* @__PURE__ */ e(Ce, { sx: { fontSize: 15 } }) }),
835
- /* @__PURE__ */ e(x, { variant: "body2", children: c })
836
- ] }),
837
- /* @__PURE__ */ e(Y, { p: 16, children: /* @__PURE__ */ e(
838
- ue,
839
- {
840
- "aria-label": l.split_transaction_add_split_btn,
841
- onClick: () => {
842
- m(C.ON_TRANSACTION_SPLIT_ADD_CLICK), t();
843
- },
844
- children: l.split_transaction_add_split_btn
845
- }
846
- ) })
847
- ] });
848
- }, Gt = O(Pt), Bt = ({ transaction: t }) => {
849
- const { onEvent: r } = k(), { announce: s, ariaLive: a } = fe(), { splitTransaction: o, unSplitTransaction: n } = M(), { common: l, transactions: m } = v(), { setShouldDisableDrawerScroll: c } = oe(), { categories: i } = Oe(), _ = H(), p = {
850
- ...t,
851
- amount: t.amount - 1,
852
- guid: "",
853
- has_been_split: !1,
854
- parent_guid: t.guid
855
- }, y = {
856
- ...t,
857
- amount: 1,
858
- category_guid: void 0,
859
- category: m.split_transaction_select_category_btn,
860
- guid: "",
861
- has_been_split: !1,
862
- parent_guid: t.guid,
863
- top_level_category_guid: void 0
864
- }, [T, I] = d.useState(!1), [L, P] = d.useState(!1), [w, f] = d.useState(!1), [A, b] = d.useState([]), J = () => {
865
- const N = [...A];
866
- N.push({ ...y }), N[0].amount -= 1, b(N), s(
867
- D(
868
- m.split_transaction_add_split_announcement,
869
- N.length
870
- )
871
- );
872
- }, le = (N) => {
873
- if (N > 0) {
874
- const g = A[N], h = [...A];
875
- h.splice(N, 1), h[0].amount += g.amount, b(h), s(
876
- D(m.split_transaction_delete_split_announcement, N + 1)
877
- );
878
- }
879
- }, $ = (N, g) => {
880
- const h = [...A];
881
- h[N].amount = g, h[0].amount = t.amount - h.reduce(
882
- (B, F, V) => B + (V !== 0 ? F.amount : 0),
883
- 0
884
- ), b(h);
885
- }, S = (N, g) => {
886
- const h = [...A], B = i.find((F) => F.guid === g);
887
- B && (h[N] = {
888
- ...h[N],
889
- category_guid: g,
890
- category: B.name,
891
- top_level_category_guid: B.parent_guid || g
892
- }, b(h), s(
893
- D(
894
- m.split_transaction_select_category_announcement,
895
- B.name,
896
- N + 1
897
- )
898
- ));
899
- }, K = () => {
900
- if (t.parent_guid || t.has_been_split) {
901
- P(!0);
902
- return;
903
- }
904
- b([{ ...p }, { ...y }]), r(j.TRANSACTION_DETAILS_CLICK_SPLIT, {
905
- transaction_guid: t.guid
906
- }), I(!0);
907
- }, G = async () => {
908
- if (!w) {
909
- f(!0);
910
- try {
911
- r(C.ON_TRANSACTION_SPLIT_SAVE_CLICK), await o({ ...t, has_been_split: !0 }, A), I(!1);
912
- } finally {
913
- f(!1);
914
- }
915
- }
916
- }, ee = async () => {
917
- w || (r(C.ON_TRANSACTION_SPLIT_CANCEL_CLICK), b([{ ...p }, { ...y }]), f(!1), I(!1));
918
- }, ie = async () => {
919
- r(j.TRANSACTION_DETAILS_CLICK_UNSPLIT, {
920
- transaction_guid: t.guid
921
- });
922
- const N = t.parent_guid ?? t.guid;
923
- await n(N);
924
- }, te = d.useMemo(() => {
925
- const N = A.some((h) => !h.category_guid), g = A.some((h) => h.amount <= 0);
926
- return N || g;
927
- }, [A]), re = _.palette.mode === "dark" ? "grey.800" : "grey.100";
928
- return /* @__PURE__ */ e(d.Fragment, { children: t && /* @__PURE__ */ u(U, { disableGutters: !0, disablePadding: !0, children: [
929
- /* @__PURE__ */ u(X, { onClick: K, children: [
930
- /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(q, { sx: { bgcolor: re }, variant: "rounded", children: /* @__PURE__ */ e(R, { name: "call_split", sx: { color: "text.primary" } }) }) }),
931
- /* @__PURE__ */ e(
932
- z,
933
- {
934
- primary: t.has_been_split || t.parent_guid ? m.split_transaction_unsplit_title : m.split_transaction_title,
935
- secondary: t.has_been_split || t.parent_guid ? m.split_transaction_unsplit_subtitle : m.split_transaction_desc
936
- }
937
- ),
938
- /* @__PURE__ */ e(Z, { children: t.has_been_split || t.parent_guid ? /* @__PURE__ */ e(R, { name: "delete" }) : /* @__PURE__ */ e(R, { name: "chevron_right", sx: { color: "text.primary" } }) })
939
- ] }),
940
- /* @__PURE__ */ u(
941
- me,
942
- {
943
- ariaLabelClose: l.close_aria,
944
- isOpen: T,
945
- isPrimaryDisabled: te || w,
946
- onClose: ee,
947
- onPrimaryAction: G,
948
- primaryText: l.save_button,
949
- secondaryText: l.cancel_button,
950
- title: m.split_transaction_title,
951
- children: [
952
- a,
953
- /* @__PURE__ */ e(Ke, { transaction: t }),
954
- /* @__PURE__ */ e(
955
- Gt,
956
- {
957
- onAddSplit: J,
958
- onCategoryChanged: S,
959
- onDeleteSplit: le,
960
- onUpdateAmount: $,
961
- splits: A,
962
- transaction: t
963
- }
964
- )
965
- ]
966
- }
967
- ),
968
- /* @__PURE__ */ e(
969
- ne,
970
- {
971
- copy: { title: m.split_transaction_unsplit_title },
972
- isOpen: L,
973
- onClose: () => {
974
- c(!1), P(!1);
975
- },
976
- onPrimaryAction: ie,
977
- onSecondaryAction: () => {
978
- r(C.ON_TRANSACTION_UNSPLIT_CANCEL);
979
- },
980
- primaryText: l.delete_button,
981
- secondaryText: l.cancel_button,
982
- children: /* @__PURE__ */ e(ae, { variant: "subtitle1", children: D(
983
- m.split_transaction_unsplit_description,
984
- t.description
985
- ) })
986
- }
987
- )
988
- ] }) });
989
- }, $t = O(Bt), Kt = () => {
990
- const t = _t(), { onEvent: r } = k(), { addTag: s } = M(), { transactions: a } = v(), [o, n] = d.useState(!1), [l, m] = d.useState(""), [c, i] = d.useState(""), _ = d.useRef(null);
991
- d.useEffect(() => {
992
- o && _?.current?.focus();
993
- }, [o]);
994
- const p = () => {
995
- r(
996
- o ? C.ON_TRANSACTION_TAGS_TAG_ADD_CANCEL_CLICK : C.ON_TRANSACTION_TAGS_TAG_ADD_CLICK
997
- ), o || m(""), n(!o);
998
- }, y = async () => {
999
- r(C.ON_TRANSACTION_TAGS_TAG_ADDED), await s(l), n(!1);
1000
- };
1001
- return d.useEffect(() => {
1002
- i(l.length > 40 ? a.tags_error_name_must_be_40_chars : "");
1003
- }, [l]), /* @__PURE__ */ u(Y, { className: "mx-txn-tag-manager-header", children: [
1004
- /* @__PURE__ */ u(
1005
- E,
1006
- {
1007
- alignItems: "center",
1008
- bgcolor: t.palette.background.default,
1009
- direction: "row",
1010
- justifyContent: "space-between",
1011
- px: 24,
1012
- py: 16,
1013
- children: [
1014
- /* @__PURE__ */ e(x, { bold: !0, children: a.tags_your_tags }),
1015
- /* @__PURE__ */ e(
1016
- ue,
1017
- {
1018
- "aria-expanded": o,
1019
- "aria-label": a.tags_add_tag_btn_aria,
1020
- onClick: p,
1021
- children: a.tags_add_tag_btn
1022
- }
1023
- )
1024
- ]
1025
- }
1026
- ),
1027
- /* @__PURE__ */ u(
1028
- ne,
1029
- {
1030
- copy: { title: a.tags_add_tag_btn },
1031
- isOpen: o,
1032
- onClose: () => n(!1),
1033
- onPrimaryAction: y,
1034
- onSecondaryAction: () => n(!1),
1035
- children: [
1036
- /* @__PURE__ */ e(
1037
- Ee,
1038
- {
1039
- "aria-label": a.tags_placeholder,
1040
- name: "add-tag",
1041
- onChange: (T) => m(T.target.value),
1042
- placeholder: a.tags_placeholder,
1043
- sx: { width: "100%" },
1044
- value: l
1045
- }
1046
- ),
1047
- /* @__PURE__ */ e(ae, { id: "add-tag-error", sx: { color: "error.main" }, variant: "subtitle2", children: c })
1048
- ]
1049
- }
1050
- )
1051
- ] });
1052
- }, Ft = O(Kt), Ht = ({ onSearchValueChanged: t, searchValue: r }) => {
1053
- const { common: s, transactions: a } = v(), o = /* @__PURE__ */ e(
1054
- de,
1055
- {
1056
- "aria-label": a.tags_cancel_search || "Search",
1057
- onClick: () => t(""),
1058
- children: /* @__PURE__ */ e(Ce, {})
1059
- }
1060
- );
1061
- return /* @__PURE__ */ e(Y, { className: "mx-txn-tag-manager-search", px: 24, py: 16, children: /* @__PURE__ */ e(
1062
- Ee,
1063
- {
1064
- InputProps: {
1065
- startAdornment: /* @__PURE__ */ e(Re, { position: "start", children: /* @__PURE__ */ e(at, { color: "disabled" }) }),
1066
- endAdornment: /* @__PURE__ */ e(Re, { position: "end", sx: { padding: 0 }, children: r ? o : null })
1067
- },
1068
- "aria-label": s.search_aria,
1069
- name: "search",
1070
- onChange: (n) => t(n.target.value),
1071
- placeholder: s.search_placeholder,
1072
- sx: { bgcolor: "background.paper", width: "100%" },
1073
- value: r
1074
- }
1075
- ) });
1076
- }, Ut = O(Ht), zt = ({ onTagChecked: t, selectedTags: r, tag: s }) => {
1077
- const { onEvent: a } = k(), { removeTag: o, updateTag: n } = M(), { common: l, transactions: m } = v(), [c, i] = d.useState(!1), [_, p] = d.useState(!1), [y, T] = d.useState(""), [I, L] = d.useState(""), P = async () => {
1078
- a(C.ON_TRANSACTION_TAGS_TAG_EDIT_SAVED), s && await n({ ...s, name: y }), i(!1);
1079
- }, w = async () => {
1080
- a(C.ON_TRANSACTION_TAGS_TAG_DELETED), await o(s.guid), p(!1);
1081
- };
1082
- d.useEffect(() => {
1083
- L(y.length > 40 ? m.tags_error_name_must_be_40_chars : "");
1084
- }, [y]);
1085
- const f = () => {
1086
- a(C.ON_TRANSACTION_TAGS_TAG_EDIT_CLICK), T(s.name), i(!0);
1087
- }, A = () => {
1088
- a(C.ON_TRANSACTION_TAGS_TAG_DELETE_CLICK), p(!0);
1089
- };
1090
- return /* @__PURE__ */ u(
1091
- U,
1092
- {
1093
- className: "mx-txn-transaction-manager-row",
1094
- disableGutters: !0,
1095
- disablePadding: !0,
1096
- secondaryAction: !s.is_default_tag && /* @__PURE__ */ u(E, { direction: "row", children: [
1097
- /* @__PURE__ */ e(
1098
- de,
1099
- {
1100
- "aria-label": `Edit ${s.name} tag`,
1101
- color: "secondary",
1102
- onClick: f,
1103
- children: /* @__PURE__ */ e(rt, { color: "secondary" })
1104
- }
1105
- ),
1106
- /* @__PURE__ */ e(
1107
- de,
1108
- {
1109
- "aria-label": `Delete ${s.name} tag`,
1110
- color: "secondary",
1111
- onClick: A,
1112
- children: /* @__PURE__ */ e(be, { color: "secondary" })
1113
- }
1114
- )
1115
- ] }),
1116
- children: [
1117
- /* @__PURE__ */ u(
1118
- X,
1119
- {
1120
- "aria-checked": r.includes(s.guid),
1121
- onClick: () => t(s.guid),
1122
- role: "checkbox",
1123
- children: [
1124
- /* @__PURE__ */ e(Z, { sx: { ml: 0 }, children: /* @__PURE__ */ e(
1125
- pt,
1126
- {
1127
- "aria-hidden": !0,
1128
- checked: r.includes(s.guid),
1129
- edge: "start",
1130
- tabIndex: -1
1131
- }
1132
- ) }),
1133
- /* @__PURE__ */ e(z, { children: s.name })
1134
- ]
1135
- }
1136
- ),
1137
- /* @__PURE__ */ u(
1138
- ne,
1139
- {
1140
- copy: { title: "Update tag name" },
1141
- isOpen: c,
1142
- onClose: () => i(!1),
1143
- onPrimaryAction: P,
1144
- onSecondaryAction: () => i(!1),
1145
- children: [
1146
- /* @__PURE__ */ e(
1147
- Ee,
1148
- {
1149
- "aria-describedby": I ? "update-tag-error" : void 0,
1150
- "aria-label": m.tags_update_the_tag_name,
1151
- name: "update-tag",
1152
- onChange: (b) => T(b.target.value),
1153
- placeholder: "Tag name",
1154
- sx: { width: "100%" },
1155
- value: y
1156
- }
1157
- ),
1158
- /* @__PURE__ */ e(ae, { id: "update-tag-error", sx: { color: "error.main" }, variant: "subtitle2", children: I })
1159
- ]
1160
- }
1161
- ),
1162
- /* @__PURE__ */ e(
1163
- ne,
1164
- {
1165
- copy: { title: m.tags_delete_title },
1166
- isOpen: _,
1167
- onClose: () => p(!1),
1168
- onPrimaryAction: w,
1169
- onSecondaryAction: () => a(C.ON_TRANSACTION_TAGS_TAG_DELETE_CANCEL_CLICK),
1170
- primaryText: l.delete_button,
1171
- secondaryText: l.cancel_button,
1172
- children: /* @__PURE__ */ e(x, { truncate: !1, children: m.tags_deleting_this_tag_will_remove_it })
1173
- }
1174
- )
1175
- ]
1176
- }
1177
- );
1178
- }, Vt = O(zt), Wt = ({ selectedTags: t, onTagChecked: r }) => {
1179
- const { tags: s } = M(), [a, o] = d.useState(""), n = s.filter(
1180
- (l) => l.name.toLowerCase().includes(a.toLowerCase())
1181
- );
1182
- return /* @__PURE__ */ u("div", { className: "mx-txn-tag-manager", children: [
1183
- /* @__PURE__ */ e(
1184
- Ut,
1185
- {
1186
- onSearchValueChanged: (l) => o(l),
1187
- searchValue: a
1188
- }
1189
- ),
1190
- /* @__PURE__ */ e(Ft, {}),
1191
- /* @__PURE__ */ e(pe, { sx: { boxShadow: "none" }, children: /* @__PURE__ */ e(ye, { children: n.map((l) => /* @__PURE__ */ u(d.Fragment, { children: [
1192
- /* @__PURE__ */ e(Vt, { onTagChecked: r, selectedTags: t, tag: l }),
1193
- /* @__PURE__ */ e(he, { sx: { ml: 24 } })
1194
- ] }, l.guid)) }) })
1195
- ] });
1196
- }, Yt = O(Wt), jt = ({ transaction: t }) => {
1197
- const { onEvent: r } = k(), { tags: s, updateTaggings: a, updateTransaction: o } = M(), { common: n, transactions: l } = v(), { updateManualTransaction: m } = oe(), c = H(), [i, _] = d.useState(!1), [p, y] = d.useState(t.tags);
1198
- d.useEffect(() => {
1199
- y(t.tags);
1200
- }, [i, t]);
1201
- const T = (w) => {
1202
- const f = [...p], A = p.indexOf(w);
1203
- A >= 0 ? f.splice(A, 1) : f.push(w), y(f);
1204
- }, I = async () => {
1205
- if (t.is_manual && !t.guid) {
1206
- m({ ...t, tags: p }), _(!1);
1207
- return;
1208
- }
1209
- await a(p, t.guid), await o({ ...t, tags: p }), r(j.TRANSACTION_DETAILS_CLICK_TAGS, { transaction_guid: t.guid }), _(!1);
1210
- }, L = d.useMemo(
1211
- () => t.tags.map(
1212
- (w, f, A) => `${s.find((b) => b.guid === w)?.name}${f < A.length - 1 ? " / " : ""}`
1213
- ),
1214
- [s, t]
1215
- ), P = c.palette.mode === "dark" ? "grey.800" : "grey.100";
1216
- return /* @__PURE__ */ u(U, { disableGutters: !0, disablePadding: !0, children: [
1217
- /* @__PURE__ */ u(
1218
- X,
1219
- {
1220
- onClick: () => {
1221
- r(C.ON_TRANSACTION_TAGS_CLICK), _(!0);
1222
- },
1223
- children: [
1224
- /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(q, { sx: { bgcolor: P }, variant: "rounded", children: /* @__PURE__ */ e(R, { name: "local_offer", sx: { color: "text.primary" } }) }) }),
1225
- /* @__PURE__ */ e(
1226
- z,
1227
- {
1228
- primary: l.tags_title,
1229
- primaryTypographyProps: { variant: "caption" },
1230
- secondary: /* @__PURE__ */ e(x, { bold: !0, sx: { color: "text.primary" }, variant: "body1", children: t.tags?.length > 0 ? L : l.tags_desc })
1231
- }
1232
- ),
1233
- /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(R, { name: "chevron_right", sx: { color: "text.primary" } }) })
1234
- ]
1235
- }
1236
- ),
1237
- /* @__PURE__ */ e(
1238
- me,
1239
- {
1240
- ariaLabelClose: n.close_aria,
1241
- isOpen: i,
1242
- onClose: () => _(!1),
1243
- onPrimaryAction: I,
1244
- primaryText: n.save_button,
1245
- secondaryText: n.cancel_button,
1246
- title: l.tags_title,
1247
- children: /* @__PURE__ */ e(Yt, { onTagChecked: T, selectedTags: p })
1248
- }
1249
- )
1250
- ] });
1251
- }, qt = O(jt), Qt = ({ transaction: t, viewOnly: r = !1 }) => {
1252
- const { updateTransaction: s } = M(), { common: a, transactions: o } = v(), { onEvent: n } = k(), { announce: l, ariaLive: m } = fe(), [c, i] = d.useState(!1), [_, p] = d.useState(""), y = d.useRef(null);
1253
- d.useEffect(() => {
1254
- c && (p(t.description), y?.current?.focus());
1255
- }, [c]);
1256
- const T = () => {
1257
- i(!0), n(C.ON_TRANSACTION_DESCRIPTION_EDIT_CLICK), setTimeout(() => document.getElementById("transaction-description-input")?.focus(), 0);
1258
- }, I = async () => {
1259
- n(j.TRANSACTION_DETAILS_CLICK_DESCRIPTION, {
1260
- transaction_guid: t.guid
1261
- }), await s({ ...t, description: _ }), i(!1), l(`${o.payee_title}: ${_}`), setTimeout(() => document.getElementById("transaction-description-edit-button")?.focus(), 0);
1262
- };
1263
- return /* @__PURE__ */ u(Y, { className: "mx-txn-transaction-description", children: [
1264
- m,
1265
- c ? /* @__PURE__ */ u(Qe, { row: !0, children: [
1266
- /* @__PURE__ */ e(
1267
- Ge,
1268
- {
1269
- "aria-label": o.payee_title,
1270
- id: "transaction-description-input",
1271
- inputProps: { maxLength: 140 },
1272
- label: o.payee_title,
1273
- name: o.payee_title,
1274
- onChange: (L) => p(L.target.value),
1275
- ref: y,
1276
- sx: {
1277
- backgroundColor: "background.paper",
1278
- ".MuiOutlinedInput-root": { borderTopRightRadius: 0, borderBottomRightRadius: 0 },
1279
- ".MuiOutlinedInput-input": { p: 11 },
1280
- width: 250
1281
- },
1282
- value: _
1283
- }
1284
- ),
1285
- /* @__PURE__ */ e(
1286
- ue,
1287
- {
1288
- disabled: !_,
1289
- onClick: I,
1290
- sx: {
1291
- borderTopLeftRadius: 0,
1292
- borderBottomLeftRadius: 0
1293
- },
1294
- variant: "outlined",
1295
- children: a.save_button
1296
- }
1297
- )
1298
- ] }) : /* @__PURE__ */ u(E, { alignItems: "center", direction: "row", gap: 4, sx: { minHeight: 44 }, children: [
1299
- /* @__PURE__ */ e(x, { bold: !0, children: t.description }),
1300
- !r && /* @__PURE__ */ e(
1301
- de,
1302
- {
1303
- "aria-label": o.payee_edit,
1304
- id: "transaction-description-edit-button",
1305
- onClick: T,
1306
- sx: { color: "action.active" },
1307
- children: /* @__PURE__ */ e(ge, { name: "create", size: 22 })
1308
- }
1309
- )
1310
- ] })
1311
- ] });
1312
- }, Xt = O(Qt), Zt = ({ transaction: t }) => {
1313
- const { updateTransaction: r } = M(), { transactions: s } = v(), { onEvent: a } = k(), o = H(), n = o.palette.mode === "dark", l = async () => {
1314
- a(j.TRANSACTION_DETAILS_CLICK_FLAG, { transaction_guid: t.guid }), await r({ ...t, is_flagged: !t.is_flagged });
1315
- };
1316
- return /* @__PURE__ */ e("div", { className: "mx-txn-transaction-flag", children: /* @__PURE__ */ e(
1317
- tt,
1318
- {
1319
- "aria-label": s.flag_btn_aria,
1320
- "aria-pressed": t.is_flagged,
1321
- color: n ? "primary" : "warning",
1322
- onClick: l,
1323
- selected: t.is_flagged,
1324
- sx: {
1325
- borderRadius: 6,
1326
- color: n ? "common.white" : "secondary.main",
1327
- "&.Mui-selected": {
1328
- color: n ? "primary.main" : "common.white",
1329
- backgroundColor: n ? Se(o.palette.primary.main, 0.25) : "warning.dark",
1330
- ":hover": {
1331
- color: n ? "primary.main" : "common.white",
1332
- backgroundColor: n ? Se(o.palette.primary.main, 0.2) : "warning.main"
1333
- }
1334
- },
1335
- ":hover": {
1336
- color: n ? "common.white" : "warning.contrastText",
1337
- backgroundColor: n ? Se(o.palette.primary.main, 0.2) : "warning.light"
1338
- }
1339
- },
1340
- value: "flagged",
1341
- children: /* @__PURE__ */ e(nt, { color: "inherit" })
1342
- }
1343
- ) });
1344
- }, Jt = O(Zt), _e = (t, r, s, a = !0, o = "inset") => a ? /* @__PURE__ */ u(d.Fragment, { children: [
1345
- /* @__PURE__ */ u(U, { disableGutters: !0, disablePadding: !0, children: [
1346
- /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(q, { sx: { bgcolor: "neutral.light" }, variant: "rounded", children: t }) }),
1347
- /* @__PURE__ */ e(
1348
- z,
1349
- {
1350
- primary: r,
1351
- primaryTypographyProps: { variant: "caption" },
1352
- secondary: s
1353
- }
1354
- )
1355
- ] }),
1356
- /* @__PURE__ */ e(he, { variant: o })
1357
- ] }) : null, ea = ({ transaction: t }) => {
1358
- const { transactions: r } = v(), { tags: s } = M(), a = d.useMemo(() => {
1359
- const o = new Map(s.map((n) => [n.guid, n.name]));
1360
- return t.tags.map((n) => o.get(n)).filter(Boolean).join(" / ");
1361
- }, [s, t.tags]);
1362
- return /* @__PURE__ */ u(ye, { sx: { "& .MuiListItem-root": { px: 24, py: 12 } }, children: [
1363
- _e(
1364
- /* @__PURE__ */ e(
1365
- ve,
1366
- {
1367
- categoryGuid: t.top_level_category_guid,
1368
- size: 24,
1369
- sx: { color: "text.primary" },
1370
- variant: ke.Transparent
1371
- }
1372
- ),
1373
- r.category_title,
1374
- /* @__PURE__ */ e(x, { bold: !0, variant: "body1", children: t.category ?? r.actions_select_a_category })
1375
- ),
1376
- _e(
1377
- /* @__PURE__ */ e(ge, { name: "calendar_month", sx: { color: "text.primary" } }),
1378
- r.date_title,
1379
- /* @__PURE__ */ e(x, { bold: !0, variant: "body1", children: Le(Ie(t.date), we.YEAR_MONTH_DAY) })
1380
- ),
1381
- _e(
1382
- /* @__PURE__ */ e(ge, { name: "article", sx: { color: "text.primary" } }),
1383
- r.memo_title,
1384
- /* @__PURE__ */ e(x, { bold: !0, sx: { overflowWrap: "break-word", whiteSpace: "wrap" }, variant: "body1", children: t.memo ?? r.memo_desc }),
1385
- !!t.memo,
1386
- t.tags?.length > 0 ? "inset" : "fullWidth"
1387
- ),
1388
- _e(
1389
- /* @__PURE__ */ e(ge, { name: "local_offer", sx: { color: "text.primary" } }),
1390
- r.tags_title,
1391
- /* @__PURE__ */ e(x, { bold: !0, variant: "body1", children: t.tags?.length ? a : r.tags_desc }),
1392
- !!t.tags?.length,
1393
- "fullWidth"
1394
- )
1395
- ] });
1396
- }, ta = O(ea), aa = ({
1397
- data: t,
1398
- color: r,
1399
- width: s = 85,
1400
- height: a = 65
1401
- }) => {
1402
- const o = H(), n = {
1403
- series: [
1404
- {
1405
- data: t.map(({ value: c }) => c),
1406
- type: "bar"
1407
- }
1408
- ],
1409
- xAxis: [
1410
- {
1411
- data: t.map(({ label: c }) => c),
1412
- scaleType: "band",
1413
- categoryGapRatio: 0.3
1414
- }
1415
- ]
1416
- }, l = t.map(
1417
- (c, i) => i === t.length - 1 ? r(o) : `${r(o)}80`
1418
- ), m = (c, i) => {
1419
- if (c <= 0 || i <= 0) return "";
1420
- const _ = Math.min(6, c / 2, i / 2);
1421
- return `M${_},0 L${c - _},0 Q${c},0 ${c},${_} L${c},${i} L0,${i} L0,${_} Q0,0 ${_},0 Z`;
1422
- };
1423
- return /* @__PURE__ */ e(
1424
- E,
1425
- {
1426
- sx: {
1427
- width: s,
1428
- height: a
1429
- },
1430
- children: /* @__PURE__ */ e(
1431
- ot,
1432
- {
1433
- axisHighlight: {
1434
- x: "none",
1435
- y: "none"
1436
- },
1437
- height: a,
1438
- margin: {
1439
- bottom: -10,
1440
- left: 0,
1441
- right: 0,
1442
- top: 10
1443
- },
1444
- series: n.series,
1445
- slots: {
1446
- bar: ({ ownerState: c, ...i }) => {
1447
- const { ariaLabel: _ } = t[c.dataIndex];
1448
- return /* @__PURE__ */ e("g", { "aria-label": _, children: /* @__PURE__ */ e(
1449
- "path",
1450
- {
1451
- d: m(i.width, i.height),
1452
- fill: l[c.dataIndex],
1453
- transform: `translate(${i.x}, ${i.y})`
1454
- }
1455
- ) });
1456
- },
1457
- axisTickLabel: ({ text: c, ...i }) => {
1458
- const _ = t[t.length - 1]?.label;
1459
- return /* @__PURE__ */ e(
1460
- "text",
1461
- {
1462
- ...i,
1463
- style: {
1464
- ...i.style,
1465
- fontSize: 6.75,
1466
- lineHeight: "9px",
1467
- fontWeight: _ === c ? "bold" : 400
1468
- },
1469
- children: c
1470
- }
1471
- );
1472
- }
1473
- },
1474
- sx: {
1475
- "& .MuiChartsAxis-bottom .MuiChartsAxis-tickContainer:first-of-type .MuiChartsAxis-tick": {
1476
- display: "none"
1477
- }
1478
- },
1479
- width: s,
1480
- xAxis: n.xAxis,
1481
- yAxis: [{ width: 0, position: "none" }]
1482
- }
1483
- )
1484
- }
1485
- );
1486
- }, ra = {
1487
- BILL_AMOUNT_NOT_STANDARD: "BillAmountNotStandard"
1488
- }, na = (t, r) => {
1489
- if (r)
1490
- switch (r.template) {
1491
- case ra.BILL_AMOUNT_NOT_STANDARD: {
1492
- const s = r.data_series ? lt(r.data_series) : [], a = ct(s, r.payload?.merchant_name);
1493
- return {
1494
- instanceSlot: /* @__PURE__ */ e(
1495
- aa,
1496
- {
1497
- color: (o) => o.palette.categories.billsUtilities,
1498
- data: a.slice(-3)
1499
- }
1500
- ),
1501
- dataSeries: s,
1502
- chartData: a,
1503
- callToAction: t.view_history
1504
- };
1505
- }
1506
- default:
1507
- return null;
1508
- }
1509
- return null;
1510
- }, oa = ({
1511
- bottomActions: t = bt,
1512
- canFlagTransaction: r = !0,
1513
- topActions: s = Tt,
1514
- transaction: a
1515
- }) => {
1516
- const { onEvent: o } = k(), { isCopyLoaded: n } = Je(), { userFeatures: l } = et(), { accounts: m, common: c, insights_feed: i } = v(), { detailedCategories: _ } = Oe(), {
1517
- associatedBeats: p,
1518
- detailedTransactions: y,
1519
- cachedStartDate: T,
1520
- loadEmbeddedInstanceTransactions: I
1521
- } = M(), [L, P] = d.useState(!1), [w, f] = d.useState(!1), [A, b] = d.useState(!1), J = H(), le = a?.number && a.number.length > 4, $ = d.useMemo(() => p.find((g) => g.associated_transaction_guid === a.guid), [p, a]), S = na(c, $), [K, G] = d.useState(
1522
- S ? S.dataSeries.length - 1 : 0
1523
- );
1524
- d.useEffect(
1525
- () => o(j.TRANSACTION_DETAILS_VIEW, { transaction_guid: a.guid }),
1526
- []
1527
- ), d.useEffect(() => {
1528
- if (!S || S.dataSeries.length === 0) return;
1529
- const { date: g } = S.dataSeries[K], h = Ne(g);
1530
- ze(h, T) && (f(!0), I(h).finally(() => {
1531
- f(!1);
1532
- }));
1533
- }, [K, S, T]);
1534
- const ee = t.includes(se.MerchantBudget) && !a?.merchant_guid ? t.filter((g) => g !== se.MerchantBudget) : t, ie = Me(() => {
1535
- if (S) {
1536
- const g = _.find(
1537
- (Fe) => Fe.guid === a.top_level_category_guid
1538
- ), h = $?.payload?.average_amount ?? 0, B = a.amount;
1539
- let F = i.general.increased_text;
1540
- B - h < 0 && (F = i.general.decreased_text);
1541
- const V = h === 0 ? 0 : Math.round(Math.abs(B - h) / h * 100);
1542
- return { category: g, percentageAmount: V, changetype: F };
1543
- }
1544
- return null;
1545
- }, [S, _]), te = Me(() => {
1546
- if (!S?.dataSeries?.length)
1547
- return [];
1548
- const { guid: g, date: h } = S.dataSeries[K], B = Ne(h), F = Pe(h);
1549
- return y.filter((V) => V.date >= Ae(B) && V.date <= Ae(F) && V.guid === g);
1550
- }, [K, S, y, w]);
1551
- if (!n)
1552
- return /* @__PURE__ */ e(mt, {});
1553
- const re = qe(l, "MX_TXN_DETAILS_VIEW_ONLY"), N = J.palette.mode === "dark" ? "grey.800" : "grey.100";
1554
- return /* @__PURE__ */ u(Y, { className: "mx-txn-transaction-details", width: "100%", children: [
1555
- a && /* @__PURE__ */ u(E, { children: [
1556
- /* @__PURE__ */ u(E, { gap: 12, p: 24, children: [
1557
- /* @__PURE__ */ e(pe, { elevation: 2, sx: { width: 64 }, children: /* @__PURE__ */ e(
1558
- Te,
1559
- {
1560
- categoryGuid: a.top_level_category_guid || "",
1561
- merchantGuid: a.merchant_guid || "",
1562
- size: 64
1563
- }
1564
- ) }),
1565
- /* @__PURE__ */ e(Xt, { transaction: a, viewOnly: re }),
1566
- /* @__PURE__ */ u(E, { direction: "row", justifyContent: "space-between", sx: { minHeight: 44 }, children: [
1567
- /* @__PURE__ */ u(ae, { color: a.isIncome ? "success.main" : "text.primary", variant: "h1", children: [
1568
- a.isIncome ? "+" : "",
1569
- W(a.amount, "0,0.00")
1570
- ] }),
1571
- !re && r && /* @__PURE__ */ e(Jt, { transaction: a })
1572
- ] }),
1573
- S?.instanceSlot && /* @__PURE__ */ e(
1574
- dt,
1575
- {
1576
- callToAction: S.callToAction,
1577
- description: D(
1578
- i.general.embedded_description,
1579
- ie.changetype,
1580
- /* @__PURE__ */ e("strong", { children: ie.percentageAmount })
1581
- ),
1582
- instanceSlot: S.instanceSlot,
1583
- onCtaClick: () => {
1584
- P(!0);
1585
- },
1586
- title: $.html_micro_title
1587
- }
1588
- ),
1589
- /* @__PURE__ */ u(E, { sx: { bgcolor: N, borderRadius: "4px", gap: 4, p: 8 }, children: [
1590
- /* @__PURE__ */ e(x, { bold: !0, children: `${a.account}
1591
- ${le ? a.number : "•".repeat(4).concat(a.number ?? "")}` }),
1592
- /* @__PURE__ */ e(x, { bold: !0, variant: "tiny", children: a.feed_description })
1593
- ] })
1594
- ] }),
1595
- /* @__PURE__ */ e(pe, { square: !0, sx: { boxShadow: "none" }, children: re ? /* @__PURE__ */ e(ta, { transaction: a }) : /* @__PURE__ */ e(ye, { children: s.map((g, h) => /* @__PURE__ */ u(d.Fragment, { children: [
1596
- g === ce.Category && /* @__PURE__ */ e(At, { transaction: a }),
1597
- g === ce.Date && /* @__PURE__ */ e(Nt, { transaction: a }),
1598
- g === ce.Memo && /* @__PURE__ */ e(Mt, { transaction: a }),
1599
- g === ce.Tags && /* @__PURE__ */ e(qt, { transaction: a }),
1600
- /* @__PURE__ */ e(
1601
- he,
1602
- {
1603
- component: "li",
1604
- variant: h < s.length - 1 ? "inset" : "fullWidth"
1605
- }
1606
- )
1607
- ] }, g)) }) }),
1608
- !re && ee.length > 0 && /* @__PURE__ */ u(d.Fragment, { children: [
1609
- /* @__PURE__ */ e(x, { bold: !0, mb: 8, ml: 26, mt: 16, variant: "body1", children: m.actions }),
1610
- /* @__PURE__ */ e(pe, { square: !0, sx: { boxShadow: "none" }, children: /* @__PURE__ */ u(ye, { children: [
1611
- ee.map((g, h) => /* @__PURE__ */ u(d.Fragment, { children: [
1612
- g === se.MerchantBudget && /* @__PURE__ */ e(xt, { transaction: a }),
1613
- g === se.SplitTransaction && /* @__PURE__ */ e($t, { transaction: a }),
1614
- g === se.HideTransaction && /* @__PURE__ */ e(Lt, { transaction: a }),
1615
- g === se.MerchantLogo && /* @__PURE__ */ e(Et, { transaction: a }),
1616
- /* @__PURE__ */ e(
1617
- he,
1618
- {
1619
- component: "li",
1620
- variant: h < ee.length - 1 ? "inset" : "fullWidth"
1621
- }
1622
- )
1623
- ] }, g)),
1624
- a.is_manual && !a.parent_guid && !a.has_been_split && /* @__PURE__ */ e(Dt, { transaction: a })
1625
- ] }) })
1626
- ] })
1627
- ] }),
1628
- $ && S && /* @__PURE__ */ e(
1629
- ut,
1630
- {
1631
- ariaLabel: Le(
1632
- S?.dataSeries[K]?.date,
1633
- we.MONTH
1634
- ),
1635
- barChartProps: {
1636
- amounts: {
1637
- average: $.payload.average_amount,
1638
- formattedAverage: W($.payload.average_amount, "0,0")
1639
- },
1640
- color: ie.category?.color || "",
1641
- data: S.chartData,
1642
- margin: { bottom: 10, left: 24, right: 24, top: 20 },
1643
- monthlyAmountLabel: i.general.monthly_amount,
1644
- onBarClick: (g) => {
1645
- G(g);
1646
- },
1647
- trendAmountLabel: i.general.trend,
1648
- legendPosition: "top"
1649
- },
1650
- beat: {
1651
- heading: $.html_title,
1652
- subHeading: {
1653
- category_guid: a.category_guid ?? "",
1654
- merchant_guid: a.merchant_guid ?? "",
1655
- description: a.description ?? ""
1656
- }
1657
- },
1658
- data: S.chartData,
1659
- defaultSelectedIndex: K,
1660
- icon: /* @__PURE__ */ e(
1661
- Te,
1662
- {
1663
- alt: a.description ?? "",
1664
- categoryGuid: a.category_guid ?? "",
1665
- merchantGuid: a.merchant_guid ?? "",
1666
- size: 16
1667
- }
1668
- ),
1669
- isOpen: L,
1670
- onClose: () => {
1671
- P(!1), G(S.dataSeries.length - 1);
1672
- },
1673
- onTabChange: (g) => {
1674
- G(g);
1675
- },
1676
- tipSection: A ? void 0 : {
1677
- message: D(
1678
- i.general.tip_section_message,
1679
- /* @__PURE__ */ e("strong", { children: i.general.tip_section_title }),
1680
- /* @__PURE__ */ e("strong", { children: $.primary_transaction?.description })
1681
- ),
1682
- onDismiss: () => b(!0)
1683
- },
1684
- title: i.general.transaction_history_title,
1685
- transactionListProps: {
1686
- showLoader: w,
1687
- showInsights: !0,
1688
- transaction: te
1689
- }
1690
- }
1691
- )
1692
- ] });
1693
- }, er = O(oa);
1694
- export {
1695
- se as B,
1696
- At as C,
1697
- Nt as D,
1698
- Mt as M,
1699
- er as T,
1700
- qt as a,
1701
- ce as b,
1702
- Ct as c
1703
- };