@mx-cartographer/experiences 7.11.20 → 7.11.21

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.
Files changed (70) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{AccountDetailsHeader-DCTCLB3K.mjs → AccountDetailsHeader-DkBNsLsI.mjs} +2 -2
  3. package/dist/{AccountListItem-CZk-bo6j.mjs → AccountListItem-BIVhda6q.mjs} +2 -2
  4. package/dist/{AccountStore-Cw54qb7Y.mjs → AccountStore-Brc0MNSF.mjs} +1 -1
  5. package/dist/BudgetUtil--_QXyszn.mjs +479 -0
  6. package/dist/{CategorySelectorDrawer-Blb22HWt.mjs → CategorySelectorDrawer-5n6Pil_E.mjs} +1 -1
  7. package/dist/{Connect-Df7iVTcV.mjs → Connect-eYIWqCEr.mjs} +1 -1
  8. package/dist/{ConnectDrawer-CVt-8rPJ.mjs → ConnectDrawer-CioFo6Wy.mjs} +2 -2
  9. package/dist/{ConnectionsDrawer-c7HaKeRj.mjs → ConnectionsDrawer-DqhSaMrJ.mjs} +2 -2
  10. package/dist/{CurrencyInput-bcKNJ22c.mjs → CurrencyInput-DuMktPu3.mjs} +1 -1
  11. package/dist/{ExportCsvAction-B5Mn5uyb.mjs → ExportCsvAction-Bg6gO_Cz.mjs} +3 -3
  12. package/dist/{GlobalAccountFilter-CbwySv6c.mjs → GlobalAccountFilter-B73Pw1hJ.mjs} +1 -1
  13. package/dist/{GoalStore-DXIP9dLt.mjs → GoalStore-0bd-Upkc.mjs} +1 -1
  14. package/dist/{Help-COWDMsJq.mjs → Help-CINT6-wG.mjs} +1 -1
  15. package/dist/{LineChart-DVn1AamK.mjs → LineChart-B1qbKR8q.mjs} +1 -1
  16. package/dist/{ListItemAction-5YhgdUZW.mjs → ListItemAction-CfXGuY7a.mjs} +1 -1
  17. package/dist/{ManageIncome-_ZP3uPwX.mjs → ManageIncome-C0ddaiMR.mjs} +10 -10
  18. package/dist/{MicroWidgetContainer-CMES42I1.mjs → MicroWidgetContainer-B_EnfvCq.mjs} +1 -1
  19. package/dist/{MiniWidgetContainer-DhEx4qKi.mjs → MiniWidgetContainer-Cu72GNsE.mjs} +1 -1
  20. package/dist/{NotificationSettings-D8uSK6m9.mjs → NotificationSettings-DCbMa5mg.mjs} +4 -4
  21. package/dist/{OriginalBalanceAction-DuVHcBdO.mjs → OriginalBalanceAction-CW_xOa6Z.mjs} +3 -3
  22. package/dist/{RecurringSettings-CSrJUzaC.mjs → RecurringSettings-CD1_vCES.mjs} +2 -2
  23. package/dist/{SpendingLegend-Cpd_jtoX.mjs → SpendingLegend-DHi0vx8B.mjs} +1 -1
  24. package/dist/StatusIndicator-wyBzyHJc.mjs +252 -0
  25. package/dist/{Transaction-BR682Yj5.mjs → Transaction-B_2AG36b.mjs} +1 -1
  26. package/dist/TransactionDetails-CgC3Qu7o.mjs +1474 -0
  27. package/dist/{TransactionStore-BbjZQa-N.mjs → TransactionStore-DIbZkSVI.mjs} +2 -2
  28. package/dist/{ViewMoreMicroCard-Bf1J0zYY.mjs → ViewMoreMicroCard-CLHlPWC-.mjs} +1 -1
  29. package/dist/{WidgetContainer-DSs6lJbr.mjs → WidgetContainer-BSCjBupR.mjs} +2 -2
  30. package/dist/accounts/index.es.js +13 -13
  31. package/dist/analytics/index.es.js +11 -11
  32. package/dist/budgets/api/BudgetsApi.d.ts +2 -0
  33. package/dist/budgets/components/MerchantBudgetDetailsDrawer.d.ts +17 -0
  34. package/dist/budgets/components/shared/BudgetDetailsTopSection.d.ts +13 -0
  35. package/dist/budgets/index.es.js +550 -609
  36. package/dist/budgets/store/BudgetsStore.d.ts +6 -0
  37. package/dist/budgets/utils/BudgetUtil.d.ts +5 -0
  38. package/dist/cashflow/index.es.js +8 -8
  39. package/dist/categories/index.es.js +1 -1
  40. package/dist/common/index.es.js +254 -224
  41. package/dist/common/types/localization/BudgetsCopy.d.ts +4 -0
  42. package/dist/dashboard/index.es.js +4 -4
  43. package/dist/debts/index.es.js +8 -8
  44. package/dist/{exportTransactionsToCSV-CKHt_UOp.mjs → exportTransactionsToCSV-EwhjfqsJ.mjs} +1 -1
  45. package/dist/finstrong/index.es.js +10 -10
  46. package/dist/goals/index.es.js +10 -10
  47. package/dist/help/index.es.js +4 -4
  48. package/dist/{hooks-zu7yblbi.mjs → hooks-BxkfR-Ff.mjs} +5 -5
  49. package/dist/insights/index.es.js +103 -104
  50. package/dist/investments/index.es.js +4 -4
  51. package/dist/merchants/index.es.js +1 -1
  52. package/dist/microinsights/index.es.js +1 -1
  53. package/dist/networth/index.es.js +6 -6
  54. package/dist/notifications/index.es.js +2 -2
  55. package/dist/recurringtransactions/index.es.js +9 -9
  56. package/dist/settings/index.es.js +7 -7
  57. package/dist/spending/index.es.js +8 -8
  58. package/dist/transactions/components/shared/transactiondetails/actions/AddMerchantBudgetAction.d.ts +5 -0
  59. package/dist/transactions/components/shared/transactiondetails/actions/index.d.ts +1 -0
  60. package/dist/transactions/index.es.js +16 -16
  61. package/dist/trends/index.es.js +12 -12
  62. package/dist/{useAccountDisplayName-CxYB0Wpw.mjs → useAccountDisplayName-DKwT1mWv.mjs} +1 -1
  63. package/dist/{useInsightsEnabled-CYLDtNYt.mjs → useInsightsEnabled-DL_oNyI0.mjs} +1 -1
  64. package/dist/{useWidgetLoadTimer-Bmgv_UeH.mjs → useWidgetLoadTimer-DgN1bTyu.mjs} +1 -1
  65. package/package.json +1 -1
  66. package/dist/BudgetUtil-QbRXtLKn.mjs +0 -101
  67. package/dist/StatusIndicator-0iX3Gnnu.mjs +0 -55
  68. package/dist/TransactionDetails-BEKQKH03.mjs +0 -1261
  69. package/dist/TransactionList-CXiLG0Ur.mjs +0 -204
  70. package/dist/User-BIgPTsU6.mjs +0 -372
