@mx-cartographer/experiences 9.7.1 → 9.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/core/types/InsightsInstanceSlotData.d.ts +6 -2
- package/dist/core/types/InsightsInstanceSlotData.es.js.map +1 -1
- package/dist/finstrong/components/ManageDOB.es.js +16 -16
- package/dist/goals/components/GoalList.es.js +1 -1
- package/dist/goals/components/actions/BirthdayAction.es.js +11 -11
- package/dist/insights/components/insights/BillAmountNotStandard/BillAmountNotStandard.es.js +9 -9
- package/dist/insights/components/insights/BillAmountNotStandard/BillAmountNotStandardMUI.es.js +8 -8
- package/dist/insights/components/insights/MonthlySpendingComparisonV2/MonthlySpendingComparisonV2.es.js +9 -9
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/TransactionDetailsBlock.es.js +4 -4
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +58 -58
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.d.ts +1 -3
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.es.js +14 -13
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.d.ts +8 -2
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js +56 -36
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.d.ts +7 -3
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js +30 -32
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/utils.d.ts +3 -2
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/utils.es.js +16 -15
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/utils.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.es.js +5 -5
- package/dist/insights-v2/blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js +6 -6
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +4 -4
- package/dist/insights-v2/blocks/ComponentBlocks/UpcomingBillBlock/UpcomingBillBlock.es.js +6 -6
- package/dist/insights-v2/blocks/ComponentBlocks/UpcomingSubscriptionBlock/UpcomingSubscriptionBlock.es.js +1 -1
- package/dist/insights-v2/components/BaseLayout.es.js +24 -24
- package/dist/insights-v2/components/CompactInsightCard.d.ts +4 -2
- package/dist/insights-v2/components/CompactInsightCard.es.js +91 -59
- package/dist/insights-v2/components/CompactInsightCard.es.js.map +1 -1
- package/dist/insights-v2/components/chartblocks/EmptyBarChart.es.js +4 -4
- package/dist/insights-v2/index.es.js +122 -121
- package/dist/insights-v2/mappings/blocks.es.js +112 -99
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/dist/microinsights/cards/InsightCard.es.js +10 -10
- package/dist/recurringtransactions/components/PaymentSchedule.es.js +11 -11
- package/dist/recurringtransactions/components/RecurringTransactionDetails.es.js +16 -16
- package/dist/settings/components/profile/ProfileTab.es.js +33 -33
- package/dist/transactions/components/shared/TransactionDetails.es.js +5 -4
- package/dist/transactions/components/shared/TransactionDetails.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,16 +4,16 @@ import { formatOrdinal as M } from "../../core/utils/NumberFormatting.es.js";
|
|
|
4
4
|
import { Select as n } from "../../common/components/Select.es.js";
|
|
5
5
|
import g from "react";
|
|
6
6
|
import A from "@mui/material/Stack";
|
|
7
|
-
import { startOfToday as
|
|
7
|
+
import { startOfToday as i } from "date-fns/startOfToday";
|
|
8
8
|
import { jsx as t, jsxs as T } from "react/jsx-runtime";
|
|
9
9
|
import { addYears as _ } from "date-fns/addYears";
|
|
10
10
|
import { subDays as Y } from "date-fns/subDays";
|
|
11
11
|
import { setDayOfYear as x } from "date-fns/setDayOfYear";
|
|
12
12
|
import { AdapterDateFns as D } from "@mui/x-date-pickers/AdapterDateFns";
|
|
13
|
-
import {
|
|
14
|
-
import { getDayOfYear as W } from "date-fns/getDayOfYear";
|
|
13
|
+
import { getDayOfYear as C } from "date-fns/getDayOfYear";
|
|
15
14
|
import { DatePicker as P } from "@mui/x-date-pickers";
|
|
16
|
-
|
|
15
|
+
import { LocalizationProvider as W } from "@mui/x-date-pickers/LocalizationProvider";
|
|
16
|
+
var N = ({ frequency: a, firstDay: y, secondDay: h, onFrequencyChange: s, onFirstDayChange: d, onSecondDayChange: c }) => {
|
|
17
17
|
const { recurring: e } = E(), f = g.useMemo(() => [
|
|
18
18
|
{
|
|
19
19
|
id: r.EveryWeek,
|
|
@@ -81,8 +81,8 @@ var N = ({ frequency: a, firstDay: i, secondDay: h, onFrequencyChange: s, onFirs
|
|
|
81
81
|
label: M(o + 1)
|
|
82
82
|
}));
|
|
83
83
|
l[30].label += ` (${e.last_day_of_month})`;
|
|
84
|
-
const v = l.slice(0, 15), b = l.slice(14), u = a === r.EveryWeek || a === r.EveryOtherWeek, k = a === r.TwiceAMonth || a === r.EveryMonth || a === r.EveryOtherMonth || a === r.EveryQuarter || a === r.EveryOtherQuarter, m = x(
|
|
85
|
-
o && d(
|
|
84
|
+
const v = l.slice(0, 15), b = l.slice(14), u = a === r.EveryWeek || a === r.EveryOtherWeek, k = a === r.TwiceAMonth || a === r.EveryMonth || a === r.EveryOtherMonth || a === r.EveryQuarter || a === r.EveryOtherQuarter, m = x(i(), y), w = m < i() ? _(m, 1) : m, O = (o) => {
|
|
85
|
+
o && d(C(o));
|
|
86
86
|
};
|
|
87
87
|
return /* @__PURE__ */ T(A, {
|
|
88
88
|
gap: 24,
|
|
@@ -98,13 +98,13 @@ var N = ({ frequency: a, firstDay: i, secondDay: h, onFrequencyChange: s, onFirs
|
|
|
98
98
|
label: e.day_of_the_week,
|
|
99
99
|
onChange: d,
|
|
100
100
|
options: p,
|
|
101
|
-
value:
|
|
101
|
+
value: y
|
|
102
102
|
}),
|
|
103
103
|
k && /* @__PURE__ */ t(n, {
|
|
104
104
|
label: a === r.TwiceAMonth ? e.first_day_of_the_month : e.day_of_the_month,
|
|
105
105
|
onChange: d,
|
|
106
106
|
options: a === r.TwiceAMonth ? v : l,
|
|
107
|
-
value:
|
|
107
|
+
value: y
|
|
108
108
|
}),
|
|
109
109
|
a === r.TwiceAMonth && /* @__PURE__ */ t(n, {
|
|
110
110
|
label: e.second_day_of_the_month,
|
|
@@ -112,13 +112,13 @@ var N = ({ frequency: a, firstDay: i, secondDay: h, onFrequencyChange: s, onFirs
|
|
|
112
112
|
options: b,
|
|
113
113
|
value: h ?? ""
|
|
114
114
|
}),
|
|
115
|
-
a === r.EveryYear && /* @__PURE__ */ t(
|
|
115
|
+
a === r.EveryYear && /* @__PURE__ */ t(W, {
|
|
116
116
|
dateAdapter: D,
|
|
117
117
|
children: /* @__PURE__ */ t(P, {
|
|
118
118
|
disablePast: !0,
|
|
119
119
|
label: e.next_payment_date,
|
|
120
|
-
maxDate: Y(_(
|
|
121
|
-
minDate:
|
|
120
|
+
maxDate: Y(_(i(), 1), 1),
|
|
121
|
+
minDate: i(),
|
|
122
122
|
onChange: O,
|
|
123
123
|
value: w
|
|
124
124
|
})
|
|
@@ -7,14 +7,14 @@ import ut from "../../common/components/drawer/Drawer.es.js";
|
|
|
7
7
|
import { ANALYTICS_EVENTS as h } from "../../common/constants/Analytics.es.js";
|
|
8
8
|
import T from "../../common/components/DataRow.es.js";
|
|
9
9
|
import { useAccountUiStore as pt } from "../../accounts/hooks/useUiStore.es.js";
|
|
10
|
-
import ft from "
|
|
11
|
-
import _t from "
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import
|
|
10
|
+
import { LinkTransactionDrawer as ft } from "./actions/LinkTransactionDrawer.es.js";
|
|
11
|
+
import { MarkAsPaidDialog as _t } from "./actions/MarkAsPaidDialog.es.js";
|
|
12
|
+
import { MarkAsUnpaidDialog as ht } from "./actions/MarkAsUnpaidDialog.es.js";
|
|
13
|
+
import { PaymentScheduleAction as At } from "./actions/PaymentScheduleAction.es.js";
|
|
14
|
+
import { RecurringTransactionList as kt } from "./RecurringTransactionList.es.js";
|
|
15
|
+
import { UpcomingRecurrenceCard as Ct } from "./UpcomingRecurrenceCard.es.js";
|
|
16
|
+
import St from "../../transactions/components/shared/TransactionDetails.es.js";
|
|
17
|
+
import gt from "../../accounts/components/detailsdrawer/Accounts/AccountDetailsDrawer.es.js";
|
|
18
18
|
import n from "react";
|
|
19
19
|
import { observer as Dt } from "mobx-react-lite";
|
|
20
20
|
import b from "@mui/material/Stack";
|
|
@@ -88,7 +88,7 @@ var ie = Dt(({ onDeleted: M, recurringTransaction: e, selectedRecurrence: i }) =
|
|
|
88
88
|
variant: "h1",
|
|
89
89
|
children: [r ? "+" : "", lt(K, "0,0.00")]
|
|
90
90
|
}),
|
|
91
|
-
/* @__PURE__ */ t(
|
|
91
|
+
/* @__PURE__ */ t(Ct, {
|
|
92
92
|
expectedDate: i?.occurredOnDate || i?.expectedDate || J,
|
|
93
93
|
onMarkAsPaidClick: i?.status === rt.Paid && i.transaction?.guid ? () => R(i.transaction.guid) : y,
|
|
94
94
|
status: i?.status
|
|
@@ -110,7 +110,7 @@ var ie = Dt(({ onDeleted: M, recurringTransaction: e, selectedRecurrence: i }) =
|
|
|
110
110
|
label: a.category,
|
|
111
111
|
value: s.category
|
|
112
112
|
}), /* @__PURE__ */ t(A, { variant: "inset" })] }),
|
|
113
|
-
/* @__PURE__ */ t(
|
|
113
|
+
/* @__PURE__ */ t(At, { repeatingTransaction: e }),
|
|
114
114
|
/* @__PURE__ */ t(A, {})
|
|
115
115
|
]
|
|
116
116
|
}),
|
|
@@ -125,7 +125,7 @@ var ie = Dt(({ onDeleted: M, recurringTransaction: e, selectedRecurrence: i }) =
|
|
|
125
125
|
variant: "text",
|
|
126
126
|
children: r ? a.delete_income_title : a.delete_expense_title
|
|
127
127
|
}),
|
|
128
|
-
/* @__PURE__ */ t(
|
|
128
|
+
/* @__PURE__ */ t(kt, {
|
|
129
129
|
isIncome: r,
|
|
130
130
|
onMarkAsPaidClick: y,
|
|
131
131
|
onMarkAsUnpaidClick: R,
|
|
@@ -138,7 +138,7 @@ var ie = Dt(({ onDeleted: M, recurringTransaction: e, selectedRecurrence: i }) =
|
|
|
138
138
|
isOpen: !!f && !!s,
|
|
139
139
|
onClose: () => D(""),
|
|
140
140
|
title: a.transaction_details_drawer_title,
|
|
141
|
-
children: s && /* @__PURE__ */ t(
|
|
141
|
+
children: s && /* @__PURE__ */ t(St, { transaction: s })
|
|
142
142
|
}),
|
|
143
143
|
/* @__PURE__ */ t(dt, {
|
|
144
144
|
copy: {
|
|
@@ -150,24 +150,24 @@ var ie = Dt(({ onDeleted: M, recurringTransaction: e, selectedRecurrence: i }) =
|
|
|
150
150
|
onPrimaryAction: W,
|
|
151
151
|
children: /* @__PURE__ */ t(w, { children: r ? a.delete_income_description : a.delete_expense_description })
|
|
152
152
|
}),
|
|
153
|
-
/* @__PURE__ */ t(
|
|
153
|
+
/* @__PURE__ */ t(_t, {
|
|
154
154
|
isOpen: $,
|
|
155
155
|
onClose: () => d(!1),
|
|
156
156
|
onLinkTransaction: Z
|
|
157
157
|
}),
|
|
158
|
-
/* @__PURE__ */ t(
|
|
158
|
+
/* @__PURE__ */ t(ht, {
|
|
159
159
|
isOpen: V,
|
|
160
160
|
onClose: () => {
|
|
161
161
|
u(!1), p("");
|
|
162
162
|
},
|
|
163
163
|
onUnlinkTransaction: tt
|
|
164
164
|
}),
|
|
165
|
-
/* @__PURE__ */ t(
|
|
165
|
+
/* @__PURE__ */ t(ft, {
|
|
166
166
|
isOpen: q,
|
|
167
167
|
onClose: () => g(!1),
|
|
168
168
|
recurringTransaction: e
|
|
169
169
|
}),
|
|
170
|
-
/* @__PURE__ */ t(
|
|
170
|
+
/* @__PURE__ */ t(gt, {
|
|
171
171
|
isOpen: j,
|
|
172
172
|
onClose: () => C(!1)
|
|
173
173
|
})
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { useAppConfig as E, useGlobalCopyStore as B, useSettingsStore as M, useUserStore as
|
|
2
|
-
import { useScreenSize as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { useAppConfig as E, useGlobalCopyStore as B, useSettingsStore as M, useUserStore as L } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import { useScreenSize as R } from "../../../common/hooks/useScreenSize.es.js";
|
|
3
|
+
import z from "../../../common/components/dialog/Dialog.es.js";
|
|
4
|
+
import I from "./actions/ResetPasswordAction.es.js";
|
|
5
5
|
import N from "./actions/VerifyEmailAction.es.js";
|
|
6
|
-
import
|
|
6
|
+
import $ from "./actions/VerifyPhoneAction.es.js";
|
|
7
7
|
import p from "react";
|
|
8
|
-
import { observer as
|
|
8
|
+
import { observer as j } from "mobx-react-lite";
|
|
9
9
|
import l from "@mui/material/Stack";
|
|
10
|
-
import { H3 as
|
|
11
|
-
import
|
|
10
|
+
import { H3 as H, P as J } from "@mxenabled/mxui";
|
|
11
|
+
import O from "@mui/material/Button";
|
|
12
12
|
import { Fragment as G, jsx as t, jsxs as i } from "react/jsx-runtime";
|
|
13
13
|
import { alpha as b, useTheme as K } from "@mui/material/styles";
|
|
14
14
|
import Y from "@mui/material/Box";
|
|
15
15
|
import { getUnixTime as q } from "date-fns/getUnixTime";
|
|
16
16
|
import d from "@mui/material/TextField";
|
|
17
17
|
import { AdapterDateFns as Q } from "@mui/x-date-pickers/AdapterDateFns";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
18
|
+
import { DatePicker as W } from "@mui/x-date-pickers";
|
|
19
|
+
import { LocalizationProvider as X } from "@mui/x-date-pickers/LocalizationProvider";
|
|
20
20
|
var Z = ({ availableWidth: C, handleOnLeaveClick: u }) => {
|
|
21
|
-
const f = K(), { common: w, settings: o } = B(), { isMobile:
|
|
21
|
+
const f = K(), { common: w, settings: o } = B(), { isMobile: c } = R(C), { config: h } = E(), { updateUser: S } = M(), { user: r } = L(), [a, P] = p.useState({
|
|
22
22
|
first_name: r.first_name,
|
|
23
23
|
last_name: r.last_name,
|
|
24
24
|
email: r.email,
|
|
@@ -26,18 +26,18 @@ var Z = ({ availableWidth: C, handleOnLeaveClick: u }) => {
|
|
|
26
26
|
birthday: r.birthday,
|
|
27
27
|
postal_code: r.postal_code,
|
|
28
28
|
credit_score: r.credit_score
|
|
29
|
-
}), [
|
|
29
|
+
}), [m, y] = p.useState(!1), [T, g] = p.useState(!1), _ = p.useRef(null), v = a.email && !r.email_is_verified && !m, x = a.phone && !r.phone_is_verified && !m;
|
|
30
30
|
p.useEffect(() => {
|
|
31
31
|
if (u) {
|
|
32
32
|
const e = (s) => {
|
|
33
|
-
_.current && !_.current.contains(s.target) &&
|
|
33
|
+
_.current && !_.current.contains(s.target) && m && g(!0);
|
|
34
34
|
};
|
|
35
35
|
return document.addEventListener("mousedown", e), () => {
|
|
36
36
|
document.removeEventListener("mousedown", e);
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
}, [
|
|
40
|
-
const
|
|
39
|
+
}, [m]);
|
|
40
|
+
const U = () => {
|
|
41
41
|
if (a.birthday) {
|
|
42
42
|
const e = /* @__PURE__ */ new Date(a.birthday * 1e3), s = e.getUTCFullYear(), F = e.getUTCMonth(), A = e.getUTCDate();
|
|
43
43
|
return new Date(s, F, A);
|
|
@@ -56,7 +56,7 @@ var Z = ({ availableWidth: C, handleOnLeaveClick: u }) => {
|
|
|
56
56
|
...a,
|
|
57
57
|
...e
|
|
58
58
|
};
|
|
59
|
-
|
|
59
|
+
P(s), y(JSON.stringify({
|
|
60
60
|
...r,
|
|
61
61
|
...s
|
|
62
62
|
}) !== JSON.stringify(r));
|
|
@@ -70,13 +70,13 @@ var Z = ({ availableWidth: C, handleOnLeaveClick: u }) => {
|
|
|
70
70
|
"& .MuiTextField-root, & .MuiPickersTextField-root": { flex: 1 }
|
|
71
71
|
},
|
|
72
72
|
children: [
|
|
73
|
-
/* @__PURE__ */ t(
|
|
74
|
-
/* @__PURE__ */ t(
|
|
73
|
+
/* @__PURE__ */ t(H, { children: o.personal_details }),
|
|
74
|
+
/* @__PURE__ */ t(J, {
|
|
75
75
|
variant: "body1",
|
|
76
76
|
children: o.update_information
|
|
77
77
|
}),
|
|
78
78
|
/* @__PURE__ */ i(l, {
|
|
79
|
-
direction:
|
|
79
|
+
direction: c ? "column" : "row",
|
|
80
80
|
spacing: 24,
|
|
81
81
|
sx: {
|
|
82
82
|
mb: 24,
|
|
@@ -93,12 +93,12 @@ var Z = ({ availableWidth: C, handleOnLeaveClick: u }) => {
|
|
|
93
93
|
})]
|
|
94
94
|
}),
|
|
95
95
|
/* @__PURE__ */ i(l, {
|
|
96
|
-
direction:
|
|
96
|
+
direction: c ? "column" : "row",
|
|
97
97
|
children: [h.display_email_edit_field_in_settings && /* @__PURE__ */ i(l, {
|
|
98
98
|
sx: {
|
|
99
99
|
flex: 1,
|
|
100
100
|
mb: v ? 20 : 24,
|
|
101
|
-
mr:
|
|
101
|
+
mr: c ? 0 : 24
|
|
102
102
|
},
|
|
103
103
|
children: [/* @__PURE__ */ t(d, {
|
|
104
104
|
defaultValue: a.email,
|
|
@@ -115,16 +115,16 @@ var Z = ({ availableWidth: C, handleOnLeaveClick: u }) => {
|
|
|
115
115
|
label: o.mobile_number,
|
|
116
116
|
onChange: (e) => n({ phone: e.target.value }),
|
|
117
117
|
type: "tel"
|
|
118
|
-
}), x && /* @__PURE__ */ t(
|
|
118
|
+
}), x && /* @__PURE__ */ t($, {})]
|
|
119
119
|
})]
|
|
120
120
|
}),
|
|
121
121
|
/* @__PURE__ */ i(l, {
|
|
122
|
-
direction:
|
|
122
|
+
direction: c ? "column" : "row",
|
|
123
123
|
spacing: 24,
|
|
124
124
|
sx: { mb: 24 },
|
|
125
|
-
children: [/* @__PURE__ */ t(
|
|
125
|
+
children: [/* @__PURE__ */ t(X, {
|
|
126
126
|
dateAdapter: Q,
|
|
127
|
-
children: /* @__PURE__ */ t(
|
|
127
|
+
children: /* @__PURE__ */ t(W, {
|
|
128
128
|
label: o.birthdate,
|
|
129
129
|
onChange: (e) => n({ birthday: q(e) }),
|
|
130
130
|
slotProps: {
|
|
@@ -144,7 +144,7 @@ var Z = ({ availableWidth: C, handleOnLeaveClick: u }) => {
|
|
|
144
144
|
"&:hover": { backgroundColor: b(f.palette.primary.light, 0.1) }
|
|
145
145
|
}
|
|
146
146
|
},
|
|
147
|
-
value:
|
|
147
|
+
value: U()
|
|
148
148
|
})
|
|
149
149
|
}), /* @__PURE__ */ t(d, {
|
|
150
150
|
defaultValue: a.postal_code,
|
|
@@ -158,26 +158,26 @@ var Z = ({ availableWidth: C, handleOnLeaveClick: u }) => {
|
|
|
158
158
|
label: o.credit_score,
|
|
159
159
|
onChange: (e) => n({ credit_score: Number(e.target.value) })
|
|
160
160
|
}),
|
|
161
|
-
h.display_password_options_in_settings && /* @__PURE__ */ t(
|
|
162
|
-
/* @__PURE__ */ t(
|
|
163
|
-
disabled: !
|
|
161
|
+
h.display_password_options_in_settings && /* @__PURE__ */ t(I, {}),
|
|
162
|
+
/* @__PURE__ */ t(O, {
|
|
163
|
+
disabled: !m,
|
|
164
164
|
onClick: V,
|
|
165
|
-
sx: { width:
|
|
165
|
+
sx: { width: c ? "100%" : 124 },
|
|
166
166
|
variant: "contained",
|
|
167
167
|
children: w.save_button
|
|
168
168
|
})
|
|
169
169
|
] })
|
|
170
170
|
]
|
|
171
|
-
}), /* @__PURE__ */ t(
|
|
171
|
+
}), /* @__PURE__ */ t(z, {
|
|
172
172
|
copy: { title: o.discard_changes },
|
|
173
|
-
isOpen:
|
|
173
|
+
isOpen: T,
|
|
174
174
|
onClose: D,
|
|
175
175
|
onSecondaryAction: k,
|
|
176
176
|
primaryText: o.keep_editing,
|
|
177
177
|
secondaryText: o.leave,
|
|
178
178
|
children: o.discard_changes_message
|
|
179
179
|
})] });
|
|
180
|
-
}, ye =
|
|
180
|
+
}, ye = j(Z);
|
|
181
181
|
export {
|
|
182
182
|
ye as default
|
|
183
183
|
};
|
|
@@ -11,9 +11,9 @@ import De from "../../../common/components/Loader.es.js";
|
|
|
11
11
|
import { BottomActions as m, DEFAULT_BOTTOM_ACTIONS as Ae, DEFAULT_TOP_ACTIONS as ve, TopActions as f } from "../../constants/Actions.es.js";
|
|
12
12
|
import { resolveInsightRender as Ie } from "../../../insights-v2/resolveInsightRender.es.js";
|
|
13
13
|
import { isContactSupportCtaDisabled as xe } from "../../../insights-v2/actionBlocks/ContactSupportActionBlock.es.js";
|
|
14
|
-
import Le from "../../../insights-v2/
|
|
14
|
+
import { actionBlocksKey as Le } from "../../../insights-v2/mappings/actionBlocksKey.es.js";
|
|
15
15
|
import we from "../../../insights-v2/components/InsightErrorCard.es.js";
|
|
16
|
-
import
|
|
16
|
+
import Ee from "../../../insights-v2/components/CompactInsightCard.es.js";
|
|
17
17
|
import Me from "../../../insights/components/shared/ChartTransactionWithDrillDown.es.js";
|
|
18
18
|
import { EmbeddedCard as Oe } from "../../../insights/components/shared/InsightsCard/EmbeddedCard.es.js";
|
|
19
19
|
import { AddMerchantBudgetAction as Be } from "./transactiondetails/actions/AddMerchantBudgetAction.es.js";
|
|
@@ -46,7 +46,7 @@ import Qe from "@mui/material/Alert";
|
|
|
46
46
|
import Ze from "@mui/material/Snackbar";
|
|
47
47
|
var et = ({ bottomActions: _ = Ae, canFlagTransaction: K = !0, topActions: v = ve, transaction: e, shouldShowEmbeddedCard: I = !0, onContactSupport: x }) => {
|
|
48
48
|
const { onEvent: X } = pe(), { config: Y } = ce(), { isCopyLoaded: $ } = fe(), { userFeatures: J } = _e(), { accounts: Q, common: Z, insights_feed: l } = ge(), { detailedCategories: L } = ue(), { alert: w, associatedBeats: E, detailedTransactions: M, cachedStartDate: O, loadEmbeddedInstanceTransactions: ee, setAlert: B } = he(), [te, N] = n.useState(!1), [k, F] = n.useState(!1), [oe, re] = n.useState(!1), ie = $e(), ae = e?.number && e.number.length > 4, P = e?.transaction_type === Te.CREDIT, R = be(e) && !!e.institutionName, a = n.useMemo(() => E.find((o) => o.associated_transaction_guid === e.guid), [E, e]), T = I ? Ie(a) : "legacy", y = T === "v2" ? a?.insights_payload : void 0, r = I && T === "legacy" ? ze(Z, a) : null, ne = (o) => {
|
|
49
|
-
o.block ===
|
|
49
|
+
o.block === Le.CONTACT_SUPPORT_ACTION_BLOCK && x?.();
|
|
50
50
|
}, [d, C] = n.useState(r ? r.dataSeries.length - 1 : 0);
|
|
51
51
|
n.useEffect(() => X(Ce.TRANSACTION_DETAILS_VIEW, { transaction_guid: e.guid }), []), n.useEffect(() => {
|
|
52
52
|
if (!r || r.dataSeries.length === 0) return;
|
|
@@ -118,7 +118,8 @@ var et = ({ bottomActions: _ = Ae, canFlagTransaction: K = !0, topActions: v = v
|
|
|
118
118
|
children: [P ? "+" : "", V(e.amount, "0,0.00")]
|
|
119
119
|
}), !c && K && /* @__PURE__ */ t(We, { transaction: e })]
|
|
120
120
|
}),
|
|
121
|
-
y && /* @__PURE__ */ t(
|
|
121
|
+
y && /* @__PURE__ */ t(Ee, {
|
|
122
|
+
beat: a,
|
|
122
123
|
isCtaDisabled: xe(y.primary_cta?.block, Y, x),
|
|
123
124
|
onCtaClick: ne,
|
|
124
125
|
payload: y
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionDetails.es.js","names":[],"sources":["../../../../src/transactions/components/shared/TransactionDetails.tsx"],"sourcesContent":["import React, { useMemo } from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Alert from '@mui/material/Alert'\nimport Box from '@mui/material/Box'\nimport Divider from '@mui/material/Divider'\nimport List from '@mui/material/List'\nimport Paper from '@mui/material/Paper'\nimport Snackbar from '@mui/material/Snackbar'\nimport Stack from '@mui/material/Stack'\nimport { useTheme } from '@mui/material/styles'\n\nimport { MerchantLogo, P, Text } from '@mxenabled/mxui'\n\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { isBefore } from 'date-fns/isBefore'\nimport { startOfMonth } from 'date-fns/startOfMonth'\n\nimport {\n ANALYTICS_EVENTS,\n Loader,\n useAppConfig,\n useCategoryStore,\n useEvent,\n useGlobalCopyStore,\n useGlobalUiStore,\n useTransactionStore,\n useUserStore,\n} from '../../../common'\nimport { DATE_FORMATS_INTL, formatDate } from '../../../core/constants'\nimport { type PrimaryCTA, Transaction, TransactionType } from '../../../core'\n// Leaf imports on purpose: the `insights-v2` barrel pulls in `mappings/blocks`, whose chart blocks\n// reach back into transactions code — the circular-import/TDZ trap `actionBlocksKey.ts` documents.\nimport { isContactSupportCtaDisabled } from '../../../insights-v2/actionBlocks/ContactSupportActionBlock'\nimport CompactInsightCard from '../../../insights-v2/components/CompactInsightCard'\nimport InsightErrorCard from '../../../insights-v2/components/InsightErrorCard'\nimport { actionBlocksKey } from '../../../insights-v2/mappings/actionBlocksKey'\nimport { resolveInsightRender } from '../../../insights-v2/resolveInsightRender'\nimport { fromUnixUTC } from '../../../core/utils/DateUtil'\nimport { isTransferTransaction } from '../../../core/utils/TransactionUtils'\nimport { isFeatureEnabled } from '../../../core/utils/UserUtils'\nimport { ChartTransactionWithDrillDown, EmbeddedCard } from '../../../insights'\n\nimport {\n BottomActions,\n DEFAULT_BOTTOM_ACTIONS,\n DEFAULT_TOP_ACTIONS,\n TopActions,\n} from '../../constants/Actions'\n\nimport {\n AddMerchantBudgetAction,\n CategoryAction,\n DateAction,\n DeleteAction,\n DeleteLogoAction,\n ExcludeAction,\n MemoAction,\n SplitAction,\n TagsAction,\n} from './transactiondetails/actions'\nimport Description from './transactiondetails/Description'\nimport FlagTransaction from './transactiondetails/FlagTransaction'\nimport TransactionDetailsView from './transactiondetails/TransactionDetailsView'\nimport { getEmbeddedInstanceSlotByBeatTemplates } from './getEmbeddedInstanceSlotByBeatTemplates'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { buildDynamicCopy } from '../../../core/utils/Localization'\n\nexport interface TransactionDetailsProps {\n bottomActions?: BottomActions[]\n canFlagTransaction?: boolean\n topActions?: TopActions[]\n transaction: Transaction\n shouldShowEmbeddedCard?: boolean\n /**\n * Opens the host's contact-support flow when the embedded insight card's CTA is\n * `contact_support_block`. This module cannot import the help module (hosts that don't ship the\n * Help widget stub the import — pulse's webpack `IgnorePlugin`), so the host supplies it. Without\n * it, or with the client's `enable_support_requests` off, the CTA renders disabled.\n */\n onContactSupport?: () => void\n}\n\nconst TransactionDetails: React.FC<TransactionDetailsProps> = ({\n bottomActions = DEFAULT_BOTTOM_ACTIONS,\n canFlagTransaction = true,\n topActions = DEFAULT_TOP_ACTIONS,\n transaction,\n shouldShowEmbeddedCard = true,\n onContactSupport,\n}) => {\n const { onEvent } = useEvent()\n const { config } = useAppConfig()\n const { isCopyLoaded } = useGlobalUiStore()\n const { userFeatures } = useUserStore()\n const { accounts: copy, common: commonCopy, insights_feed: insightsCopy } = useGlobalCopyStore()\n\n const { detailedCategories } = useCategoryStore()\n const {\n alert,\n associatedBeats,\n detailedTransactions,\n cachedStartDate,\n loadEmbeddedInstanceTransactions,\n setAlert,\n } = useTransactionStore()\n\n const [showTranscationDrilldownDrawer, setShowTransactionDrillDownDrawer] = React.useState(false)\n\n const [isLoading, setIsLoading] = React.useState(false)\n const [closeTipSection, setCloseTipSection] = React.useState(false)\n const theme = useTheme()\n\n const showFullNumber = transaction?.number && transaction.number.length > 4\n\n const isCredit = transaction?.transaction_type === TransactionType.CREDIT\n\n const showInstitution = isTransferTransaction(transaction) && Boolean(transaction.institutionName)\n\n const beat = React.useMemo(() => {\n return associatedBeats.find((beat) => beat.associated_transaction_guid === transaction.guid)\n }, [associatedBeats, transaction])\n\n // Insights 2.0 (insights_v2.2.md §8.3, §10.1): branch on the beat the widget already matched from\n // its associated-beats fetch (which carries `widget_type=embedded`). `v2` renders the compact card\n // from the held envelope and `error` the error card, both in the slot above the account block;\n // only `legacy` runs the per-template switch below. There is deliberately no fetch on open.\n const insightRender = shouldShowEmbeddedCard ? resolveInsightRender(beat) : 'legacy'\n const v2Payload = insightRender === 'v2' ? beat?.insights_payload : undefined\n\n const embeddedData =\n shouldShowEmbeddedCard && insightRender === 'legacy'\n ? getEmbeddedInstanceSlotByBeatTemplates(commonCopy, beat)\n : null\n\n // `contact_support_block` hands off to the host's flow (see `onContactSupport`). The card itself\n // never opens anything; `isContactSupportCtaDisabled` keeps the CTA inert when it cannot be honoured.\n const handleV2CtaClick = (cta: PrimaryCTA) => {\n if (cta.block === actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK) {\n onContactSupport?.()\n }\n }\n\n const [selectedTabIndex, setSelectedTabIndex] = React.useState(\n embeddedData ? embeddedData.dataSeries.length - 1 : 0,\n )\n\n React.useEffect(\n () =>\n onEvent(ANALYTICS_EVENTS.TRANSACTION_DETAILS_VIEW, { transaction_guid: transaction.guid }),\n [],\n )\n\n React.useEffect(() => {\n if (!embeddedData || embeddedData.dataSeries.length === 0) return\n\n const { date: selectedSeriesItemDate } = embeddedData.dataSeries[selectedTabIndex]\n\n const start = startOfMonth(selectedSeriesItemDate)\n\n if (isBefore(start, cachedStartDate)) {\n setIsLoading(true)\n loadEmbeddedInstanceTransactions(start).finally(() => {\n setIsLoading(false)\n })\n }\n }, [selectedTabIndex, embeddedData, cachedStartDate])\n\n //if merchant_guid is null then no need to show the MerchantBudget action.\n const updatedBottomActions =\n bottomActions.includes(BottomActions.MerchantBudget) && !transaction?.merchant_guid\n ? bottomActions.filter((action) => action !== BottomActions.MerchantBudget)\n : bottomActions\n\n const embeddedCardDataCategory = useMemo(() => {\n if (embeddedData) {\n const category = detailedCategories.find(\n (cat) => cat.guid === transaction.top_level_category_guid,\n )\n const mean = beat?.payload?.average_amount ?? 0\n const currentAmount = transaction.amount\n\n let changetype = insightsCopy.general.increased_text\n if (currentAmount - mean < 0) {\n changetype = insightsCopy.general.decreased_text\n }\n const percentageAmount =\n mean === 0 ? 0 : Math.round((Math.abs(currentAmount - mean) / mean) * 100)\n\n return { category, percentageAmount, changetype }\n }\n return null\n }, [embeddedData, detailedCategories])\n\n const filteredTransactions = useMemo(() => {\n if (!embeddedData?.dataSeries?.length) {\n return []\n }\n\n const { guid: selectedSeriesItemGuid, date: selectedSeriesItemDate } =\n embeddedData.dataSeries[selectedTabIndex]\n\n const start = startOfMonth(selectedSeriesItemDate)\n const end = endOfMonth(selectedSeriesItemDate)\n\n return detailedTransactions.filter((t) => {\n const transactionDate = fromUnixUTC(t.date)\n return transactionDate >= start && transactionDate <= end && t.guid === selectedSeriesItemGuid\n })\n }, [selectedTabIndex, embeddedData, detailedTransactions, isLoading])\n\n if (!isCopyLoaded) {\n return <Loader />\n }\n\n const shouldShowViewOnlyMode = isFeatureEnabled(userFeatures, 'MX_TXN_DETAILS_VIEW_ONLY')\n\n const bgColor = theme.palette.mode === 'dark' ? 'grey.800' : 'grey.100'\n\n return (\n <Box className=\"mx-txn-transaction-details\" width=\"100%\">\n {transaction && (\n <Stack>\n <Stack gap={12} p={24}>\n <Paper elevation={2} sx={{ width: 64 }}>\n <MerchantLogo\n categoryGuid={transaction.top_level_category_guid || ''}\n merchantGuid={transaction.merchant_guid || ''}\n size={64}\n />\n </Paper>\n\n <Description\n displayValue={showInstitution ? transaction.institutionName : undefined}\n transaction={transaction}\n viewOnly={shouldShowViewOnlyMode || showInstitution}\n />\n\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ minHeight: 44 }}>\n <P color={isCredit ? 'success.main' : 'text.primary'} variant=\"h1\">\n {isCredit ? '+' : ''}\n {formatCurrency(transaction.amount, '0,0.00')}\n </P>\n {!shouldShowViewOnlyMode && canFlagTransaction && (\n <FlagTransaction transaction={transaction} />\n )}\n </Stack>\n\n {v2Payload && (\n <CompactInsightCard\n isCtaDisabled={isContactSupportCtaDisabled(\n v2Payload.primary_cta?.block,\n config,\n onContactSupport,\n )}\n onCtaClick={handleV2CtaClick}\n payload={v2Payload}\n />\n )}\n {insightRender === 'error' && beat && <InsightErrorCard beat={beat} variant=\"plain\" />}\n {embeddedData?.instanceSlot && (\n <EmbeddedCard\n callToAction={embeddedData.callToAction}\n description={\n buildDynamicCopy(\n insightsCopy.general.embedded_description,\n embeddedCardDataCategory!.changetype,\n <strong>{embeddedCardDataCategory!.percentageAmount}</strong>,\n ) as string\n }\n instanceSlot={embeddedData.instanceSlot}\n onCtaClick={() => {\n setShowTransactionDrillDownDrawer(true)\n }}\n title={beat!.html_micro_title!}\n />\n )}\n <Stack sx={{ bgcolor: bgColor, borderRadius: '4px', gap: 4, p: 8 }}>\n <Text bold={true}>\n {`${transaction.account}\n ${\n showFullNumber\n ? transaction.number\n : '\\u2022'.repeat(4).concat(transaction.number ?? '')\n }`}\n </Text>\n <Text bold={true} truncate={true} variant=\"tiny\">\n {transaction.feed_description}\n </Text>\n </Stack>\n </Stack>\n\n <Paper square={true} sx={{ boxShadow: 'none' }}>\n {shouldShowViewOnlyMode ? (\n <TransactionDetailsView transaction={transaction} />\n ) : (\n <List>\n {topActions.map((action, index) => (\n <React.Fragment key={action}>\n {action === TopActions.Category && <CategoryAction transaction={transaction} />}\n {action === TopActions.Date && <DateAction transaction={transaction} />}\n {action === TopActions.Memo && <MemoAction transaction={transaction} />}\n {action === TopActions.Tags && <TagsAction transaction={transaction} />}\n <Divider\n component=\"li\"\n variant={index < topActions.length - 1 ? 'inset' : 'fullWidth'}\n />\n </React.Fragment>\n ))}\n </List>\n )}\n </Paper>\n\n {!shouldShowViewOnlyMode && updatedBottomActions.length > 0 && (\n <React.Fragment>\n <Text bold={true} mb={8} ml={26} mt={16} variant=\"body1\">\n {copy.actions}\n </Text>\n\n <Paper square={true} sx={{ boxShadow: 'none' }}>\n <List>\n {updatedBottomActions.map((action, index) => (\n <React.Fragment key={action}>\n {action === BottomActions.MerchantBudget && (\n <AddMerchantBudgetAction transaction={transaction} />\n )}\n {action === BottomActions.SplitTransaction && (\n <SplitAction transaction={transaction} />\n )}\n {action === BottomActions.HideTransaction && (\n <ExcludeAction transaction={transaction} />\n )}\n {action === BottomActions.MerchantLogo && (\n <DeleteLogoAction transaction={transaction} />\n )}\n <Divider\n component=\"li\"\n variant={index < updatedBottomActions.length - 1 ? 'inset' : 'fullWidth'}\n />\n </React.Fragment>\n ))}\n\n {/*\n Show DeleteAction only if:\n - The transaction is manual\n - The transaction is NOT a parent transaction (no parent_guid)\n - The transaction has NOT been split (has_been_split is false)\n \n This ensures delete is hidden for parent or split transactions.\n */}\n {transaction.is_manual &&\n !transaction.parent_guid &&\n !transaction.has_been_split && <DeleteAction transaction={transaction} />}\n </List>\n </Paper>\n </React.Fragment>\n )}\n </Stack>\n )}\n {beat && embeddedData && (\n <ChartTransactionWithDrillDown\n ariaLabel={formatDate(\n embeddedData?.dataSeries[selectedTabIndex]?.date,\n DATE_FORMATS_INTL.MONTH,\n )}\n barChartProps={{\n amounts: {\n average: beat.payload.average_amount,\n formattedAverage: formatCurrency(beat.payload.average_amount, '0,0'),\n },\n color: embeddedCardDataCategory!.category?.color || '',\n data: embeddedData.chartData,\n margin: { bottom: 10, left: 24, right: 24, top: 20 },\n monthlyAmountLabel: insightsCopy.general.monthly_amount,\n onBarClick: (index) => {\n setSelectedTabIndex(index)\n },\n trendAmountLabel: insightsCopy.general.trend,\n legendPosition: 'top',\n }}\n beat={{\n heading: beat.html_title,\n subHeading: {\n category_guid: transaction.category_guid ?? '',\n merchant_guid: transaction.merchant_guid ?? '',\n description: transaction.description ?? '',\n },\n }}\n data={embeddedData.chartData}\n defaultSelectedIndex={selectedTabIndex}\n icon={\n <MerchantLogo\n alt={transaction.description ?? ''}\n categoryGuid={transaction.category_guid ?? ''}\n merchantGuid={transaction.merchant_guid ?? ''}\n size={16}\n />\n }\n isOpen={showTranscationDrilldownDrawer}\n onClose={() => {\n setShowTransactionDrillDownDrawer(false)\n setSelectedTabIndex(embeddedData!.dataSeries.length - 1)\n }}\n onTabChange={(index: number) => {\n setSelectedTabIndex(index)\n }}\n tipSection={\n !closeTipSection\n ? {\n message: buildDynamicCopy(\n insightsCopy.general.tip_section_message,\n <strong>{insightsCopy.general.tip_section_title}</strong>,\n <strong>{beat.primary_transaction?.description}</strong>,\n ) as string,\n onDismiss: () => setCloseTipSection(true),\n }\n : undefined\n }\n title={insightsCopy.general.transaction_history_title}\n transactionListProps={{\n showLoader: isLoading,\n showInsights: true,\n transaction: filteredTransactions,\n }}\n />\n )}\n <Snackbar\n anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}\n autoHideDuration={3500}\n onClose={() => setAlert('')}\n open={Boolean(alert)}\n >\n <Alert closeText=\"\" onClose={() => setAlert('')} severity=\"success\" variant=\"filled\">\n {alert}\n </Alert>\n </Snackbar>\n </Box>\n )\n}\n\nexport default observer(TransactionDetails)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFA,IAAM,KAAA,CAAyD,EAC7D,eAAA,IAAgB,IAChB,oBAAA,IAAqB,IACrB,YAAA,IAAa,IACb,aAAA,GACA,wBAAA,IAAyB,IACzB,kBAAA,EAAA,MACI;AACJ,QAAM,EAAE,SAAA,EAAA,IAAY,GAAS,GACvB,EAAE,QAAA,EAAA,IAAW,GAAa,GAC1B,EAAE,cAAA,EAAA,IAAiB,GAAiB,GACpC,EAAE,cAAA,EAAA,IAAiB,GAAa,GAChC,EAAE,UAAU,GAAM,QAAQ,GAAY,eAAe,EAAA,IAAiB,GAAmB,GAEzF,EAAE,oBAAA,EAAA,IAAuB,GAAiB,GAC1C,EACJ,OAAA,GACA,iBAAA,GACA,sBAAA,GACA,iBAAA,GACA,kCAAA,IACA,UAAA,EAAA,IACE,GAAoB,GAElB,CAAC,IAAgC,CAAA,IAAqC,EAAM,SAAS,EAAK,GAE1F,CAAC,GAAW,CAAA,IAAgB,EA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S,EAAK,qBAAqB,YAAoB,CAAA,CACzD;AAAA,UACA,WAAA,MAAiB,GAAmB,EAAI;AAAA,QAC1C;AAAA,QAGN,OAAO,EAAa,QAAQ;AAAA,QAC5B,sBAAsB;AAAA,UACpB,YAAY;AAAA,UACZ,cAAc;AAAA,UACd,aAAa;AAAA,QACf;AAAA,MACD,CAAA;AAAA,MAEH,gBAAA,EAAC,IAAD;AAAA,QACE,cAAc;AAAA,UAAE,UAAU;AAAA,UAAU,YAAY;AAAA,QAAQ;AAAA,QACxD,kBAAkB;AAAA,QAClB,SAAA,MAAe,EAAS,EAAE;AAAA,QAC1B,MAAM,EAAQ;AAAA,QAEd,UAAA,gBAAA,EAAC,IAAD;AAAA,UAAO,WAAU;AAAA,UAAG,SAAA,MAAe,EAAS,EAAE;AAAA,UAAG,UAAS;AAAA,UAAU,SAAQ;AAAA,UACzE,UAAA;AAAA,QACI,CAAA;AAAA,MACC,CAAA;AAAA,IACP;AAAA;AAET,GAEA,KAAe,GAAS,EAAkB"}
|
|
1
|
+
{"version":3,"file":"TransactionDetails.es.js","names":[],"sources":["../../../../src/transactions/components/shared/TransactionDetails.tsx"],"sourcesContent":["import React, { useMemo } from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Alert from '@mui/material/Alert'\nimport Box from '@mui/material/Box'\nimport Divider from '@mui/material/Divider'\nimport List from '@mui/material/List'\nimport Paper from '@mui/material/Paper'\nimport Snackbar from '@mui/material/Snackbar'\nimport Stack from '@mui/material/Stack'\nimport { useTheme } from '@mui/material/styles'\n\nimport { MerchantLogo, P, Text } from '@mxenabled/mxui'\n\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { isBefore } from 'date-fns/isBefore'\nimport { startOfMonth } from 'date-fns/startOfMonth'\n\nimport {\n ANALYTICS_EVENTS,\n Loader,\n useAppConfig,\n useCategoryStore,\n useEvent,\n useGlobalCopyStore,\n useGlobalUiStore,\n useTransactionStore,\n useUserStore,\n} from '../../../common'\nimport { DATE_FORMATS_INTL, formatDate } from '../../../core/constants'\nimport { type PrimaryCTA, Transaction, TransactionType } from '../../../core'\n// Leaf imports on purpose: the `insights-v2` barrel pulls in `mappings/blocks`, whose chart blocks\n// reach back into transactions code — the circular-import/TDZ trap `actionBlocksKey.ts` documents.\nimport { isContactSupportCtaDisabled } from '../../../insights-v2/actionBlocks/ContactSupportActionBlock'\nimport CompactInsightCard from '../../../insights-v2/components/CompactInsightCard'\nimport InsightErrorCard from '../../../insights-v2/components/InsightErrorCard'\nimport { actionBlocksKey } from '../../../insights-v2/mappings/actionBlocksKey'\nimport { resolveInsightRender } from '../../../insights-v2/resolveInsightRender'\nimport { fromUnixUTC } from '../../../core/utils/DateUtil'\nimport { isTransferTransaction } from '../../../core/utils/TransactionUtils'\nimport { isFeatureEnabled } from '../../../core/utils/UserUtils'\nimport { ChartTransactionWithDrillDown, EmbeddedCard } from '../../../insights'\n\nimport {\n BottomActions,\n DEFAULT_BOTTOM_ACTIONS,\n DEFAULT_TOP_ACTIONS,\n TopActions,\n} from '../../constants/Actions'\n\nimport {\n AddMerchantBudgetAction,\n CategoryAction,\n DateAction,\n DeleteAction,\n DeleteLogoAction,\n ExcludeAction,\n MemoAction,\n SplitAction,\n TagsAction,\n} from './transactiondetails/actions'\nimport Description from './transactiondetails/Description'\nimport FlagTransaction from './transactiondetails/FlagTransaction'\nimport TransactionDetailsView from './transactiondetails/TransactionDetailsView'\nimport { getEmbeddedInstanceSlotByBeatTemplates } from './getEmbeddedInstanceSlotByBeatTemplates'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { buildDynamicCopy } from '../../../core/utils/Localization'\n\nexport interface TransactionDetailsProps {\n bottomActions?: BottomActions[]\n canFlagTransaction?: boolean\n topActions?: TopActions[]\n transaction: Transaction\n shouldShowEmbeddedCard?: boolean\n /**\n * Opens the host's contact-support flow when the embedded insight card's CTA is\n * `contact_support_block`. This module cannot import the help module (hosts that don't ship the\n * Help widget stub the import — pulse's webpack `IgnorePlugin`), so the host supplies it. Without\n * it, or with the client's `enable_support_requests` off, the CTA renders disabled.\n */\n onContactSupport?: () => void\n}\n\nconst TransactionDetails: React.FC<TransactionDetailsProps> = ({\n bottomActions = DEFAULT_BOTTOM_ACTIONS,\n canFlagTransaction = true,\n topActions = DEFAULT_TOP_ACTIONS,\n transaction,\n shouldShowEmbeddedCard = true,\n onContactSupport,\n}) => {\n const { onEvent } = useEvent()\n const { config } = useAppConfig()\n const { isCopyLoaded } = useGlobalUiStore()\n const { userFeatures } = useUserStore()\n const { accounts: copy, common: commonCopy, insights_feed: insightsCopy } = useGlobalCopyStore()\n\n const { detailedCategories } = useCategoryStore()\n const {\n alert,\n associatedBeats,\n detailedTransactions,\n cachedStartDate,\n loadEmbeddedInstanceTransactions,\n setAlert,\n } = useTransactionStore()\n\n const [showTranscationDrilldownDrawer, setShowTransactionDrillDownDrawer] = React.useState(false)\n\n const [isLoading, setIsLoading] = React.useState(false)\n const [closeTipSection, setCloseTipSection] = React.useState(false)\n const theme = useTheme()\n\n const showFullNumber = transaction?.number && transaction.number.length > 4\n\n const isCredit = transaction?.transaction_type === TransactionType.CREDIT\n\n const showInstitution = isTransferTransaction(transaction) && Boolean(transaction.institutionName)\n\n const beat = React.useMemo(() => {\n return associatedBeats.find((beat) => beat.associated_transaction_guid === transaction.guid)\n }, [associatedBeats, transaction])\n\n // Insights 2.0 (insights_v2.2.md §8.3, §10.1): branch on the beat the widget already matched from\n // its associated-beats fetch (which carries `widget_type=embedded`). `v2` renders the compact card\n // from the held envelope and `error` the error card, both in the slot above the account block;\n // only `legacy` runs the per-template switch below. There is deliberately no fetch on open.\n const insightRender = shouldShowEmbeddedCard ? resolveInsightRender(beat) : 'legacy'\n const v2Payload = insightRender === 'v2' ? beat?.insights_payload : undefined\n\n const embeddedData =\n shouldShowEmbeddedCard && insightRender === 'legacy'\n ? getEmbeddedInstanceSlotByBeatTemplates(commonCopy, beat)\n : null\n\n // `contact_support_block` hands off to the host's flow (see `onContactSupport`). The card itself\n // never opens anything; `isContactSupportCtaDisabled` keeps the CTA inert when it cannot be honoured.\n const handleV2CtaClick = (cta: PrimaryCTA) => {\n if (cta.block === actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK) {\n onContactSupport?.()\n }\n }\n\n const [selectedTabIndex, setSelectedTabIndex] = React.useState(\n embeddedData ? embeddedData.dataSeries.length - 1 : 0,\n )\n\n React.useEffect(\n () =>\n onEvent(ANALYTICS_EVENTS.TRANSACTION_DETAILS_VIEW, { transaction_guid: transaction.guid }),\n [],\n )\n\n React.useEffect(() => {\n if (!embeddedData || embeddedData.dataSeries.length === 0) return\n\n const { date: selectedSeriesItemDate } = embeddedData.dataSeries[selectedTabIndex]\n\n const start = startOfMonth(selectedSeriesItemDate)\n\n if (isBefore(start, cachedStartDate)) {\n setIsLoading(true)\n loadEmbeddedInstanceTransactions(start).finally(() => {\n setIsLoading(false)\n })\n }\n }, [selectedTabIndex, embeddedData, cachedStartDate])\n\n //if merchant_guid is null then no need to show the MerchantBudget action.\n const updatedBottomActions =\n bottomActions.includes(BottomActions.MerchantBudget) && !transaction?.merchant_guid\n ? bottomActions.filter((action) => action !== BottomActions.MerchantBudget)\n : bottomActions\n\n const embeddedCardDataCategory = useMemo(() => {\n if (embeddedData) {\n const category = detailedCategories.find(\n (cat) => cat.guid === transaction.top_level_category_guid,\n )\n const mean = beat?.payload?.average_amount ?? 0\n const currentAmount = transaction.amount\n\n let changetype = insightsCopy.general.increased_text\n if (currentAmount - mean < 0) {\n changetype = insightsCopy.general.decreased_text\n }\n const percentageAmount =\n mean === 0 ? 0 : Math.round((Math.abs(currentAmount - mean) / mean) * 100)\n\n return { category, percentageAmount, changetype }\n }\n return null\n }, [embeddedData, detailedCategories])\n\n const filteredTransactions = useMemo(() => {\n if (!embeddedData?.dataSeries?.length) {\n return []\n }\n\n const { guid: selectedSeriesItemGuid, date: selectedSeriesItemDate } =\n embeddedData.dataSeries[selectedTabIndex]\n\n const start = startOfMonth(selectedSeriesItemDate)\n const end = endOfMonth(selectedSeriesItemDate)\n\n return detailedTransactions.filter((t) => {\n const transactionDate = fromUnixUTC(t.date)\n return transactionDate >= start && transactionDate <= end && t.guid === selectedSeriesItemGuid\n })\n }, [selectedTabIndex, embeddedData, detailedTransactions, isLoading])\n\n if (!isCopyLoaded) {\n return <Loader />\n }\n\n const shouldShowViewOnlyMode = isFeatureEnabled(userFeatures, 'MX_TXN_DETAILS_VIEW_ONLY')\n\n const bgColor = theme.palette.mode === 'dark' ? 'grey.800' : 'grey.100'\n\n return (\n <Box className=\"mx-txn-transaction-details\" width=\"100%\">\n {transaction && (\n <Stack>\n <Stack gap={12} p={24}>\n <Paper elevation={2} sx={{ width: 64 }}>\n <MerchantLogo\n categoryGuid={transaction.top_level_category_guid || ''}\n merchantGuid={transaction.merchant_guid || ''}\n size={64}\n />\n </Paper>\n\n <Description\n displayValue={showInstitution ? transaction.institutionName : undefined}\n transaction={transaction}\n viewOnly={shouldShowViewOnlyMode || showInstitution}\n />\n\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ minHeight: 44 }}>\n <P color={isCredit ? 'success.main' : 'text.primary'} variant=\"h1\">\n {isCredit ? '+' : ''}\n {formatCurrency(transaction.amount, '0,0.00')}\n </P>\n {!shouldShowViewOnlyMode && canFlagTransaction && (\n <FlagTransaction transaction={transaction} />\n )}\n </Stack>\n\n {v2Payload && (\n <CompactInsightCard\n beat={beat}\n isCtaDisabled={isContactSupportCtaDisabled(\n v2Payload.primary_cta?.block,\n config,\n onContactSupport,\n )}\n onCtaClick={handleV2CtaClick}\n payload={v2Payload}\n />\n )}\n {insightRender === 'error' && beat && <InsightErrorCard beat={beat} variant=\"plain\" />}\n {embeddedData?.instanceSlot && (\n <EmbeddedCard\n callToAction={embeddedData.callToAction}\n description={\n buildDynamicCopy(\n insightsCopy.general.embedded_description,\n embeddedCardDataCategory!.changetype,\n <strong>{embeddedCardDataCategory!.percentageAmount}</strong>,\n ) as string\n }\n instanceSlot={embeddedData.instanceSlot}\n onCtaClick={() => {\n setShowTransactionDrillDownDrawer(true)\n }}\n title={beat!.html_micro_title!}\n />\n )}\n <Stack sx={{ bgcolor: bgColor, borderRadius: '4px', gap: 4, p: 8 }}>\n <Text bold={true}>\n {`${transaction.account}\n ${\n showFullNumber\n ? transaction.number\n : '\\u2022'.repeat(4).concat(transaction.number ?? '')\n }`}\n </Text>\n <Text bold={true} truncate={true} variant=\"tiny\">\n {transaction.feed_description}\n </Text>\n </Stack>\n </Stack>\n\n <Paper square={true} sx={{ boxShadow: 'none' }}>\n {shouldShowViewOnlyMode ? (\n <TransactionDetailsView transaction={transaction} />\n ) : (\n <List>\n {topActions.map((action, index) => (\n <React.Fragment key={action}>\n {action === TopActions.Category && <CategoryAction transaction={transaction} />}\n {action === TopActions.Date && <DateAction transaction={transaction} />}\n {action === TopActions.Memo && <MemoAction transaction={transaction} />}\n {action === TopActions.Tags && <TagsAction transaction={transaction} />}\n <Divider\n component=\"li\"\n variant={index < topActions.length - 1 ? 'inset' : 'fullWidth'}\n />\n </React.Fragment>\n ))}\n </List>\n )}\n </Paper>\n\n {!shouldShowViewOnlyMode && updatedBottomActions.length > 0 && (\n <React.Fragment>\n <Text bold={true} mb={8} ml={26} mt={16} variant=\"body1\">\n {copy.actions}\n </Text>\n\n <Paper square={true} sx={{ boxShadow: 'none' }}>\n <List>\n {updatedBottomActions.map((action, index) => (\n <React.Fragment key={action}>\n {action === BottomActions.MerchantBudget && (\n <AddMerchantBudgetAction transaction={transaction} />\n )}\n {action === BottomActions.SplitTransaction && (\n <SplitAction transaction={transaction} />\n )}\n {action === BottomActions.HideTransaction && (\n <ExcludeAction transaction={transaction} />\n )}\n {action === BottomActions.MerchantLogo && (\n <DeleteLogoAction transaction={transaction} />\n )}\n <Divider\n component=\"li\"\n variant={index < updatedBottomActions.length - 1 ? 'inset' : 'fullWidth'}\n />\n </React.Fragment>\n ))}\n\n {/*\n Show DeleteAction only if:\n - The transaction is manual\n - The transaction is NOT a parent transaction (no parent_guid)\n - The transaction has NOT been split (has_been_split is false)\n \n This ensures delete is hidden for parent or split transactions.\n */}\n {transaction.is_manual &&\n !transaction.parent_guid &&\n !transaction.has_been_split && <DeleteAction transaction={transaction} />}\n </List>\n </Paper>\n </React.Fragment>\n )}\n </Stack>\n )}\n {beat && embeddedData && (\n <ChartTransactionWithDrillDown\n ariaLabel={formatDate(\n embeddedData?.dataSeries[selectedTabIndex]?.date,\n DATE_FORMATS_INTL.MONTH,\n )}\n barChartProps={{\n amounts: {\n average: beat.payload.average_amount,\n formattedAverage: formatCurrency(beat.payload.average_amount, '0,0'),\n },\n color: embeddedCardDataCategory!.category?.color || '',\n data: embeddedData.chartData,\n margin: { bottom: 10, left: 24, right: 24, top: 20 },\n monthlyAmountLabel: insightsCopy.general.monthly_amount,\n onBarClick: (index) => {\n setSelectedTabIndex(index)\n },\n trendAmountLabel: insightsCopy.general.trend,\n legendPosition: 'top',\n }}\n beat={{\n heading: beat.html_title,\n subHeading: {\n category_guid: transaction.category_guid ?? '',\n merchant_guid: transaction.merchant_guid ?? '',\n description: transaction.description ?? '',\n },\n }}\n data={embeddedData.chartData}\n defaultSelectedIndex={selectedTabIndex}\n icon={\n <MerchantLogo\n alt={transaction.description ?? ''}\n categoryGuid={transaction.category_guid ?? ''}\n merchantGuid={transaction.merchant_guid ?? ''}\n size={16}\n />\n }\n isOpen={showTranscationDrilldownDrawer}\n onClose={() => {\n setShowTransactionDrillDownDrawer(false)\n setSelectedTabIndex(embeddedData!.dataSeries.length - 1)\n }}\n onTabChange={(index: number) => {\n setSelectedTabIndex(index)\n }}\n tipSection={\n !closeTipSection\n ? {\n message: buildDynamicCopy(\n insightsCopy.general.tip_section_message,\n <strong>{insightsCopy.general.tip_section_title}</strong>,\n <strong>{beat.primary_transaction?.description}</strong>,\n ) as string,\n onDismiss: () => setCloseTipSection(true),\n }\n : undefined\n }\n title={insightsCopy.general.transaction_history_title}\n transactionListProps={{\n showLoader: isLoading,\n showInsights: true,\n transaction: filteredTransactions,\n }}\n />\n )}\n <Snackbar\n anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}\n autoHideDuration={3500}\n onClose={() => setAlert('')}\n open={Boolean(alert)}\n >\n <Alert closeText=\"\" onClose={() => setAlert('')} severity=\"success\" variant=\"filled\">\n {alert}\n </Alert>\n </Snackbar>\n </Box>\n )\n}\n\nexport default observer(TransactionDetails)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFA,IAAM,KAAA,CAAyD,EAC7D,eAAA,IAAgB,IAChB,oBAAA,IAAqB,IACrB,YAAA,IAAa,IACb,aAAA,GACA,wBAAA,IAAyB,IACzB,kBAAA,EAAA,MACI;AACJ,QAAM,EAAE,SAAA,EAAA,IAAY,GAAS,GACvB,EAAE,QAAA,EAAA,IAAW,GAAa,GAC1B,EAAE,cAAA,EAAA,IAAiB,GAAiB,GACpC,EAAE,cAAA,EAAA,IAAiB,GAAa,GAChC,EAAE,UAAU,GAAM,QAAQ,GAAY,eAAe,EAAA,IAAiB,GAAmB,GAEzF,EAAE,oBAAA,EAAA,IAAuB,GAAiB,GAC1C,EACJ,OAAA,GACA,iBAAA,GACA,sBAAA,GACA,iBAAA,GACA,kCAAA,IACA,UAAA,EAAA,IACE,GAAoB,GAElB,CAAC,IAAgC,CAAA,IAAqC,EAAM,SAAS,EAAK,GAE1F,CAAC,GAAW,CAAA,IAAgB,EAAM,SAAS,EAAK,GAChD,CAAC,IAAiB,EAAA,IAAsB,EAAM,SAAS,EAAK,GAC5D,KAAQ,GAAS,GAEjB,KAAiB,GAAa,UAAU,EAAY,OAAO,SAAS,GAEpE,IAAW,GAAa,qBAAqB,GAAgB,QAE7D,IAAkB,GAAsB,CAAW,KAAK,EAAQ,EAAY,iBAE5E,IAAO,EAAM,QAAA,MACV,EAAgB,KAAA,CAAM,MAAS,EAAK,gCAAgC,EAAY,IAAI,GAC1F,CAAC,GAAiB,CAAW,CAAC,GAM3B,IAAgB,IAAyB,GAAqB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