@@ -0,0 +1,1474 @@
1
+ import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
+ import d from "react";
3
+ import { observer as E } from "mobx-react-lite";
4
+ import K from "@mui/material/Box";
5
+ import de from "@mui/material/Divider";
6
+ import ue from "@mui/material/List";
7
+ import le from "@mui/material/Paper";
8
+ import v from "@mui/material/Stack";
9
+ import { useTheme as j } from "@mui/material/styles";
10
+ import { P as Y, Text as x, H2 as Be, MerchantLogo as Ae, Toast as $e, CategoryIcon as Ne, CategoryIconVariants as De, TextField as Ie, Icon as ce, IconWeight as be } from "@mxenabled/mxui";
11
+ import { g as Ke, C as Fe, a as He, b as Ue, i as Ve } from "./BudgetUtil--_QXyszn.mjs";
12
+ import oe from "@mui/material/Button";
13
+ import ze from "@mui/material/FormGroup";
14
+ import ne from "@mui/material/IconButton";
15
+ import Oe from "@mui/material/TextField";
16
+ import { u as pe } from "./useAriaLive-MkYebyUR.mjs";
17
+ import { O as y } from "./Transaction-B_2AG36b.mjs";
18
+ import { u as I, h as O, m as We, d as Ye, l as Le, g as w, b as Xe, o as je } from "./hooks-BxkfR-Ff.mjs";
19
+ import { A as F } from "./Analytics-i5h6BxR1.mjs";
20
+ import qe from "@mui/material/ToggleButton";
21
+ import we from "@mui/material/styles/useTheme";
22
+ import { ChevronRight as Re, Icon as D, Delete as _e, Cancel as me, Search as Je, Edit as Qe, Flag as Ze } from "@mxenabled/mx-icons";
23
+ import { fromUnixTime as Se } from "date-fns/fromUnixTime";
24
+ import H from "@mui/material/Avatar";
25
+ import G from "@mui/material/ListItem";
26
+ import U from "@mui/material/ListItemAvatar";
27
+ import B from "@mui/material/ListItemText";
28
+ import { f as Me, D as ke } from "./DateFormats-BMpMrZpW.mjs";
29
+ import V from "@mui/material/ListItemButton";
30
+ import z from "@mui/material/ListItemIcon";
31
+ import { a as Pe } from "./CategorySelectorDrawer-5n6Pil_E.mjs";
32
+ import { b as et, T as tt, u as J } from "./StatusIndicator-wyBzyHJc.mjs";
33
+ import { D as q } from "./Dialog-DdCwLgrl.mjs";
34
+ import { b as N } from "./Localization-CPkpIwIx.mjs";
35
+ import { getUnixTime as rt } from "date-fns/getUnixTime";
36
+ import { D as ie } from "./Drawer-DV4NTsFg.mjs";
37
+ import { f as X } from "./NumberFormatting-QCaNwbjv.mjs";
38
+ import Ee from "@mui/material/InputAdornment";
39
+ import at from "@mui/material/Checkbox";
40
+ import { startOfMonth as nt } from "date-fns/startOfMonth";
41
+ import { endOfMonth as ot } from "date-fns/endOfMonth";
42
+ import { i as it } from "./DateUtil-wcYTmDRD.mjs";
43
+ import xe from "@mui/material/Grid";
44
+ import { C as st } from "./CurrencyInput-DuMktPu3.mjs";
45
+ import lt from "@mui/material/Switch";
46
+ import { L as ct } from "./Loader-D3rjKx72.mjs";
47
+ var re = /* @__PURE__ */ ((t) => (t[t.Category = 0] = "Category", t[t.Date = 1] = "Date", t[t.Memo = 2] = "Memo", t[t.Tags = 3] = "Tags", t))(re || {}), ae = /* @__PURE__ */ ((t) => (t[t.MerchantBudget = 0] = "MerchantBudget", t[t.SplitTransaction = 1] = "SplitTransaction", t[t.HideTransaction = 2] = "HideTransaction", t[t.MerchantLogo = 3] = "MerchantLogo", t))(ae || {});
48
+ const dt = [
49
+ 0,
50
+ 1,
51
+ 2,
52
+ 3
53
+ /* Tags */
54
+ ], ut = [
55
+ 1,
56
+ 2,
57
+ 3
58
+ /* MerchantLogo */
59
+ ], _t = ({
60
+ startDate: t,
61
+ onViewHistory: n,
62
+ totalTransaction: i,
63
+ amount: r,
64
+ spentPercentage: a,
65
+ remainingAmount: o,
66
+ iconColor: s,
67
+ icon: c
68
+ }) => {
69
+ const { budgets: m } = I();
70
+ return /* @__PURE__ */ e(d.Fragment, { children: /* @__PURE__ */ l(
71
+ K,
72
+ {
73
+ sx: {
74
+ bgcolor: "background.paper",
75
+ borderBottomColor: "divider",
76
+ borderBottomStyle: "solid",
77
+ borderBottomWidth: 1
78
+ },
79
+ children: [
80
+ /* @__PURE__ */ l(
81
+ v,
82
+ {
83
+ sx: {
84
+ alignItems: "center",
85
+ flexDirection: "row",
86
+ gap: 12,
87
+ justifyContent: "space-between",
88
+ pt: 16,
89
+ px: 24
90
+ },
91
+ children: [
92
+ /* @__PURE__ */ e(Y, { bold: !0, variant: "subtitle1", children: it(t) }),
93
+ n && /* @__PURE__ */ e(oe, { endIcon: /* @__PURE__ */ e(Re, {}), onClick: n, sx: { height: 28 }, children: /* @__PURE__ */ e(x, { bold: !0, variant: "body2", children: m.spending_history }) })
94
+ ]
95
+ }
96
+ ),
97
+ /* @__PURE__ */ e(
98
+ et,
99
+ {
100
+ amount: /* @__PURE__ */ l(v, { sx: { alignItems: "baseline", flexDirection: "row", gap: 4 }, children: [
101
+ /* @__PURE__ */ e(Be, { children: X(i, "0,0.00") }),
102
+ /* @__PURE__ */ e(Y, { color: "text.secondary", variant: "body2", children: "/" }),
103
+ /* @__PURE__ */ e(Y, { color: "text.secondary", variant: "body2", children: X(r, "0,0.00") })
104
+ ] }),
105
+ completeColor: `${s}.main`,
106
+ icon: c,
107
+ label: m.spent_label,
108
+ leftLabel: N(m.percent_spent, a.toFixed()),
109
+ percentComplete: a,
110
+ rightLabel: N(
111
+ m.balance_left,
112
+ X(o, "0,0.00")
113
+ ),
114
+ sx: {
115
+ pb: 24,
116
+ pt: 16,
117
+ px: 24
118
+ }
119
+ }
120
+ )
121
+ ]
122
+ }
123
+ ) });
124
+ }, mt = ({
125
+ merchantBudget: t,
126
+ transaction: n,
127
+ onClose: i,
128
+ isOpen: r,
129
+ setCurrencyDialogAction: a,
130
+ renderingToast: o
131
+ }) => {
132
+ const { budgets: s, common: c } = I(), { sortedTransactions: m } = O(), u = d.useMemo(() => m.reduce((h, f) => f.parent_guid ? h : h + f.amount, 0), [m]), { remainingAmount: p, spentPercentage: _, iconColor: g } = Ke(
133
+ u,
134
+ t.amount ?? 0
135
+ );
136
+ return /* @__PURE__ */ l(
137
+ ie,
138
+ {
139
+ ariaLabelClose: c.close_aria,
140
+ footerStyles: {
141
+ px: 24,
142
+ py: 16
143
+ },
144
+ isOpen: r,
145
+ onClose: i,
146
+ onPrimaryAction: () => a(fe.EDIT),
147
+ onSecondaryAction: () => {
148
+ a(fe.DELETE);
149
+ },
150
+ primaryText: s.details_edit_button,
151
+ secondaryColor: "error",
152
+ secondaryText: s.details_delete_button,
153
+ sx: {
154
+ "& .list-wrapper": {
155
+ pr: 24
156
+ }
157
+ },
158
+ title: N(s.details_type_title, t.merchant_name),
159
+ children: [
160
+ /* @__PURE__ */ e(
161
+ _t,
162
+ {
163
+ amount: t.amount,
164
+ icon: /* @__PURE__ */ e(
165
+ Ae,
166
+ {
167
+ categoryGuid: n.top_level_category_guid || "",
168
+ merchantGuid: n.merchant_guid || ""
169
+ }
170
+ ),
171
+ iconColor: g,
172
+ remainingAmount: p,
173
+ spentPercentage: _,
174
+ startDate: n.date,
175
+ totalTransaction: u
176
+ }
177
+ ),
178
+ /* @__PURE__ */ e(tt, {}),
179
+ o?.()
180
+ ]
181
+ }
182
+ );
183
+ }, pt = E(mt);
184
+ var fe = /* @__PURE__ */ ((t) => (t.CREATE = "create", t.EDIT = "edit", t.DELETE = "delete", t))(fe || {});
185
+ const gt = E(({ transaction: t }) => {
186
+ const [n, i] = d.useState(null), [r, a] = d.useState(""), [o, s] = d.useState(!1), c = d.useRef(!1), [m, u] = d.useState(null), p = j(), {
187
+ addMerchantBudget: _,
188
+ updateMerchantBudget: g,
189
+ deleteMerchantBudget: h,
190
+ getMerchantBudgetByMerchantGuid: f,
191
+ alert: L,
192
+ setAlert: M
193
+ } = We(), { setFilter: S } = O(), { accounts: T } = Ye(), R = p.palette.mode === "dark" ? "grey.800" : "grey.100", { budgets: C, common: Q } = I(), { announce: ge, ariaLive: he } = pe(), [Z, ee] = d.useState(!1), W = t?.merchant_guid ? f(t.merchant_guid) : void 0, te = () => {
194
+ u(n), i(null), a("");
195
+ }, ye = () => {
196
+ W ? ee(!0) : i(
197
+ "create"
198
+ /* CREATE */
199
+ );
200
+ }, b = {
201
+ create: {
202
+ content: N(
203
+ C.create_budget_content,
204
+ /* @__PURE__ */ e("strong", { children: t.description }),
205
+ `${X(t.amount, "0,0.00")}`
206
+ ),
207
+ title: C.dialog_create_budget_title,
208
+ primaryButtonText: C.dialog_primary_button_text,
209
+ errorAlertMessage: N(
210
+ C.alert_merchant_budget_not_created,
211
+ t.description
212
+ ),
213
+ errorRetryAction: () => i(
214
+ "create"
215
+ /* CREATE */
216
+ ),
217
+ successAlertMessage: N(
218
+ C.alert_budget_created,
219
+ t.description
220
+ ),
221
+ apiTrigger: async () => await _(t.merchant_guid, Number(r))
222
+ },
223
+ edit: {
224
+ content: N(
225
+ C.edit_budget_content,
226
+ /* @__PURE__ */ e("strong", { children: t.description })
227
+ ),
228
+ title: C.details_edit_title,
229
+ primaryButtonText: C.add_save_button,
230
+ errorAlertMessage: N(
231
+ C.error_alert_edit_merchant_budget,
232
+ t.description
233
+ ),
234
+ errorRetryAction: () => i(
235
+ "edit"
236
+ /* EDIT */
237
+ ),
238
+ successAlertMessage: N(
239
+ C.success_alert_edit_merchant_budget,
240
+ t.description
241
+ ),
242
+ apiTrigger: async () => await g({
243
+ ...W,
244
+ amount: Number(r)
245
+ })
246
+ },
247
+ delete: {
248
+ content: N(
249
+ C.delete_description,
250
+ /* @__PURE__ */ e("strong", { children: t.description })
251
+ ),
252
+ title: C.delete_title,
253
+ primaryButtonText: C.details_delete_button,
254
+ errorAlertMessage: N(
255
+ C.error_alert_delete_merchant_budget,
256
+ t.description
257
+ ),
258
+ errorRetryAction: () => i(
259
+ "delete"
260
+ /* DELETE */
261
+ ),
262
+ successAlertMessage: N(
263
+ C.success_alert_delete_merchant_budget,
264
+ t.description
265
+ ),
266
+ apiTrigger: async () => await h(W.guid)
267
+ }
268
+ }, k = async () => {
269
+ if (c.current) return;
270
+ c.current = !0;
271
+ const { apiTrigger: $, successAlertMessage: P, errorAlertMessage: Te } = b[n], { isSuccess: Ce } = await $(), ve = Ce ? P : Te;
272
+ te(), s(!Ce), M(ve), ge(ve), Ce && n === "delete" && ee(!1), c.current = !1;
273
+ };
274
+ d.useEffect(() => {
275
+ const $ = {
276
+ start: nt(new Date(t.date * 1e3)),
277
+ end: ot(new Date(t.date * 1e3))
278
+ };
279
+ S({
280
+ accounts: T.map((P) => P.guid),
281
+ custom: Z ? (P) => P.merchant_guid === t.merchant_guid : (P) => P.guid === t.guid,
282
+ dateRange: $
283
+ });
284
+ }, [Z, t, T]);
285
+ const A = () => /* @__PURE__ */ e(
286
+ $e,
287
+ {
288
+ actionText: C.autogenerate_budgets_error_primary_button,
289
+ autoHideDuration: 3500,
290
+ handleClose: () => M(""),
291
+ message: L,
292
+ multiLine: !0,
293
+ onActionClick: b[m]?.errorRetryAction,
294
+ open: !!L,
295
+ severity: o ? "error" : "success",
296
+ showAction: o,
297
+ showClose: !0,
298
+ snackbarSx: {
299
+ //TODO - remove the customization and update the Toast component in MXUI in the upcoming ticket (WEC-1162) to handle multi-line messages and long action text
300
+ "& .MuiAlert-root": {
301
+ alignItems: "self-start",
302
+ minHeight: 0,
303
+ "& .MuiAlert-message": {
304
+ pt: 8
305
+ }
306
+ },
307
+ "&.MuiSnackbar-root": {
308
+ width: "fit-content",
309
+ zIndex: 9999
310
+ // Higher than Drawer's default 1200
311
+ },
312
+ "& .MuiAlert-action .MuiStack-root": {
313
+ flexDirection: "row",
314
+ display: "flex",
315
+ alignItems: "center",
316
+ width: "max-content"
317
+ }
318
+ }
319
+ }
320
+ );
321
+ return /* @__PURE__ */ l(d.Fragment, { children: [
322
+ he,
323
+ /* @__PURE__ */ e(G, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ l(V, { onClick: ye, children: [
324
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(H, { sx: { bgcolor: R }, variant: "rounded", children: /* @__PURE__ */ e(D, { name: "bubble_chart", sx: { color: "text.primary" } }) }) }),
325
+ /* @__PURE__ */ e(
326
+ B,
327
+ {
328
+ primary: C.add_merchant_budget_primary_text,
329
+ primaryTypographyProps: { variant: "caption" },
330
+ secondary: /* @__PURE__ */ e(x, { bold: !0, sx: { color: "text.primary" }, variant: "body1", children: W ? `${X(W.amount, "0,0.00")} / ${Q.month_text}` : C.add_merchant_budget_secondary_text })
331
+ }
332
+ ),
333
+ /* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(D, { name: "chevron_right", sx: { color: "text.primary" } }) })
334
+ ] }) }),
335
+ !!W && /* @__PURE__ */ e(
336
+ pt,
337
+ {
338
+ isOpen: Z,
339
+ merchantBudget: W,
340
+ onClose: () => ee(!1),
341
+ renderingToast: () => L && A(),
342
+ setCurrencyDialogAction: i,
343
+ transaction: t
344
+ }
345
+ ),
346
+ n && /* @__PURE__ */ e(
347
+ Fe,
348
+ {
349
+ closeAriaLabel: Q.close_aria,
350
+ content: b[n].content,
351
+ handleInputChange: a,
352
+ handleModalClose: te,
353
+ handlePrimaryAction: k,
354
+ handleSecondaryAction: te,
355
+ inputLabel: n !== "delete" ? Q.amount_text : "",
356
+ inputValue: r,
357
+ isOpen: !!n,
358
+ primaryText: b[n].primaryButtonText,
359
+ secondaryText: Q.cancel_button,
360
+ title: b[n].title
361
+ }
362
+ ),
363
+ !!L && A()
364
+ ] });
365
+ }), ht = ({ transaction: t }) => {
366
+ const { addOrUpdateTransactionRule: n, updateTransaction: i } = O(), { categories: r } = Le(), { onEvent: a } = w(), { setShouldDisableDrawerScroll: o, updateManualTransaction: s } = J(), { transactions: c } = I(), m = j(), [u, p] = d.useState(!1), [_, g] = d.useState(""), h = async (T) => {
367
+ await i({ ...t, category_guid: _ }), T && await n(_, t), g(""), a(F.TRANSACTION_DETAILS_CLICK_CATEGORY, {
368
+ transaction_guid: t.guid
369
+ });
370
+ }, f = (T) => {
371
+ if (t.is_manual && !t.guid) {
372
+ const R = r.find((C) => C.guid === T);
373
+ s({
374
+ ...t,
375
+ category: R?.name,
376
+ category_guid: T,
377
+ top_level_category_guid: R?.parent_guid || T
378
+ });
379
+ } else
380
+ g(T);
381
+ L();
382
+ }, L = () => {
383
+ p(!1), o(!1);
384
+ }, M = d.useMemo(
385
+ () => r.find((T) => T.guid === _),
386
+ [_]
387
+ ), S = m.palette.mode === "dark" ? "grey.800" : "grey.100";
388
+ return /* @__PURE__ */ l(G, { disableGutters: !0, disablePadding: !0, children: [
389
+ /* @__PURE__ */ l(
390
+ V,
391
+ {
392
+ onClick: () => {
393
+ a(y.ON_TRANSACTION_CATEGORY_CLICK), p(!0);
394
+ },
395
+ children: [
396
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(H, { sx: { bgcolor: S }, variant: "rounded", children: /* @__PURE__ */ e(
397
+ Ne,
398
+ {
399
+ categoryGuid: t.top_level_category_guid,
400
+ size: 24,
401
+ sx: { color: "text.primary" },
402
+ variant: De.Transparent
403
+ }
404
+ ) }) }),
405
+ /* @__PURE__ */ e(
406
+ B,
407
+ {
408
+ primary: c.category_title,
409
+ primaryTypographyProps: { variant: "XSmall" },
410
+ secondary: /* @__PURE__ */ e(x, { bold: !0, sx: { color: "text.primary" }, variant: "Body", children: t.category ?? c.actions_select_a_category })
411
+ }
412
+ ),
413
+ /* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(D, { name: "chevron_right", sx: { color: "text.primary" } }) })
414
+ ]
415
+ }
416
+ ),
417
+ /* @__PURE__ */ e(
418
+ Pe,
419
+ {
420
+ initialSelected: t.category_guid,
421
+ onClose: L,
422
+ onSelect: f,
423
+ showDrawer: u,
424
+ title: c.actions_select_a_category
425
+ }
426
+ ),
427
+ /* @__PURE__ */ e(
428
+ q,
429
+ {
430
+ copy: {
431
+ title: N(
432
+ c.actions_apply_to_all_transaction_types,
433
+ t.description
434
+ )
435
+ },
436
+ isOpen: !!_,
437
+ onClose: () => g(""),
438
+ onPrimaryAction: () => h(!0),
439
+ onSecondaryAction: () => h(!1),
440
+ primaryText: c.actions_apply_to_all,
441
+ secondaryText: c.actions_this_time_only,
442
+ children: /* @__PURE__ */ e(Y, { variant: "Paragraph", children: N(
443
+ c.actions_all_past_and_future,
444
+ t.description,
445
+ M?.name
446
+ ) })
447
+ }
448
+ )
449
+ ] });
450
+ }, yt = ({ transaction: t }) => {
451
+ const { onEvent: n } = w(), { updateTransaction: i } = O(), { updateManualTransaction: r } = J(), { common: a, transactions: o } = I(), s = j(), [c, m] = d.useState(!1), [u, p] = d.useState(t.date), _ = (f) => {
452
+ p(rt(f));
453
+ }, g = async () => {
454
+ if (t.is_manual && !t.guid) {
455
+ r({ ...t, date: u }), m(!1);
456
+ return;
457
+ }
458
+ await i({ ...t, date: u }), n(F.TRANSACTION_DETAILS_CLICK_DATE, { transaction_guid: t.guid }), m(!1);
459
+ }, h = s.palette.mode === "dark" ? "grey.800" : "grey.100";
460
+ return /* @__PURE__ */ l(G, { className: "mx-txn-date-action", disableGutters: !0, disablePadding: !0, children: [
461
+ /* @__PURE__ */ l(
462
+ V,
463
+ {
464
+ onClick: () => {
465
+ n(y.ON_TRANSACTION_DATE_CLICK), m(!0);
466
+ },
467
+ children: [
468
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(H, { sx: { bgcolor: h }, variant: "rounded", children: /* @__PURE__ */ e(D, { name: "calendar_month", sx: { color: "text.primary" } }) }) }),
469
+ /* @__PURE__ */ e(
470
+ B,
471
+ {
472
+ primary: o.date_title,
473
+ primaryTypographyProps: { variant: "XSmall" },
474
+ secondary: /* @__PURE__ */ e(x, { bold: !0, sx: { color: "text.primary" }, variant: "Body", children: Me(Se(t.date), ke.YEAR_MONTH_DAY) })
475
+ }
476
+ ),
477
+ /* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(D, { name: "chevron_right", sx: { color: "text.primary" } }) })
478
+ ]
479
+ }
480
+ ),
481
+ /* @__PURE__ */ e(
482
+ ie,
483
+ {
484
+ ariaLabelClose: a.close_aria,
485
+ isOpen: c,
486
+ onClose: () => m(!1),
487
+ onPrimaryAction: g,
488
+ primaryText: a.save_button,
489
+ secondaryText: a.cancel_button,
490
+ title: o.date_edit_title,
491
+ children: /* @__PURE__ */ e(v, { alignItems: "center", mt: 40, children: /* @__PURE__ */ e(
492
+ He,
493
+ {
494
+ beginDate: Se(u),
495
+ copy: {
496
+ nextAria: o.date_next_aria,
497
+ prevAria: o.date_prev_aria,
498
+ today: a.date_range_picker.today
499
+ },
500
+ onDateSelected: _,
501
+ selectionType: Ue.Single
502
+ }
503
+ ) })
504
+ }
505
+ )
506
+ ] });
507
+ }, Tt = ({ transaction: t }) => {
508
+ const { onEvent: n } = w(), { removeTransaction: i } = O(), { setShouldDisableDrawerScroll: r } = J(), { common: a, transactions: o } = I(), [s, c] = d.useState(!1), m = async () => {
509
+ await i(t.guid), n(y.ON_TRANSACTION_DELETE_DELETED);
510
+ };
511
+ return /* @__PURE__ */ l(K, { className: "mx-txn-delete", children: [
512
+ t && /* @__PURE__ */ e(G, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ l(
513
+ V,
514
+ {
515
+ onClick: () => {
516
+ n(y.ON_TRANSACTION_DELETE_CLICK), r(!0), c(!0);
517
+ },
518
+ children: [
519
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(H, { variant: "rounded", children: /* @__PURE__ */ e(_e, { color: "secondary", fontSize: "small" }) }) }),
520
+ /* @__PURE__ */ e(
521
+ B,
522
+ {
523
+ primary: o.manual_transaction_delete_title,
524
+ secondary: o.manual_transaction_delete_subtitle
525
+ }
526
+ ),
527
+ /* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(_e, {}) })
528
+ ]
529
+ }
530
+ ) }),
531
+ /* @__PURE__ */ e(
532
+ q,
533
+ {
534
+ copy: { title: o.manual_transaction_delete_title },
535
+ isOpen: s,
536
+ onClose: () => {
537
+ r(!1), c(!1);
538
+ },
539
+ onPrimaryAction: m,
540
+ onSecondaryAction: () => n(y.ON_TRANSACTION_DELETE_CANCEL),
541
+ primaryText: a.delete_button,
542
+ secondaryText: a.cancel_button,
543
+ children: /* @__PURE__ */ e(x, { sx: { whiteSpace: "normal" }, variant: "Paragraph", children: o.manual_transaction_delete_description })
544
+ }
545
+ )
546
+ ] });
547
+ }, Ct = E(Tt), bt = ({ transaction: t }) => {
548
+ const { onEvent: n } = w(), { updateTransaction: i } = O(), { setShouldDisableDrawerScroll: r } = J(), { common: a, transactions: o } = I(), s = j(), [c, m] = d.useState(!1), u = async () => {
549
+ await i({ ...t, merchant_guid: "" }), n(F.TRANSACTION_DETAILS_CLICK_DELETE_LOGO, {
550
+ transaction_guid: t.guid
551
+ });
552
+ }, p = s.palette.mode === "dark" ? "grey.800" : "grey.100";
553
+ return /* @__PURE__ */ e(d.Fragment, { children: t && /* @__PURE__ */ l(G, { className: "mx-txn-delete-logo", disableGutters: !0, disablePadding: !0, children: [
554
+ /* @__PURE__ */ l(
555
+ V,
556
+ {
557
+ onClick: () => {
558
+ n(y.ON_TRANSACTION_DELETE_LOGO_CLICK), m(!0);
559
+ },
560
+ children: [
561
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(H, { sx: { bgcolor: p }, variant: "rounded", children: /* @__PURE__ */ e(D, { name: "delete", sx: { color: "text.primary" } }) }) }),
562
+ /* @__PURE__ */ e(B, { primary: o.merchant_logo_title, secondary: o.merchant_logo_desc }),
563
+ /* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(D, { name: "chevron_right", sx: { color: "text.primary" } }) })
564
+ ]
565
+ }
566
+ ),
567
+ /* @__PURE__ */ l(
568
+ q,
569
+ {
570
+ copy: { title: o.merchant_logo_modal_title },
571
+ isOpen: c,
572
+ onClose: () => {
573
+ r(!1), m(!1);
574
+ },
575
+ onPrimaryAction: u,
576
+ onSecondaryAction: () => n(y.ON_TRANSACTION_DELETE_LOGO_CANCEL),
577
+ primaryText: a.delete_button,
578
+ secondaryText: a.cancel_button,
579
+ title: o.merchant_logo_modal_title,
580
+ children: [
581
+ /* @__PURE__ */ e(x, { sx: { whiteSpace: "normal" }, variant: "Paragraph", children: o.merchant_logo_modal_desc }),
582
+ /* @__PURE__ */ e(x, { bold: !0, sx: { whiteSpace: "normal" }, variant: "Paragraph", children: ` ${o.merchant_logo_modal_desc_bold}` })
583
+ ]
584
+ }
585
+ )
586
+ ] }) });
587
+ }, xt = E(bt), St = ({ transaction: t }) => {
588
+ const { onEvent: n } = w(), { updateTransaction: i } = O(), { setShouldDisableDrawerScroll: r } = J(), { common: a, transactions: o } = I(), s = j(), [c, m] = d.useState(!1), u = t.is_hidden, p = async () => {
589
+ await i({ ...t, is_hidden: !t.is_hidden }), n(
590
+ u ? y.ON_TRANSACTION_UNHIDDEN : y.ON_TRANSACTION_HIDDEN
591
+ );
592
+ }, _ = s.palette.mode === "dark" ? "grey.800" : "grey.100";
593
+ return /* @__PURE__ */ e(d.Fragment, { children: t && /* @__PURE__ */ l(G, { className: "mx-txn-hide-transaction", disableGutters: !0, disablePadding: !0, children: [
594
+ /* @__PURE__ */ l(
595
+ V,
596
+ {
597
+ "aria-checked": u,
598
+ "aria-labelledby": "hide-transaction-text",
599
+ onClick: () => {
600
+ n(
601
+ u ? y.ON_TRANSACTION_UNHIDE_CLICK : y.ON_TRANSACTION_HIDE_CLICK
602
+ ), n(
603
+ u ? "transaction_details_click_unhide_transaction" : "transaction_details_click_hide_transaction",
604
+ {
605
+ transaction_guid: t.guid
606
+ }
607
+ ), m(!0);
608
+ },
609
+ role: "switch",
610
+ children: [
611
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(H, { sx: { bgcolor: _ }, variant: "rounded", children: u ? /* @__PURE__ */ e(D, { name: "visibility_off", sx: { color: "text.primary" } }) : /* @__PURE__ */ e(D, { name: "visibility", sx: { color: "text.primary" } }) }) }),
612
+ /* @__PURE__ */ e(
613
+ B,
614
+ {
615
+ id: "hide-transaction-text",
616
+ primary: u ? o.hide_trnx_subtitle_unhide_trnx : o.hide_trnx_subtitle_hide_trnx,
617
+ secondary: u ? o.hide_trnx_desc_unhiding : o.hide_trnx_desc_hiding
618
+ }
619
+ ),
620
+ /* @__PURE__ */ e(z, { "aria-hidden": "true", children: /* @__PURE__ */ e(
621
+ lt,
622
+ {
623
+ checked: u,
624
+ inputProps: { tabIndex: -1 },
625
+ sx: { pointerEvents: "none" },
626
+ tabIndex: -1
627
+ }
628
+ ) })
629
+ ]
630
+ }
631
+ ),
632
+ /* @__PURE__ */ e(
633
+ q,
634
+ {
635
+ copy: {
636
+ title: u ? o.hide_trnx_subtitle_unhide_trnx : o.hide_trnx_subtitle_hide_trnx
637
+ },
638
+ isOpen: c,
639
+ onClose: () => {
640
+ r(!1), m(!1);
641
+ },
642
+ onPrimaryAction: p,
643
+ onSecondaryAction: () => n(
644
+ u ? y.ON_TRANSACTION_UNHIDE_CANCEL_CLICK : y.ON_TRANSACTION_HIDE_CANCEL_CLICK
645
+ ),
646
+ primaryText: u ? a.unhide_button : a.hide_button,
647
+ secondaryText: a.cancel_button,
648
+ children: /* @__PURE__ */ e(x, { truncate: !1, variant: "Paragraph", children: u ? o.hide_trnx_desc_unhiding : o.hide_trnx_desc_hiding })
649
+ }
650
+ )
651
+ ] }) });
652
+ }, ft = E(St), Ge = ({ transaction: t }) => {
653
+ const { amount: n, description: i, isIncome: r, merchant_guid: a, payee: o, top_level_category_guid: s } = t;
654
+ return /* @__PURE__ */ l(v, { className: "mx-txn-amount-header", direction: "row", gap: 12, px: 16, py: 24, children: [
655
+ /* @__PURE__ */ e(
656
+ Ae,
657
+ {
658
+ categoryGuid: s || "",
659
+ merchantGuid: a || "",
660
+ size: 64
661
+ }
662
+ ),
663
+ /* @__PURE__ */ l(v, { overflow: "hidden'", children: [
664
+ /* @__PURE__ */ e(x, { bold: !0, mb: 4, truncate: !0, variant: "Body", children: i || o }),
665
+ /* @__PURE__ */ l(Y, { color: r ? "success.main" : "text.primary", truncate: !0, variant: "H1", children: [
666
+ r ? "+" : "",
667
+ X(n, "0,0.00")
668
+ ] })
669
+ ] })
670
+ ] });
671
+ }, At = ({ transaction: t }) => {
672
+ const { onEvent: n } = w(), { updateTransaction: i } = O(), { updateManualTransaction: r } = J(), { common: a, transactions: o } = I(), s = j(), [c, m] = d.useState(!1), [u, p] = d.useState("");
673
+ d.useEffect(() => {
674
+ c && p(t.memo ? t.memo : "");
675
+ }, [c]);
676
+ const _ = async () => {
677
+ if (t.is_manual && !t.guid) {
678
+ r({ ...t, memo: u }), m(!1);
679
+ return;
680
+ }
681
+ await i({ ...t, memo: u }), n(F.TRANSACTION_DETAILS_CLICK_MEMO, { transaction_guid: t.guid }), m(!1);
682
+ }, g = s.palette.mode === "dark" ? "grey.800" : "grey.100";
683
+ return /* @__PURE__ */ l(G, { className: "mx-txn-memo-action", disableGutters: !0, disablePadding: !0, children: [
684
+ /* @__PURE__ */ l(
685
+ V,
686
+ {
687
+ onClick: () => {
688
+ n(y.ON_TRANSACTION_MEMO_CLICK), m(!0);
689
+ },
690
+ children: [
691
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(H, { sx: { bgcolor: g }, variant: "rounded", children: /* @__PURE__ */ e(D, { name: "article", sx: { color: "text.primary" } }) }) }),
692
+ /* @__PURE__ */ e(
693
+ B,
694
+ {
695
+ primary: o.memo_title,
696
+ primaryTypographyProps: { variant: "XSmall" },
697
+ secondary: /* @__PURE__ */ e(
698
+ x,
699
+ {
700
+ bold: !0,
701
+ sx: { overflowWrap: "break-word", whiteSpace: "wrap", color: "text.primary" },
702
+ variant: "Body",
703
+ children: t.memo ? t.memo : o.memo_desc
704
+ }
705
+ )
706
+ }
707
+ ),
708
+ /* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(D, { name: "chevron_right", sx: { color: "text.primary" } }) })
709
+ ]
710
+ }
711
+ ),
712
+ /* @__PURE__ */ l(
713
+ ie,
714
+ {
715
+ ariaLabelClose: a.close_aria,
716
+ isOpen: c,
717
+ onClose: () => m(!1),
718
+ onPrimaryAction: _,
719
+ title: o.memo_title,
720
+ children: [
721
+ /* @__PURE__ */ e(Ge, { transaction: t }),
722
+ /* @__PURE__ */ e(
723
+ Oe,
724
+ {
725
+ "aria-label": o.memo_desc_aria,
726
+ focused: !0,
727
+ multiline: !0,
728
+ name: "memo",
729
+ onChange: (h) => p(h.target.value),
730
+ placeholder: o.memo_desc,
731
+ rows: 4,
732
+ sx: { mx: 16, width: "calc(100% - 32px)" },
733
+ value: u
734
+ }
735
+ )
736
+ ]
737
+ }
738
+ )
739
+ ] });
740
+ }, Nt = E(At), It = ({
741
+ index: t,
742
+ onDeleteRow: n,
743
+ onCategoryChanged: i,
744
+ onUpdateAmount: r,
745
+ split: a
746
+ }) => {
747
+ const { onEvent: o } = w(), { transactions: s } = I(), [c, m] = d.useState(`${a.amount}`), [u, p] = d.useState(!1), _ = t === 0, g = (h) => {
748
+ isNaN(Number(h)) || (m(h), r(t, Number(h)));
749
+ };
750
+ return /* @__PURE__ */ l(K, { bgcolor: "background.paper", className: "mx-txn-split-manager-row", pb: 4, px: 8, children: [
751
+ /* @__PURE__ */ l(xe, { alignItems: _ ? "center" : "start", container: !0, children: [
752
+ /* @__PURE__ */ e(xe, { item: !0, xs: 7, children: /* @__PURE__ */ l(v, { alignItems: "start", children: [
753
+ /* @__PURE__ */ e(
754
+ oe,
755
+ {
756
+ endIcon: /* @__PURE__ */ e(Re, {}),
757
+ onClick: () => p(!0),
758
+ startIcon: /* @__PURE__ */ e(Ne, { categoryGuid: a.top_level_category_guid }),
759
+ sx: { px: 12, py: 8 },
760
+ children: a.category
761
+ }
762
+ ),
763
+ /* @__PURE__ */ e(K, { children: !a.category_guid && /* @__PURE__ */ l(v, { color: "error.main", direction: "row", gap: 8, p: 12, children: [
764
+ /* @__PURE__ */ e("span", { "aria-label": "error", role: "img", children: /* @__PURE__ */ e(me, { sx: { fontSize: 15 } }) }),
765
+ /* @__PURE__ */ e(x, { variant: "Small", children: s.split_transaction_errors_select_category })
766
+ ] }) })
767
+ ] }) }),
768
+ /* @__PURE__ */ e(xe, { item: !0, xs: 5, children: _ ? /* @__PURE__ */ e("div", { className: "mx-txn-split-manager-row-top-container", children: /* @__PURE__ */ e(x, { children: X(a.amount, "0,0.00") }) }) : /* @__PURE__ */ l(v, { alignItems: "start", children: [
769
+ /* @__PURE__ */ l(v, { alignItems: "start", direction: "row", gap: 8, children: [
770
+ /* @__PURE__ */ e(
771
+ st,
772
+ {
773
+ amount: c,
774
+ ariaLabel: s.split_transaction_edit_split_amount,
775
+ label: s.split_transaction_edit_split_amount,
776
+ minAmount: 0.01,
777
+ name: "split-amount-input",
778
+ setAmount: g,
779
+ sx: {
780
+ ".MuiOutlinedInput-input": { p: 12 }
781
+ },
782
+ type: "number"
783
+ }
784
+ ),
785
+ /* @__PURE__ */ e(
786
+ ne,
787
+ {
788
+ "aria-label": s.split_transaction_delete_split_btn,
789
+ color: "secondary",
790
+ onClick: () => {
791
+ o(y.ON_TRANSACTION_SPLIT_DELETE_CLICK), n(t);
792
+ },
793
+ sx: { w: 44, h: 44 },
794
+ children: /* @__PURE__ */ e(_e, {})
795
+ }
796
+ )
797
+ ] }),
798
+ !c && /* @__PURE__ */ l(v, { color: "error.main", direction: "row", gap: 8, py: 12, children: [
799
+ /* @__PURE__ */ e("span", { "aria-label": "error", role: "img", children: /* @__PURE__ */ e(me, { sx: { fontSize: 15 } }) }),
800
+ /* @__PURE__ */ e(x, { variant: "Small", children: s.split_transaction_errors_enter_an_amount })
801
+ ] })
802
+ ] }) })
803
+ ] }),
804
+ /* @__PURE__ */ e(
805
+ Pe,
806
+ {
807
+ initialSelected: a.category_guid,
808
+ onClose: () => p(!1),
809
+ onSelect: (h) => {
810
+ i(t, h), p(!1);
811
+ },
812
+ showDrawer: u,
813
+ title: s.actions_select_a_category
814
+ }
815
+ )
816
+ ] });
817
+ }, vt = E(It), Et = ({
818
+ onAddSplit: t,
819
+ onCategoryChanged: n,
820
+ onDeleteSplit: i,
821
+ onUpdateAmount: r,
822
+ splits: a,
823
+ transaction: o
824
+ }) => {
825
+ const { transactions: s } = I(), { onEvent: c } = w(), [m, u] = d.useState(""), { announce: p, ariaLive: _ } = pe();
826
+ return d.useEffect(() => {
827
+ if (a.length <= 1)
828
+ u(s.split_transaction_errors_min_splits), p(s.split_transaction_errors_min_splits);
829
+ else if (a[0].amount < 0) {
830
+ const g = N(
831
+ s.split_transaction_errors_totals_must_equal_amount,
832
+ X(o.amount, "0,0.00")
833
+ );
834
+ u(g), p(g);
835
+ } else
836
+ u(""), p("");
837
+ }, [a]), /* @__PURE__ */ l(K, { className: "mx-txn-split-manager", children: [
838
+ _,
839
+ a.map((g, h) => /* @__PURE__ */ e(
840
+ vt,
841
+ {
842
+ index: h,
843
+ onCategoryChanged: n,
844
+ onDeleteRow: i,
845
+ onUpdateAmount: r,
846
+ split: g
847
+ },
848
+ h
849
+ )),
850
+ m && /* @__PURE__ */ l(v, { color: "error.main", direction: "row", gap: 8, p: 16, children: [
851
+ /* @__PURE__ */ e("span", { "aria-label": "error", role: "img", children: /* @__PURE__ */ e(me, { sx: { fontSize: 15 } }) }),
852
+ /* @__PURE__ */ e(x, { variant: "Small", children: m })
853
+ ] }),
854
+ /* @__PURE__ */ e(K, { p: 16, children: /* @__PURE__ */ e(
855
+ oe,
856
+ {
857
+ "aria-label": s.split_transaction_add_split_btn,
858
+ onClick: () => {
859
+ c(y.ON_TRANSACTION_SPLIT_ADD_CLICK), t();
860
+ },
861
+ children: s.split_transaction_add_split_btn
862
+ }
863
+ ) })
864
+ ] });
865
+ }, Dt = E(Et), Ot = ({ transaction: t }) => {
866
+ const { onEvent: n } = w(), { announce: i, ariaLive: r } = pe(), { splitTransaction: a, unSplitTransaction: o } = O(), { common: s, transactions: c } = I(), { setShouldDisableDrawerScroll: m } = J(), { categories: u } = Le(), p = j(), _ = {
867
+ ...t,
868
+ amount: t.amount - 1,
869
+ guid: "",
870
+ has_been_split: !1,
871
+ parent_guid: t.guid
872
+ }, g = {
873
+ ...t,
874
+ amount: 1,
875
+ category_guid: void 0,
876
+ category: c.split_transaction_select_category_btn,
877
+ guid: "",
878
+ has_been_split: !1,
879
+ parent_guid: t.guid,
880
+ top_level_category_guid: void 0
881
+ }, [h, f] = d.useState(!1), [L, M] = d.useState(!1), [S, T] = d.useState([]), R = () => {
882
+ const b = [...S];
883
+ b.push({ ...g }), b[0].amount -= 1, T(b), i(
884
+ N(
885
+ c.split_transaction_add_split_announcement,
886
+ b.length
887
+ )
888
+ );
889
+ }, C = (b) => {
890
+ if (b > 0) {
891
+ const k = S[b], A = [...S];
892
+ A.splice(b, 1), A[0].amount += k.amount, T(A), i(
893
+ N(c.split_transaction_delete_split_announcement, b + 1)
894
+ );
895
+ }
896
+ }, Q = (b, k) => {
897
+ const A = [...S];
898
+ A[b].amount = k, A[0].amount = t.amount - A.reduce(
899
+ ($, P, Te) => $ + (Te !== 0 ? P.amount : 0),
900
+ 0
901
+ ), T(A);
902
+ }, ge = (b, k) => {
903
+ const A = [...S], $ = u.find((P) => P.guid === k);
904
+ $ && (A[b] = {
905
+ ...A[b],
906
+ category_guid: k,
907
+ category: $.name,
908
+ top_level_category_guid: $.parent_guid || k
909
+ }, T(A), i(
910
+ N(
911
+ c.split_transaction_select_category_announcement,
912
+ $.name,
913
+ b + 1
914
+ )
915
+ ));
916
+ }, he = () => {
917
+ if (t.parent_guid || t.has_been_split) {
918
+ M(!0);
919
+ return;
920
+ }
921
+ T([{ ..._ }, { ...g }]), n(F.TRANSACTION_DETAILS_CLICK_SPLIT, {
922
+ transaction_guid: t.guid
923
+ }), f(!0);
924
+ }, Z = async () => {
925
+ n(y.ON_TRANSACTION_SPLIT_SAVE_CLICK), await a({ ...t, has_been_split: !0 }, S), f(!1);
926
+ }, ee = async () => {
927
+ n(y.ON_TRANSACTION_SPLIT_CANCEL_CLICK), T([{ ..._ }, { ...g }]), f(!1);
928
+ }, W = async () => {
929
+ n(F.TRANSACTION_DETAILS_CLICK_UNSPLIT, {
930
+ transaction_guid: t.guid
931
+ });
932
+ const b = t.parent_guid ?? t.guid;
933
+ await o(b);
934
+ }, te = d.useMemo(() => {
935
+ const b = S.some((A) => !A.category_guid), k = S.some((A) => A.amount <= 0);
936
+ return b || k;
937
+ }, [S]), ye = p.palette.mode === "dark" ? "grey.800" : "grey.100";
938
+ return /* @__PURE__ */ e(d.Fragment, { children: t && /* @__PURE__ */ l(G, { disableGutters: !0, disablePadding: !0, children: [
939
+ /* @__PURE__ */ l(V, { onClick: he, children: [
940
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(H, { sx: { bgcolor: ye }, variant: "rounded", children: /* @__PURE__ */ e(D, { name: "call_split", sx: { color: "text.primary" } }) }) }),
941
+ /* @__PURE__ */ e(
942
+ B,
943
+ {
944
+ primary: t.has_been_split || t.parent_guid ? c.split_transaction_unsplit_title : c.split_transaction_title,
945
+ secondary: t.has_been_split || t.parent_guid ? c.split_transaction_unsplit_subtitle : c.split_transaction_desc
946
+ }
947
+ ),
948
+ /* @__PURE__ */ e(z, { children: t.has_been_split || t.parent_guid ? /* @__PURE__ */ e(D, { name: "delete" }) : /* @__PURE__ */ e(D, { name: "chevron_right", sx: { color: "text.primary" } }) })
949
+ ] }),
950
+ /* @__PURE__ */ l(
951
+ ie,
952
+ {
953
+ ariaLabelClose: s.close_aria,
954
+ isOpen: h,
955
+ isPrimaryDisabled: te,
956
+ onClose: ee,
957
+ onPrimaryAction: Z,
958
+ primaryText: s.save_button,
959
+ secondaryText: s.cancel_button,
960
+ title: c.split_transaction_title,
961
+ children: [
962
+ r,
963
+ /* @__PURE__ */ e(Ge, { transaction: t }),
964
+ /* @__PURE__ */ e(
965
+ Dt,
966
+ {
967
+ onAddSplit: R,
968
+ onCategoryChanged: ge,
969
+ onDeleteSplit: C,
970
+ onUpdateAmount: Q,
971
+ splits: S,
972
+ transaction: t
973
+ }
974
+ )
975
+ ]
976
+ }
977
+ ),
978
+ /* @__PURE__ */ e(
979
+ q,
980
+ {
981
+ copy: { title: c.split_transaction_unsplit_title },
982
+ isOpen: L,
983
+ onClose: () => {
984
+ m(!1), M(!1);
985
+ },
986
+ onPrimaryAction: W,
987
+ onSecondaryAction: () => {
988
+ n(y.ON_TRANSACTION_UNSPLIT_CANCEL);
989
+ },
990
+ primaryText: s.delete_button,
991
+ secondaryText: s.cancel_button,
992
+ children: /* @__PURE__ */ e(Y, { variant: "Paragraph", children: N(
993
+ c.split_transaction_unsplit_description,
994
+ t.description
995
+ ) })
996
+ }
997
+ )
998
+ ] }) });
999
+ }, Lt = E(Ot), wt = () => {
1000
+ const t = we(), { onEvent: n } = w(), { addTag: i } = O(), { transactions: r } = I(), [a, o] = d.useState(!1), [s, c] = d.useState(""), [m, u] = d.useState(""), p = d.useRef(null);
1001
+ d.useEffect(() => {
1002
+ a && p?.current?.focus();
1003
+ }, [a]);
1004
+ const _ = () => {
1005
+ n(
1006
+ a ? y.ON_TRANSACTION_TAGS_TAG_ADD_CANCEL_CLICK : y.ON_TRANSACTION_TAGS_TAG_ADD_CLICK
1007
+ ), a || c(""), o(!a);
1008
+ }, g = async () => {
1009
+ n(y.ON_TRANSACTION_TAGS_TAG_ADDED), await i(s), o(!1);
1010
+ };
1011
+ return d.useEffect(() => {
1012
+ u(s.length > 40 ? r.tags_error_name_must_be_40_chars : "");
1013
+ }, [s]), /* @__PURE__ */ l(K, { className: "mx-txn-tag-manager-header", children: [
1014
+ /* @__PURE__ */ l(
1015
+ v,
1016
+ {
1017
+ alignItems: "center",
1018
+ bgcolor: t.palette.background.default,
1019
+ direction: "row",
1020
+ justifyContent: "space-between",
1021
+ px: 24,
1022
+ py: 16,
1023
+ children: [
1024
+ /* @__PURE__ */ e(x, { bold: !0, children: r.tags_your_tags }),
1025
+ /* @__PURE__ */ e(
1026
+ oe,
1027
+ {
1028
+ "aria-expanded": a,
1029
+ "aria-label": r.tags_add_tag_btn_aria,
1030
+ onClick: _,
1031
+ children: r.tags_add_tag_btn
1032
+ }
1033
+ )
1034
+ ]
1035
+ }
1036
+ ),
1037
+ /* @__PURE__ */ l(
1038
+ q,
1039
+ {
1040
+ copy: { title: r.tags_add_tag_btn },
1041
+ isOpen: a,
1042
+ onClose: () => o(!1),
1043
+ onPrimaryAction: g,
1044
+ onSecondaryAction: () => o(!1),
1045
+ children: [
1046
+ /* @__PURE__ */ e(
1047
+ Ie,
1048
+ {
1049
+ "aria-label": r.tags_placeholder,
1050
+ name: "add-tag",
1051
+ onChange: (h) => c(h.target.value),
1052
+ placeholder: r.tags_placeholder,
1053
+ sx: { width: "100%" },
1054
+ value: s
1055
+ }
1056
+ ),
1057
+ /* @__PURE__ */ e(Y, { id: "add-tag-error", sx: { color: "error.main" }, variant: "ParagraphSmall", children: m })
1058
+ ]
1059
+ }
1060
+ )
1061
+ ] });
1062
+ }, Rt = E(wt), Mt = ({ onSearchValueChanged: t, searchValue: n }) => {
1063
+ const { common: i, transactions: r } = I(), a = /* @__PURE__ */ e(
1064
+ ne,
1065
+ {
1066
+ "aria-label": r.tags_cancel_search || "Search",
1067
+ onClick: () => t(""),
1068
+ children: /* @__PURE__ */ e(me, {})
1069
+ }
1070
+ );
1071
+ return /* @__PURE__ */ e(K, { className: "mx-txn-tag-manager-search", px: 24, py: 16, children: /* @__PURE__ */ e(
1072
+ Ie,
1073
+ {
1074
+ InputProps: {
1075
+ startAdornment: /* @__PURE__ */ e(Ee, { position: "start", children: /* @__PURE__ */ e(Je, { color: "disabled" }) }),
1076
+ endAdornment: /* @__PURE__ */ e(Ee, { position: "end", sx: { padding: 0 }, children: n ? a : null })
1077
+ },
1078
+ "aria-label": i.search_aria,
1079
+ name: "search",
1080
+ onChange: (o) => t(o.target.value),
1081
+ placeholder: i.search_placeholder,
1082
+ sx: { bgcolor: "background.paper", width: "100%" },
1083
+ value: n
1084
+ }
1085
+ ) });
1086
+ }, kt = E(Mt), Pt = ({ onTagChecked: t, selectedTags: n, tag: i }) => {
1087
+ const { onEvent: r } = w(), { removeTag: a, updateTag: o } = O(), { common: s, transactions: c } = I(), [m, u] = d.useState(!1), [p, _] = d.useState(!1), [g, h] = d.useState(""), [f, L] = d.useState(""), M = async () => {
1088
+ r(y.ON_TRANSACTION_TAGS_TAG_EDIT_SAVED), i && await o({ ...i, name: g }), u(!1);
1089
+ }, S = async () => {
1090
+ r(y.ON_TRANSACTION_TAGS_TAG_DELETED), await a(i.guid), _(!1);
1091
+ };
1092
+ d.useEffect(() => {
1093
+ L(g.length > 40 ? c.tags_error_name_must_be_40_chars : "");
1094
+ }, [g]);
1095
+ const T = () => {
1096
+ r(y.ON_TRANSACTION_TAGS_TAG_EDIT_CLICK), h(i.name), u(!0);
1097
+ }, R = () => {
1098
+ r(y.ON_TRANSACTION_TAGS_TAG_DELETE_CLICK), _(!0);
1099
+ };
1100
+ return /* @__PURE__ */ l(
1101
+ G,
1102
+ {
1103
+ className: "mx-txn-transaction-manager-row",
1104
+ disableGutters: !0,
1105
+ disablePadding: !0,
1106
+ secondaryAction: !i.is_default_tag && /* @__PURE__ */ l(v, { direction: "row", children: [
1107
+ /* @__PURE__ */ e(
1108
+ ne,
1109
+ {
1110
+ "aria-label": `Edit ${i.name} tag`,
1111
+ color: "secondary",
1112
+ onClick: T,
1113
+ children: /* @__PURE__ */ e(Qe, { color: "secondary" })
1114
+ }
1115
+ ),
1116
+ /* @__PURE__ */ e(
1117
+ ne,
1118
+ {
1119
+ "aria-label": `Delete ${i.name} tag`,
1120
+ color: "secondary",
1121
+ onClick: R,
1122
+ children: /* @__PURE__ */ e(_e, { color: "secondary" })
1123
+ }
1124
+ )
1125
+ ] }),
1126
+ children: [
1127
+ /* @__PURE__ */ l(
1128
+ V,
1129
+ {
1130
+ "aria-checked": n.includes(i.guid),
1131
+ onClick: () => t(i.guid),
1132
+ role: "checkbox",
1133
+ children: [
1134
+ /* @__PURE__ */ e(z, { sx: { ml: 0 }, children: /* @__PURE__ */ e(
1135
+ at,
1136
+ {
1137
+ "aria-hidden": !0,
1138
+ checked: n.includes(i.guid),
1139
+ edge: "start",
1140
+ tabIndex: -1
1141
+ }
1142
+ ) }),
1143
+ /* @__PURE__ */ e(B, { children: i.name })
1144
+ ]
1145
+ }
1146
+ ),
1147
+ /* @__PURE__ */ l(
1148
+ q,
1149
+ {
1150
+ copy: { title: "Update tag name" },
1151
+ isOpen: m,
1152
+ onClose: () => u(!1),
1153
+ onPrimaryAction: M,
1154
+ onSecondaryAction: () => u(!1),
1155
+ children: [
1156
+ /* @__PURE__ */ e(
1157
+ Ie,
1158
+ {
1159
+ "aria-describedby": f ? "update-tag-error" : void 0,
1160
+ "aria-label": c.tags_update_the_tag_name,
1161
+ name: "update-tag",
1162
+ onChange: (C) => h(C.target.value),
1163
+ placeholder: "Tag name",
1164
+ sx: { width: "100%" },
1165
+ value: g
1166
+ }
1167
+ ),
1168
+ /* @__PURE__ */ e(Y, { id: "update-tag-error", sx: { color: "error.main" }, variant: "ParagraphSmall", children: f })
1169
+ ]
1170
+ }
1171
+ ),
1172
+ /* @__PURE__ */ e(
1173
+ q,
1174
+ {
1175
+ copy: { title: c.tags_delete_title },
1176
+ isOpen: p,
1177
+ onClose: () => _(!1),
1178
+ onPrimaryAction: S,
1179
+ onSecondaryAction: () => r(y.ON_TRANSACTION_TAGS_TAG_DELETE_CANCEL_CLICK),
1180
+ primaryText: s.delete_button,
1181
+ secondaryText: s.cancel_button,
1182
+ children: /* @__PURE__ */ e(x, { truncate: !1, children: c.tags_deleting_this_tag_will_remove_it })
1183
+ }
1184
+ )
1185
+ ]
1186
+ }
1187
+ );
1188
+ }, Gt = E(Pt), Bt = ({ selectedTags: t, onTagChecked: n }) => {
1189
+ const { tags: i } = O(), [r, a] = d.useState(""), o = i.filter(
1190
+ (s) => s.name.toLowerCase().includes(r.toLowerCase())
1191
+ );
1192
+ return /* @__PURE__ */ l("div", { className: "mx-txn-tag-manager", children: [
1193
+ /* @__PURE__ */ e(
1194
+ kt,
1195
+ {
1196
+ onSearchValueChanged: (s) => a(s),
1197
+ searchValue: r
1198
+ }
1199
+ ),
1200
+ /* @__PURE__ */ e(Rt, {}),
1201
+ /* @__PURE__ */ e(le, { sx: { boxShadow: "none" }, children: /* @__PURE__ */ e(ue, { children: o.map((s) => /* @__PURE__ */ l(d.Fragment, { children: [
1202
+ /* @__PURE__ */ e(Gt, { onTagChecked: n, selectedTags: t, tag: s }),
1203
+ /* @__PURE__ */ e(de, { sx: { ml: 24 } })
1204
+ ] }, s.guid)) }) })
1205
+ ] });
1206
+ }, $t = E(Bt), Kt = ({ transaction: t }) => {
1207
+ const { onEvent: n } = w(), { tags: i, updateTaggings: r, updateTransaction: a } = O(), { common: o, transactions: s } = I(), { updateManualTransaction: c } = J(), m = j(), [u, p] = d.useState(!1), [_, g] = d.useState(t.tags);
1208
+ d.useEffect(() => {
1209
+ g(t.tags);
1210
+ }, [u, t]);
1211
+ const h = (S) => {
1212
+ const T = [..._], R = _.indexOf(S);
1213
+ R >= 0 ? T.splice(R, 1) : T.push(S), g(T);
1214
+ }, f = async () => {
1215
+ if (t.is_manual && !t.guid) {
1216
+ c({ ...t, tags: _ }), p(!1);
1217
+ return;
1218
+ }
1219
+ await r(_, t.guid), await a({ ...t, tags: _ }), n(F.TRANSACTION_DETAILS_CLICK_TAGS, { transaction_guid: t.guid }), p(!1);
1220
+ }, L = d.useMemo(
1221
+ () => t.tags.map(
1222
+ (S, T, R) => `${i.find((C) => C.guid === S)?.name}${T < R.length - 1 ? " / " : ""}`
1223
+ ),
1224
+ [i, t]
1225
+ ), M = m.palette.mode === "dark" ? "grey.800" : "grey.100";
1226
+ return /* @__PURE__ */ l(G, { disableGutters: !0, disablePadding: !0, children: [
1227
+ /* @__PURE__ */ l(
1228
+ V,
1229
+ {
1230
+ onClick: () => {
1231
+ n(y.ON_TRANSACTION_TAGS_CLICK), p(!0);
1232
+ },
1233
+ children: [
1234
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(H, { sx: { bgcolor: M }, variant: "rounded", children: /* @__PURE__ */ e(D, { name: "local_offer", sx: { color: "text.primary" } }) }) }),
1235
+ /* @__PURE__ */ e(
1236
+ B,
1237
+ {
1238
+ primary: s.tags_title,
1239
+ primaryTypographyProps: { variant: "XSmall" },
1240
+ secondary: /* @__PURE__ */ e(x, { bold: !0, sx: { color: "text.primary" }, variant: "Body", children: t.tags?.length > 0 ? L : s.tags_desc })
1241
+ }
1242
+ ),
1243
+ /* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(D, { name: "chevron_right", sx: { color: "text.primary" } }) })
1244
+ ]
1245
+ }
1246
+ ),
1247
+ /* @__PURE__ */ e(
1248
+ ie,
1249
+ {
1250
+ ariaLabelClose: o.close_aria,
1251
+ isOpen: u,
1252
+ onClose: () => p(!1),
1253
+ onPrimaryAction: f,
1254
+ primaryText: o.save_button,
1255
+ secondaryText: o.cancel_button,
1256
+ title: s.tags_title,
1257
+ children: /* @__PURE__ */ e($t, { onTagChecked: h, selectedTags: _ })
1258
+ }
1259
+ )
1260
+ ] });
1261
+ }, Ft = E(Kt), Ht = ({ transaction: t, viewOnly: n = !1 }) => {
1262
+ const { updateTransaction: i } = O(), { common: r, transactions: a } = I(), { onEvent: o } = w(), { announce: s, ariaLive: c } = pe(), [m, u] = d.useState(!1), [p, _] = d.useState(""), g = d.useRef(null);
1263
+ d.useEffect(() => {
1264
+ m && (_(t.description), g?.current?.focus());
1265
+ }, [m]);
1266
+ const h = () => {
1267
+ u(!0), o(y.ON_TRANSACTION_DESCRIPTION_EDIT_CLICK), setTimeout(() => document.getElementById("transaction-description-input")?.focus(), 0);
1268
+ }, f = async () => {
1269
+ o(F.TRANSACTION_DETAILS_CLICK_DESCRIPTION, {
1270
+ transaction_guid: t.guid
1271
+ }), await i({ ...t, description: p }), u(!1), s(`${a.payee_title}: ${p}`), setTimeout(() => document.getElementById("transaction-description-edit-button")?.focus(), 0);
1272
+ };
1273
+ return /* @__PURE__ */ l(K, { className: "mx-txn-transaction-description", children: [
1274
+ c,
1275
+ m ? /* @__PURE__ */ l(ze, { row: !0, children: [
1276
+ /* @__PURE__ */ e(
1277
+ Oe,
1278
+ {
1279
+ "aria-label": a.payee_title,
1280
+ id: "transaction-description-input",
1281
+ inputProps: { maxLength: 140 },
1282
+ label: a.payee_title,
1283
+ name: a.payee_title,
1284
+ onChange: (L) => _(L.target.value),
1285
+ ref: g,
1286
+ sx: {
1287
+ backgroundColor: "background.paper",
1288
+ ".MuiOutlinedInput-root": { borderTopRightRadius: 0, borderBottomRightRadius: 0 },
1289
+ ".MuiOutlinedInput-input": { p: 11 },
1290
+ width: 250
1291
+ },
1292
+ value: p
1293
+ }
1294
+ ),
1295
+ /* @__PURE__ */ e(
1296
+ oe,
1297
+ {
1298
+ disabled: !p,
1299
+ onClick: f,
1300
+ sx: {
1301
+ borderTopLeftRadius: 0,
1302
+ borderBottomLeftRadius: 0
1303
+ },
1304
+ variant: "outlined",
1305
+ children: r.save_button
1306
+ }
1307
+ )
1308
+ ] }) : /* @__PURE__ */ l(v, { alignItems: "center", direction: "row", gap: 4, sx: { minHeight: 44 }, children: [
1309
+ /* @__PURE__ */ e(x, { bold: !0, children: t.description }),
1310
+ !n && /* @__PURE__ */ e(
1311
+ ne,
1312
+ {
1313
+ "aria-label": a.payee_edit,
1314
+ id: "transaction-description-edit-button",
1315
+ onClick: h,
1316
+ sx: { color: "action.active" },
1317
+ children: /* @__PURE__ */ e(ce, { name: "create", size: 22 })
1318
+ }
1319
+ )
1320
+ ] })
1321
+ ] });
1322
+ }, Ut = E(Ht), Vt = ({ transaction: t }) => {
1323
+ const { updateTransaction: n } = O(), { transactions: i } = I(), { onEvent: r } = w(), a = we(), o = async () => {
1324
+ r(F.TRANSACTION_DETAILS_CLICK_FLAG, { transaction_guid: t.guid }), await n({ ...t, is_flagged: !t.is_flagged });
1325
+ };
1326
+ return /* @__PURE__ */ e("div", { className: "mx-txn-transaction-flag", children: /* @__PURE__ */ e(
1327
+ qe,
1328
+ {
1329
+ "aria-label": i.flag_btn_aria,
1330
+ "aria-pressed": t.is_flagged,
1331
+ color: "warning",
1332
+ onClick: o,
1333
+ selected: t.is_flagged,
1334
+ sx: {
1335
+ borderRadius: 6,
1336
+ color: a.palette.secondary.main,
1337
+ "&.Mui-selected": {
1338
+ color: a.palette.common.white,
1339
+ backgroundColor: a.palette.warning.dark,
1340
+ ":hover": {
1341
+ color: a.palette.common.white,
1342
+ backgroundColor: a.palette.warning.main
1343
+ }
1344
+ },
1345
+ ":hover": {
1346
+ color: a.palette.warning.contrastText,
1347
+ backgroundColor: a.palette.warning.light
1348
+ }
1349
+ },
1350
+ value: "flagged",
1351
+ children: /* @__PURE__ */ e(Ze, { color: "inherit" })
1352
+ }
1353
+ ) });
1354
+ }, zt = E(Vt), se = (t, n, i, r = !0, a = "inset") => r ? /* @__PURE__ */ l(d.Fragment, { children: [
1355
+ /* @__PURE__ */ l(G, { disableGutters: !0, disablePadding: !0, children: [
1356
+ /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(H, { sx: { bgcolor: "border.light" }, variant: "rounded", children: t }) }),
1357
+ /* @__PURE__ */ e(
1358
+ B,
1359
+ {
1360
+ primary: n,
1361
+ primaryTypographyProps: { variant: "XSmall" },
1362
+ secondary: i
1363
+ }
1364
+ )
1365
+ ] }),
1366
+ /* @__PURE__ */ e(de, { variant: a })
1367
+ ] }) : null, Wt = ({ transaction: t }) => {
1368
+ const { transactions: n } = I(), { tags: i } = O(), r = d.useMemo(() => {
1369
+ const a = new Map(i.map((o) => [o.guid, o.name]));
1370
+ return t.tags.map((o) => a.get(o)).filter(Boolean).join(" / ");
1371
+ }, [i, t.tags]);
1372
+ return /* @__PURE__ */ l(ue, { sx: { "& .MuiListItem-root": { px: 24, py: 12 } }, children: [
1373
+ se(
1374
+ /* @__PURE__ */ e(
1375
+ Ne,
1376
+ {
1377
+ categoryGuid: t.top_level_category_guid,
1378
+ size: 24,
1379
+ sx: { color: "text.primary" },
1380
+ variant: De.Transparent
1381
+ }
1382
+ ),
1383
+ n.category_title,
1384
+ /* @__PURE__ */ e(x, { bold: !0, variant: "Body", children: t.category ?? n.actions_select_a_category })
1385
+ ),
1386
+ se(
1387
+ /* @__PURE__ */ e(ce, { name: "calendar_month", sx: { color: "text.primary" }, weight: be.Dark }),
1388
+ n.date_title,
1389
+ /* @__PURE__ */ e(x, { bold: !0, variant: "Body", children: Me(Se(t.date), ke.YEAR_MONTH_DAY) })
1390
+ ),
1391
+ se(
1392
+ /* @__PURE__ */ e(ce, { name: "article", sx: { color: "text.primary" }, weight: be.Dark }),
1393
+ n.memo_title,
1394
+ /* @__PURE__ */ e(x, { bold: !0, sx: { overflowWrap: "break-word", whiteSpace: "wrap" }, variant: "Body", children: t.memo ?? n.memo_desc }),
1395
+ !!t.memo,
1396
+ t.tags?.length > 0 ? "inset" : "fullWidth"
1397
+ ),
1398
+ se(
1399
+ /* @__PURE__ */ e(ce, { name: "local_offer", sx: { color: "text.primary" }, weight: be.Dark }),
1400
+ n.tags_title,
1401
+ /* @__PURE__ */ e(x, { bold: !0, variant: "Body", children: t.tags?.length ? r : n.tags_desc }),
1402
+ !!t.tags?.length,
1403
+ "fullWidth"
1404
+ )
1405
+ ] });
1406
+ }, Yt = E(Wt), Xt = ({
1407
+ bottomActions: t = ut,
1408
+ canFlagTransaction: n = !0,
1409
+ topActions: i = dt,
1410
+ transaction: r
1411
+ }) => {
1412
+ const { onEvent: a } = w(), { isCopyLoaded: o } = Xe(), { userFeatures: s } = je(), c = j(), m = r?.number && r.number.length > 4;
1413
+ if (d.useEffect(
1414
+ () => a(F.TRANSACTION_DETAILS_VIEW, { transaction_guid: r.guid }),
1415
+ []
1416
+ ), !o)
1417
+ return /* @__PURE__ */ e(ct, {});
1418
+ const u = Ve(s, "MX_TXN_DETAILS_VIEW_ONLY"), p = c.palette.mode === "dark" ? "grey.800" : "grey.100";
1419
+ return /* @__PURE__ */ e(K, { className: "mx-txn-transaction-details", width: "100%", children: r && /* @__PURE__ */ l(v, { children: [
1420
+ /* @__PURE__ */ l(v, { gap: 12, p: 24, children: [
1421
+ /* @__PURE__ */ e(le, { elevation: 2, sx: { width: 64 }, children: /* @__PURE__ */ e(
1422
+ Ae,
1423
+ {
1424
+ categoryGuid: r.top_level_category_guid || "",
1425
+ merchantGuid: r.merchant_guid || "",
1426
+ size: 64
1427
+ }
1428
+ ) }),
1429
+ /* @__PURE__ */ e(Ut, { transaction: r, viewOnly: u }),
1430
+ /* @__PURE__ */ l(v, { direction: "row", justifyContent: "space-between", sx: { minHeight: 44 }, children: [
1431
+ /* @__PURE__ */ l(Y, { color: r.isIncome ? "success.main" : "text.primary", variant: "H1", children: [
1432
+ r.isIncome ? "+" : "",
1433
+ X(r.amount, "0,0.00")
1434
+ ] }),
1435
+ !u && n && /* @__PURE__ */ e(zt, { transaction: r })
1436
+ ] }),
1437
+ /* @__PURE__ */ l(v, { sx: { bgcolor: p, borderRadius: "4px", gap: 4, p: 8 }, children: [
1438
+ /* @__PURE__ */ e(x, { bold: !0, children: `${r.account}
1439
+ ${m ? r.number : "•".repeat(4).concat(r.number ?? "")}` }),
1440
+ /* @__PURE__ */ e(x, { bold: !0, variant: "Tiny", children: r.feed_description })
1441
+ ] })
1442
+ ] }),
1443
+ /* @__PURE__ */ e(le, { square: !0, sx: { boxShadow: "none" }, children: u ? /* @__PURE__ */ e(Yt, { transaction: r }) : /* @__PURE__ */ e(ue, { children: i.map((_, g) => /* @__PURE__ */ l(d.Fragment, { children: [
1444
+ _ === re.Category && /* @__PURE__ */ e(ht, { transaction: r }),
1445
+ _ === re.Date && /* @__PURE__ */ e(yt, { transaction: r }),
1446
+ _ === re.Memo && /* @__PURE__ */ e(Nt, { transaction: r }),
1447
+ _ === re.Tags && /* @__PURE__ */ e(Ft, { transaction: r }),
1448
+ /* @__PURE__ */ e(de, { variant: g < i.length - 1 ? "inset" : "fullWidth" })
1449
+ ] }, _)) }) }),
1450
+ !u && t.length > 0 && /* @__PURE__ */ l(d.Fragment, { children: [
1451
+ /* @__PURE__ */ e(x, { bold: !0, mb: 8, ml: 26, mt: 16, variant: "Body", children: "Actions" }),
1452
+ /* @__PURE__ */ e(le, { square: !0, sx: { boxShadow: "none" }, children: /* @__PURE__ */ l(ue, { children: [
1453
+ t.map((_, g) => /* @__PURE__ */ l(d.Fragment, { children: [
1454
+ _ === ae.MerchantBudget && /* @__PURE__ */ e(gt, { transaction: r }),
1455
+ _ === ae.SplitTransaction && /* @__PURE__ */ e(Lt, { transaction: r }),
1456
+ _ === ae.HideTransaction && /* @__PURE__ */ e(ft, { transaction: r }),
1457
+ _ === ae.MerchantLogo && /* @__PURE__ */ e(xt, { transaction: r }),
1458
+ /* @__PURE__ */ e(de, { variant: g < t.length - 1 ? "inset" : "fullWidth" })
1459
+ ] }, _)),
1460
+ r.is_manual && !r.parent_guid && !r.has_been_split && /* @__PURE__ */ e(Ct, { transaction: r })
1461
+ ] }) })
1462
+ ] })
1463
+ ] }) });
1464
+ }, Fr = E(Xt);
1465
+ export {
1466
+ ae as B,
1467
+ ht as C,
1468
+ yt as D,
1469
+ Nt as M,
1470
+ Fr as T,
1471
+ Ft as a,
1472
+ re as b,
1473
+ _t as c
1474
+ };