@mx-cartographer/experiences 9.7.123 → 9.7.124

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 (21) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/core/types/localization/InsightsFeedCopy.d.ts +7 -0
  3. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.d.ts +2 -1
  4. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +66 -62
  5. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
  6. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +86 -85
  7. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
  8. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +5 -3
  9. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +137 -107
  10. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
  11. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.d.ts +4 -2
  12. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.es.js +17 -13
  13. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.es.js.map +1 -1
  14. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js +7 -7
  15. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js.map +1 -1
  16. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.d.ts +6 -3
  17. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js +31 -31
  18. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
  19. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js +1 -1
  20. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js.map +1 -1
  21. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [9.7.124] - 11-07-2026
2
+
3
+ - **ADDED** - Monthly Debt to Income Comparison on Insights 2.0: the `debt_to_income` double-bar palette (Debt chart5, Income chart1; replaces the unused legacy `DebtToIncome` key) shared by the card and its drawer, and the Debt vs. Income drawer (`debt_to_income`, titled by the existing `monthly_debt_to_income_drawer_title`): 6 month tabs, the 30% tip above the Debt / Income tabs, and that month's transactions. The drawer reads its series and legend labels only from the `drilldown_data` of the CTA that opened it and shows no bars or rows without it; no tip until the copy service carries `monthly_debt_to_income_tip_message` / `_tip_limit` (WEC-2254)
4
+ - **ADDED** - Monthly Debt to Income Comparison V2 Storybook QA page (`InsightsV2/Insights/MonthlyDebtToIncomeComparisonV2`): full, mini, micro and the drill-down for Below 30% and Above 30% (WEC-2254)
5
+
1
6
  ## [9.7.123] - 11-06-2026
2
7
 
3
8
  - **CHANGED** - Back buttons now use the arrow_back_ios_new icon on every screen (WELL-154)
@@ -132,6 +132,13 @@ export interface TransactionHistoryBlock {
132
132
  * 5.7.29), the drawer shows no tip.
133
133
  */
134
134
  upcoming_bill_tip_message?: string;
135
+ /**
136
+ * The Debt vs. Income drawer's tip: `_1{tip}` the bold tip title and `_2{limit}` the bold limit
137
+ * (`monthly_debt_to_income_tip_limit`, "less than 30%"). Optional: without both, the drawer shows no
138
+ * tip.
139
+ */
140
+ monthly_debt_to_income_tip_message?: string;
141
+ monthly_debt_to_income_tip_limit?: string;
135
142
  }
136
143
  export interface TransactionListBlockCopy {
137
144
  deposit_history_drawer_title?: string;
@@ -25,8 +25,9 @@ interface TransactionDrillDownProps {
25
25
  transaction: Transaction;
26
26
  };
27
27
  hideListHeader?: boolean;
28
+ tipAboveSubTabs?: boolean;
28
29
  }
29
- export declare const TransactionDrillDown: (({ ariaLabel, heading, subHeadingText, icon, tabs, selectedIndex, top, onSelectionChange, transactionFilter, tipSection, onEachRowClick, baseTransactions, subTabs, projectedRow, hideListHeader, }: TransactionDrillDownProps) => import("react/jsx-runtime").JSX.Element) & {
30
+ export declare const TransactionDrillDown: (({ ariaLabel, heading, subHeadingText, icon, tabs, selectedIndex, top, onSelectionChange, transactionFilter, tipSection, onEachRowClick, baseTransactions, subTabs, projectedRow, hideListHeader, tipAboveSubTabs, }: TransactionDrillDownProps) => import("react/jsx-runtime").JSX.Element) & {
30
31
  displayName: string;
31
32
  };
32
33
  export default TransactionDrillDown;
@@ -1,133 +1,137 @@
1
- import { useGlobalCopyStore as G, useGlobalUiStore as N, useTransactionStore as U } from "../../../common/context/hooks.es.js";
2
- import { exportTransactionsToCSV as j } from "../../../core/utils/TransactionUtils.es.js";
3
- import z from "../../../common/components/Loader.es.js";
4
- import O from "../../../transactions/components/shared/transactionlist/TransactionRow.es.js";
5
- import V from "../../../common/components/SubheaderRow.es.js";
6
- import q from "../../../transactions/components/shared/TransactionList.es.js";
7
- import { TipSection as J } from "../../../insights/components/shared/ChartDrawerTemplate/TipSection.es.js";
8
- import { SubTabs as K, subTabPanelProps as M } from "../../components/SubTabs.es.js";
1
+ import { useGlobalCopyStore as j, useGlobalUiStore as z, useTransactionStore as O } from "../../../common/context/hooks.es.js";
2
+ import { exportTransactionsToCSV as V } from "../../../core/utils/TransactionUtils.es.js";
3
+ import q from "../../../common/components/Loader.es.js";
4
+ import J from "../../../transactions/components/shared/transactionlist/TransactionRow.es.js";
5
+ import K from "../../../common/components/SubheaderRow.es.js";
6
+ import M from "../../../transactions/components/shared/TransactionList.es.js";
7
+ import { TipSection as D } from "../../../insights/components/shared/ChartDrawerTemplate/TipSection.es.js";
8
+ import { SubTabs as Q, subTabPanelProps as X } from "../../components/SubTabs.es.js";
9
9
  import "react";
10
- import { observer as Q } from "mobx-react-lite";
11
- import f from "@mui/material/Stack";
12
- import { H3 as X, Text as h } from "@mxenabled/mxui";
13
- import Y from "@mui/material/Button";
14
- import { Icon as Z } from "@mxenabled/mx-icons";
10
+ import { observer as Y } from "mobx-react-lite";
11
+ import h from "@mui/material/Stack";
12
+ import { H3 as Z, Text as x } from "@mxenabled/mxui";
13
+ import F from "@mui/material/Button";
14
+ import { Icon as H } from "@mxenabled/mx-icons";
15
15
  import { jsx as r, jsxs as o } from "react/jsx-runtime";
16
16
  import t from "@mui/material/Box";
17
- import F from "@mui/material/Tab";
18
- import H from "@mui/material/Tabs";
19
- var rr = {
17
+ import rr from "@mui/material/Tab";
18
+ import or from "@mui/material/Tabs";
19
+ var I = {
20
20
  color: "primary",
21
21
  name: "tips_and_updates",
22
22
  size: 20
23
- }, S = "transaction-drill-down-panel", C = (x) => `transaction-details-tab-${x}`, D = "transaction-drill-down-series", _r = Q(function({ ariaLabel: I, heading: e, subHeadingText: l, icon: w, tabs: u, selectedIndex: s, top: v, onSelectionChange: B, transactionFilter: T, tipSection: _, onEachRowClick: k, baseTransactions: P, subTabs: g, projectedRow: c, hideListHeader: d = !1 }) {
24
- const { transactions: m } = G(), { isCopyLoaded: W } = N(), { sortedTransactionsWithSplits: L, tags: $, detailedTransactions: A } = U();
25
- if (!W) return /* @__PURE__ */ r(z, {});
26
- const p = !!u?.length, a = g?.tabs.length ? g : void 0, R = I ?? m.transactions_title, E = (n, i) => {
27
- B?.(i);
28
- }, y = T ? (P ?? A).filter(T(s)) : void 0, b = y ?? L;
23
+ }, S = "transaction-drill-down-panel", w = (u) => `transaction-details-tab-${u}`, B = "transaction-drill-down-series", gr = Y(function({ ariaLabel: k, heading: l, subHeadingText: s, icon: P, tabs: v, selectedIndex: c, top: T, onSelectionChange: W, transactionFilter: _, tipSection: a, onEachRowClick: L, baseTransactions: $, subTabs: g, projectedRow: d, hideListHeader: m = !1, tipAboveSubTabs: y = !1 }) {
24
+ const { transactions: p } = j(), { isCopyLoaded: R } = z(), { sortedTransactionsWithSplits: A, tags: E, detailedTransactions: G } = O();
25
+ if (!R) return /* @__PURE__ */ r(q, {});
26
+ const f = !!v?.length, n = g?.tabs.length ? g : void 0, N = k ?? p.transactions_title, U = (i, e) => {
27
+ W?.(e);
28
+ }, C = _ ? ($ ?? G).filter(_(c)) : void 0, b = C ?? A;
29
29
  return /* @__PURE__ */ o(t, {
30
30
  sx: {
31
31
  bgcolor: "background.paper",
32
32
  width: "100%"
33
33
  },
34
- children: [p && /* @__PURE__ */ r(H, {
35
- "aria-label": R,
36
- onChange: E,
34
+ children: [f && /* @__PURE__ */ r(or, {
35
+ "aria-label": N,
36
+ onChange: U,
37
37
  sx: { mb: 0 },
38
- value: s,
38
+ value: c,
39
39
  variant: "fullWidth",
40
- children: u.map((n, i) => /* @__PURE__ */ r(F, {
40
+ children: v.map((i, e) => /* @__PURE__ */ r(rr, {
41
41
  "aria-controls": S,
42
- "aria-label": n.ariaLabel,
43
- id: C(i),
44
- label: n.label,
42
+ "aria-label": i.ariaLabel,
43
+ id: w(e),
44
+ label: i.label,
45
45
  sx: {
46
46
  minWidth: "auto",
47
47
  px: 0
48
48
  }
49
- }, `${n.label}-${i}`))
49
+ }, `${i.label}-${e}`))
50
50
  }), /* @__PURE__ */ o(t, {
51
- "aria-labelledby": p ? C(s) : void 0,
51
+ "aria-labelledby": f ? w(c) : void 0,
52
52
  id: S,
53
- role: p ? "tabpanel" : void 0,
53
+ role: f ? "tabpanel" : void 0,
54
54
  children: [
55
- (e || l) && /* @__PURE__ */ o(f, {
55
+ (l || s) && /* @__PURE__ */ o(h, {
56
56
  sx: {
57
57
  gap: 4,
58
58
  pt: 16,
59
59
  px: 24
60
60
  },
61
- children: [e && /* @__PURE__ */ r(X, { children: e }), l && /* @__PURE__ */ o(f, {
61
+ children: [l && /* @__PURE__ */ r(Z, { children: l }), s && /* @__PURE__ */ o(h, {
62
62
  sx: {
63
63
  alignItems: "center",
64
64
  flexDirection: "row",
65
65
  gap: 8
66
66
  },
67
- children: [w, /* @__PURE__ */ r(h, {
67
+ children: [P, /* @__PURE__ */ r(x, {
68
68
  color: "text.secondary",
69
69
  sx: { letterSpacing: "0.52px" },
70
70
  textTransform: "uppercase",
71
71
  variant: "body2",
72
- children: l
72
+ children: s
73
73
  })]
74
74
  })]
75
75
  }),
76
76
  /* @__PURE__ */ r(t, {
77
77
  sx: {
78
- pb: v ? 16 : 0,
78
+ pb: T ? 16 : 0,
79
79
  pt: 16
80
80
  },
81
- children: v
81
+ children: T
82
82
  }),
83
- a && /* @__PURE__ */ r(K, {
84
- ...a,
85
- id: D
83
+ y && a && /* @__PURE__ */ r(D, {
84
+ icon: I,
85
+ ...a
86
+ }),
87
+ n && /* @__PURE__ */ r(Q, {
88
+ ...n,
89
+ id: B
86
90
  }),
87
91
  /* @__PURE__ */ o(t, {
88
- ...a && M(D, a.selectedIndex),
92
+ ...n && X(B, n.selectedIndex),
89
93
  children: [
90
- _ && /* @__PURE__ */ r(J, {
91
- icon: rr,
92
- ..._
94
+ !y && a && /* @__PURE__ */ r(D, {
95
+ icon: I,
96
+ ...a
93
97
  }),
94
- (!d || b.length > 0) && /* @__PURE__ */ o(f, {
98
+ (!m || b.length > 0) && /* @__PURE__ */ o(h, {
95
99
  sx: {
96
100
  alignItems: "center",
97
101
  borderBottomColor: "divider",
98
102
  borderBottomStyle: "solid",
99
103
  borderBottomWidth: 1,
100
104
  flexDirection: "row",
101
- justifyContent: d ? "flex-end" : "space-between",
105
+ justifyContent: m ? "flex-end" : "space-between",
102
106
  pb: 4,
103
107
  pt: 16,
104
108
  px: 24
105
109
  },
106
- children: [!d && /* @__PURE__ */ r(h, {
110
+ children: [!m && /* @__PURE__ */ r(x, {
107
111
  bold: !0,
108
112
  variant: "body1",
109
- children: m.transactions_title
110
- }), b.length > 0 && /* @__PURE__ */ r(Y, {
113
+ children: p.transactions_title
114
+ }), b.length > 0 && /* @__PURE__ */ r(F, {
111
115
  onClick: () => {
112
- j(b, $);
116
+ V(b, E);
113
117
  },
114
- startIcon: /* @__PURE__ */ r(Z, { name: "ios_share" }),
118
+ startIcon: /* @__PURE__ */ r(H, { name: "ios_share" }),
115
119
  sx: { height: 28 },
116
- children: /* @__PURE__ */ r(h, {
120
+ children: /* @__PURE__ */ r(x, {
117
121
  bold: !0,
118
122
  variant: "body2",
119
- children: m.export_csv_btn
123
+ children: p.export_csv_btn
120
124
  })
121
125
  })]
122
126
  }),
123
- c ? /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ r(V, { children: c.heading }), /* @__PURE__ */ r(O, {
127
+ d ? /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ r(K, { children: d.heading }), /* @__PURE__ */ r(J, {
124
128
  component: "div",
125
- transaction: c.transaction
129
+ transaction: d.transaction
126
130
  })] }) : /* @__PURE__ */ r(t, {
127
131
  sx: { bgcolor: "background.default" },
128
- children: /* @__PURE__ */ r(q, {
129
- transaction: y,
130
- onClick: k
132
+ children: /* @__PURE__ */ r(M, {
133
+ transaction: C,
134
+ onClick: L
131
135
  })
132
136
  })
133
137
  ]
@@ -137,8 +141,8 @@ var rr = {
137
141
  });
138
142
  });
139
143
  export {
140
- _r as TransactionDrillDown,
141
- _r as default
144
+ gr as TransactionDrillDown,
145
+ gr as default
142
146
  };
143
147
 
144
148
  //# sourceMappingURL=TransactionDrillDown.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TransactionDrillDown.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\nimport Tab from '@mui/material/Tab'\nimport Tabs from '@mui/material/Tabs'\nimport { observer } from 'mobx-react-lite'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { H3, Text } from '@mxenabled/mxui'\n\nimport {\n TipSection,\n type TipSectionIcon,\n type TipSectionProps,\n} from '../../../insights/components/shared/ChartDrawerTemplate/TipSection'\nimport { Loader, useGlobalCopyStore, useGlobalUiStore, useTransactionStore } from '../../../common'\nimport type { Transaction } from '../../../core'\nimport { exportTransactionsToCSV } from '../../../core/utils/TransactionUtils'\nimport SubheaderRow from '../../../common/components/SubheaderRow'\nimport { TransactionList, TransactionRow } from '../../../transactions'\nimport { SubTabs, subTabPanelProps, type SubTabsProps } from '../../components/SubTabs'\n\ninterface TabItem {\n label: string\n ariaLabel?: string\n}\n\n// Every Figma drawer tip draws this icon; the shared TipSection keeps its lightbulb for V1 insights.\nconst DRAWER_TIP_ICON: TipSectionIcon = { color: 'primary', name: 'tips_and_updates', size: 20 }\n\nconst PANEL_ID = 'transaction-drill-down-panel'\nconst tabId = (index: number) => `transaction-details-tab-${index}`\nconst SUB_TABS_ID = 'transaction-drill-down-series'\n\ninterface TransactionDrillDownProps {\n ariaLabel?: string\n heading?: string\n subHeadingText?: string\n icon?: React.ReactNode\n tabs?: TabItem[]\n selectedIndex: number\n top: React.ReactNode\n tipSection?: TipSectionProps | false\n onSelectionChange?: (selectedIndex: number) => void\n onEachRowClick?: (guid: string) => void\n transactionFilter?: (selectedIndex: number) => (transaction: Transaction) => boolean\n baseTransactions?: Transaction[]\n // A second row of tabs between the chart and the list (the double-bar drawer's main / comparison\n // series, e.g. Spend / Income). Omitted for every single-series drawer.\n subTabs?: Omit<SubTabsProps, 'id'>\n // Shown instead of the list: one inert row under its own heading (Upcoming Bill's projected bill,\n // headed \"Projected amount\", as legacy pulse shows it). Not exported to CSV.\n projectedRow?: { heading: string; transaction: Transaction }\n // Drops the Transactions heading above the list; the CSV export, when there is one, stays.\n hideListHeader?: boolean\n}\n\nexport const TransactionDrillDown = observer(function TransactionDrillDown({\n ariaLabel,\n heading,\n subHeadingText,\n icon,\n tabs,\n selectedIndex,\n top,\n onSelectionChange,\n transactionFilter,\n tipSection,\n onEachRowClick,\n baseTransactions,\n subTabs,\n projectedRow,\n hideListHeader = false,\n}: TransactionDrillDownProps) {\n const { transactions: transactionsCopy } = useGlobalCopyStore()\n const { isCopyLoaded } = useGlobalUiStore()\n const { sortedTransactionsWithSplits, tags, detailedTransactions } = useTransactionStore()\n\n if (!isCopyLoaded) return <Loader />\n\n const hasTabs = !!tabs?.length\n // Only a non-empty row gets the tabs and their panel.\n const seriesTabs = subTabs?.tabs.length ? subTabs : undefined\n const tablistLabel = ariaLabel ?? transactionsCopy.transactions_title\n\n const handlePrimaryChange = (_event: React.SyntheticEvent, newValue: number) => {\n onSelectionChange?.(newValue)\n }\n\n const filteredTransactions = transactionFilter\n ? (baseTransactions ?? detailedTransactions).filter(transactionFilter(selectedIndex))\n : undefined\n\n const exportTransactions = filteredTransactions ?? sortedTransactionsWithSplits\n\n return (\n <Box sx={{ bgcolor: 'background.paper', width: '100%' }}>\n {hasTabs && (\n <Tabs\n aria-label={tablistLabel}\n onChange={handlePrimaryChange}\n // The title sits 16px below the tab bar, as in every Figma chart drawer; the theme's 8px\n // gap under Tabs would make it 24.\n sx={{ mb: 0 }}\n value={selectedIndex}\n variant=\"fullWidth\"\n >\n {tabs!.map((tab, index) => (\n <Tab\n aria-controls={PANEL_ID}\n aria-label={tab.ariaLabel}\n id={tabId(index)}\n key={`${tab.label}-${index}`}\n label={tab.label}\n sx={{ minWidth: 'auto', px: 0 }}\n />\n ))}\n </Tabs>\n )}\n\n <Box\n aria-labelledby={hasTabs ? tabId(selectedIndex) : undefined}\n id={PANEL_ID}\n role={hasTabs ? 'tabpanel' : undefined}\n >\n {(heading || subHeadingText) && (\n <Stack sx={{ gap: 4, pt: 16, px: 24 }}>\n {heading && <H3>{heading}</H3>}\n {subHeadingText && (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 8 }}>\n {icon}\n <Text\n color=\"text.secondary\"\n sx={{ letterSpacing: '0.52px' }}\n textTransform=\"uppercase\"\n variant=\"body2\"\n >\n {subHeadingText}\n </Text>\n </Stack>\n )}\n </Stack>\n )}\n\n {/* Figma's chart drawer pads the chart 16px above and below. */}\n <Box sx={{ pb: top ? 16 : 0, pt: 16 }}>{top}</Box>\n\n {seriesTabs && <SubTabs {...seriesTabs} id={SUB_TABS_ID} />}\n\n {/* The content the sub-tabs control, as the month tabs' panel above. */}\n <Box {...(seriesTabs && subTabPanelProps(SUB_TABS_ID, seriesTabs.selectedIndex))}>\n {/* TODO: need to use a nseperate compnent from insight-v2, for now using insights-shared component which will be shifted under insights-v2 in future */}\n {tipSection && <TipSection icon={DRAWER_TIP_ICON} {...tipSection} />}\n\n {(!hideListHeader || exportTransactions.length > 0) && (\n <Stack\n sx={{\n alignItems: 'center',\n borderBottomColor: 'divider',\n borderBottomStyle: 'solid',\n borderBottomWidth: 1,\n flexDirection: 'row',\n // Without the heading, the export keeps its place on the right.\n justifyContent: hideListHeader ? 'flex-end' : 'space-between',\n pb: 4,\n pt: 16,\n px: 24,\n }}\n >\n {!hideListHeader && (\n <Text bold={true} variant=\"body1\">\n {transactionsCopy.transactions_title}\n </Text>\n )}\n {exportTransactions.length > 0 && (\n <Button\n onClick={() => {\n exportTransactionsToCSV(exportTransactions, tags)\n }}\n startIcon={<Icon name=\"ios_share\" />}\n sx={{ height: 28 }}\n >\n <Text bold={true} variant=\"body2\">\n {transactionsCopy.export_csv_btn}\n </Text>\n </Button>\n )}\n </Stack>\n )}\n\n {projectedRow ? (\n <Box>\n <SubheaderRow>{projectedRow.heading}</SubheaderRow>\n <TransactionRow component=\"div\" transaction={projectedRow.transaction} />\n </Box>\n ) : (\n // The list's scroll box is taller than its rows; Figma fills the space below the last\n // row with background.default, and each row paints its own paper.\n <Box sx={{ bgcolor: 'background.default' }}>\n <TransactionList transaction={filteredTransactions} onClick={onEachRowClick} />\n </Box>\n )}\n </Box>\n </Box>\n </Box>\n )\n})\n\nexport default TransactionDrillDown\n"],"mappings":";;;;;;;;;;;;;;;;;;AA8BA,IAAM,KAAkC;AAAA,EAAE,OAAO;AAAA,EAAW,MAAM;AAAA,EAAoB,MAAM;AAAG,GAEzF,IAAW,gCACX,IAAA,CAAS,MAAkB,2BAA2B,CAAA,IACtD,IAAc,iCAyBP,KAAuB,EAAS,SAA8B,EACzE,WAAA,GACA,SA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nB,eAAe;AAAA,gBAEf,gBAAgB,IAAiB,aAAa;AAAA,gBAC9C,IAAI;AAAA,gBACJ,IAAI;AAAA,gBACJ,IAAI;AAAA,cACN;AAAA,cAZF,UAAA,CAcG,CAAC,KACA,gBAAA,EAAC,GAAD;AAAA,gBAAM,MAAM;AAAA,gBAAM,SAAQ;AAAA,gBACvB,UAAA,EAAiB;AAAA,cACd,CAAA,GAEP,EAAmB,SAAS,KAC3B,gBAAA,EAAC,GAAD;AAAA,gBACE,SAAA,MAAe;AACb,kBAAA,EAAwB,GAAoB,CAAI;AAAA,gBAClD;AAAA,gBACA,WAAW,gBAAA,EAAC,GAAD,EAAM,MAAK,YAAa,CAAA;AAAA,gBACnC,IAAI,EAAE,QAAQ,GAAG;AAAA,gBAEjB,UAAA,gBAAA,EAAC,GAAD;AAAA,kBAAM,MAAM;AAAA,kBAAM,SAAQ;AAAA,kBACvB,UAAA,EAAiB;AAAA,gBACd,CAAA;AAAA,cACA,CAAA,CAEL;AAAA;YAGR,IACC,gBAAA,EAAC,GAAD,EAAA,UAAA,CACE,gBAAA,EAAC,GAAD,EAAA,UAAe,EAAa,QAAsB,CAAA,GAClD,gBAAA,EAAC,GAAD;AAAA,cAAgB,WAAU;AAAA,cAAM,aAAa,EAAa;AAAA,YAAc,CAAA,CACrE,EAAA,CAAA,IAIL,gBAAA,EAAC,GAAD;AAAA,cAAK,IAAI,EAAE,SAAS,qBAAqB;AAAA,cACvC,UAAA,gBAAA,EAAC,GAAD;AAAA,gBAAiB,aAAa;AAAA,gBAAsB,SAAS;AAAA,cAAiB,CAAA;AAAA,YAC3E,CAAA;AAAA,UAEJ;AAAA;MACF;AAAA,IACF,CAAA,CAAA;AAAA;AAET,CAAC"}
1
+ {"version":3,"file":"TransactionDrillDown.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\nimport Tab from '@mui/material/Tab'\nimport Tabs from '@mui/material/Tabs'\nimport { observer } from 'mobx-react-lite'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { H3, Text } from '@mxenabled/mxui'\n\nimport {\n TipSection,\n type TipSectionIcon,\n type TipSectionProps,\n} from '../../../insights/components/shared/ChartDrawerTemplate/TipSection'\nimport { Loader, useGlobalCopyStore, useGlobalUiStore, useTransactionStore } from '../../../common'\nimport type { Transaction } from '../../../core'\nimport { exportTransactionsToCSV } from '../../../core/utils/TransactionUtils'\nimport SubheaderRow from '../../../common/components/SubheaderRow'\nimport { TransactionList, TransactionRow } from '../../../transactions'\nimport { SubTabs, subTabPanelProps, type SubTabsProps } from '../../components/SubTabs'\n\ninterface TabItem {\n label: string\n ariaLabel?: string\n}\n\n// Every Figma drawer tip draws this icon; the shared TipSection keeps its lightbulb for V1 insights.\nconst DRAWER_TIP_ICON: TipSectionIcon = { color: 'primary', name: 'tips_and_updates', size: 20 }\n\nconst PANEL_ID = 'transaction-drill-down-panel'\nconst tabId = (index: number) => `transaction-details-tab-${index}`\nconst SUB_TABS_ID = 'transaction-drill-down-series'\n\ninterface TransactionDrillDownProps {\n ariaLabel?: string\n heading?: string\n subHeadingText?: string\n icon?: React.ReactNode\n tabs?: TabItem[]\n selectedIndex: number\n top: React.ReactNode\n tipSection?: TipSectionProps | false\n onSelectionChange?: (selectedIndex: number) => void\n onEachRowClick?: (guid: string) => void\n transactionFilter?: (selectedIndex: number) => (transaction: Transaction) => boolean\n baseTransactions?: Transaction[]\n // A second row of tabs between the chart and the list (the double-bar drawer's main / comparison\n // series, e.g. Spend / Income). Omitted for every single-series drawer.\n subTabs?: Omit<SubTabsProps, 'id'>\n // Shown instead of the list: one inert row under its own heading (Upcoming Bill's projected bill,\n // headed \"Projected amount\", as legacy pulse shows it). Not exported to CSV.\n projectedRow?: { heading: string; transaction: Transaction }\n // Drops the Transactions heading above the list; the CSV export, when there is one, stays.\n hideListHeader?: boolean\n // Draws the tip between the chart and the sub-tabs (Debt vs. Income) instead of under the sub-tabs.\n tipAboveSubTabs?: boolean\n}\n\nexport const TransactionDrillDown = observer(function TransactionDrillDown({\n ariaLabel,\n heading,\n subHeadingText,\n icon,\n tabs,\n selectedIndex,\n top,\n onSelectionChange,\n transactionFilter,\n tipSection,\n onEachRowClick,\n baseTransactions,\n subTabs,\n projectedRow,\n hideListHeader = false,\n tipAboveSubTabs = false,\n}: TransactionDrillDownProps) {\n const { transactions: transactionsCopy } = useGlobalCopyStore()\n const { isCopyLoaded } = useGlobalUiStore()\n const { sortedTransactionsWithSplits, tags, detailedTransactions } = useTransactionStore()\n\n if (!isCopyLoaded) return <Loader />\n\n const hasTabs = !!tabs?.length\n // Only a non-empty row gets the tabs and their panel.\n const seriesTabs = subTabs?.tabs.length ? subTabs : undefined\n const tablistLabel = ariaLabel ?? transactionsCopy.transactions_title\n\n const handlePrimaryChange = (_event: React.SyntheticEvent, newValue: number) => {\n onSelectionChange?.(newValue)\n }\n\n const filteredTransactions = transactionFilter\n ? (baseTransactions ?? detailedTransactions).filter(transactionFilter(selectedIndex))\n : undefined\n\n const exportTransactions = filteredTransactions ?? sortedTransactionsWithSplits\n\n return (\n <Box sx={{ bgcolor: 'background.paper', width: '100%' }}>\n {hasTabs && (\n <Tabs\n aria-label={tablistLabel}\n onChange={handlePrimaryChange}\n // The title sits 16px below the tab bar, as in every Figma chart drawer; the theme's 8px\n // gap under Tabs would make it 24.\n sx={{ mb: 0 }}\n value={selectedIndex}\n variant=\"fullWidth\"\n >\n {tabs!.map((tab, index) => (\n <Tab\n aria-controls={PANEL_ID}\n aria-label={tab.ariaLabel}\n id={tabId(index)}\n key={`${tab.label}-${index}`}\n label={tab.label}\n sx={{ minWidth: 'auto', px: 0 }}\n />\n ))}\n </Tabs>\n )}\n\n <Box\n aria-labelledby={hasTabs ? tabId(selectedIndex) : undefined}\n id={PANEL_ID}\n role={hasTabs ? 'tabpanel' : undefined}\n >\n {(heading || subHeadingText) && (\n <Stack sx={{ gap: 4, pt: 16, px: 24 }}>\n {heading && <H3>{heading}</H3>}\n {subHeadingText && (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 8 }}>\n {icon}\n <Text\n color=\"text.secondary\"\n sx={{ letterSpacing: '0.52px' }}\n textTransform=\"uppercase\"\n variant=\"body2\"\n >\n {subHeadingText}\n </Text>\n </Stack>\n )}\n </Stack>\n )}\n\n {/* Figma's chart drawer pads the chart 16px above and below. */}\n <Box sx={{ pb: top ? 16 : 0, pt: 16 }}>{top}</Box>\n\n {tipAboveSubTabs && tipSection && <TipSection icon={DRAWER_TIP_ICON} {...tipSection} />}\n\n {seriesTabs && <SubTabs {...seriesTabs} id={SUB_TABS_ID} />}\n\n {/* The content the sub-tabs control, as the month tabs' panel above. */}\n <Box {...(seriesTabs && subTabPanelProps(SUB_TABS_ID, seriesTabs.selectedIndex))}>\n {/* TODO: need to use a nseperate compnent from insight-v2, for now using insights-shared component which will be shifted under insights-v2 in future */}\n {!tipAboveSubTabs && tipSection && <TipSection icon={DRAWER_TIP_ICON} {...tipSection} />}\n\n {(!hideListHeader || exportTransactions.length > 0) && (\n <Stack\n sx={{\n alignItems: 'center',\n borderBottomColor: 'divider',\n borderBottomStyle: 'solid',\n borderBottomWidth: 1,\n flexDirection: 'row',\n // Without the heading, the export keeps its place on the right.\n justifyContent: hideListHeader ? 'flex-end' : 'space-between',\n pb: 4,\n pt: 16,\n px: 24,\n }}\n >\n {!hideListHeader && (\n <Text bold={true} variant=\"body1\">\n {transactionsCopy.transactions_title}\n </Text>\n )}\n {exportTransactions.length > 0 && (\n <Button\n onClick={() => {\n exportTransactionsToCSV(exportTransactions, tags)\n }}\n startIcon={<Icon name=\"ios_share\" />}\n sx={{ height: 28 }}\n >\n <Text bold={true} variant=\"body2\">\n {transactionsCopy.export_csv_btn}\n </Text>\n </Button>\n )}\n </Stack>\n )}\n\n {projectedRow ? (\n <Box>\n <SubheaderRow>{projectedRow.heading}</SubheaderRow>\n <TransactionRow component=\"div\" transaction={projectedRow.transaction} />\n </Box>\n ) : (\n // The list's scroll box is taller than its rows; Figma fills the space below the last\n // row with background.default, and each row paints its own paper.\n <Box sx={{ bgcolor: 'background.default' }}>\n <TransactionList transaction={filteredTransactions} onClick={onEachRowClick} />\n </Box>\n )}\n </Box>\n </Box>\n </Box>\n )\n})\n\nexport default TransactionDrillDown\n"],"mappings":";;;;;;;;;;;;;;;;;;AA8BA,IAAM,IAAkC;AAAA,EAAE,OAAO;AAAA,EAAW,MAAM;AAAA,EAAoB,MAAM;AAAG,GAEzF,IAAW,gCACX,IAAA,CAAS,MAAkB,2BAA2B,CAAA,IACtD,IAAc,iCA2BP,KAAuB,EAAS,SAA8B,EACzE,WAAA,GACA,SAAA,GACA,gBAAA,GACA,MAAA,GACA,MAAA,GACA,eAAA,GACA,KAAA,GACA,mBAAA,GACA,mBAAA,GACA,YAAA,GACA,gBAAA,GACA,kBAAA,GACA,SAAA,GACA,cAAA,GACA,gBAAA,IAAiB,IACjB,iBAAA,IAAkB,GAAA,GACU;AAC5B,QAAM,EAAE,cAAc,EAAA,IAAqB,EAAmB,GACxD,EAAE,cAAA,EAAA,IAAiB,EAAiB,GACpC,EAAE,8BAAA,GAA8B,MAAA,GAAM,sBAAA,EAAA,IAAyB,EAAoB;AAEzF,MAAI,CAAC,EAAc,QAAO,gBAAA,EAAC,GAAD,CAAS,CAAA;AAEnC,QAAM,IAAU,CAAC,CAAC,GAAM,QAElB,IAAa,GAAS,KAAK,SAAS,IAAU,QAC9C,IAAe,KAAa,EAAiB,oBAE7C,IAAA,CAAuB,GAA8B,MAAqB;AAC9E,IAAA,IAAoB,CAAQ;AAAA,EAC9B,GAEM,IAAuB,KACxB,KAAoB,GAAsB,OAAO,EAAkB,CAAa,CAAC,IAClF,QAEE,IAAqB,KAAwB;AAEnD,SACE,gBAAA,EAAC,GAAD;AAAA,IAAK,IAAI;AAAA,MAAE,SAAS;AAAA,MAAoB,OAAO;AA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GR,IACC,gBAAA,EAAC,GAAD,EAAA,UAAA,CACE,gBAAA,EAAC,GAAD,EAAA,UAAe,EAAa,QAAsB,CAAA,GAClD,gBAAA,EAAC,GAAD;AAAA,cAAgB,WAAU;AAAA,cAAM,aAAa,EAAa;AAAA,YAAc,CAAA,CACrE,EAAA,CAAA,IAIL,gBAAA,EAAC,GAAD;AAAA,cAAK,IAAI,EAAE,SAAS,qBAAqB;AAAA,cACvC,UAAA,gBAAA,EAAC,GAAD;AAAA,gBAAiB,aAAa;AAAA,gBAAsB,SAAS;AAAA,cAAiB,CAAA;AAAA,YAC3E,CAAA;AAAA,UAEJ;AAAA;MACF;AAAA,IACF,CAAA,CAAA;AAAA;AAET,CAAC"}
@@ -1,40 +1,40 @@
1
- import { useGlobalCopyStore as yt, useGlobalUiStore as At, useInsightsV2Store as Dt } from "../../../common/context/hooks.es.js";
1
+ import { useGlobalCopyStore as Dt, useGlobalUiStore as St, useInsightsV2Store as vt } from "../../../common/context/hooks.es.js";
2
2
  import { formatCurrency as Bt } from "../../../core/utils/NumberFormatting.es.js";
3
- import St from "../../../common/components/drawer/Drawer.es.js";
4
- import vt from "../../../common/components/Loader.es.js";
5
- import { BAR_ARIA_LABEL as Lt } from "../../blocks/ChartBlocks/BarchartBlock/utils.es.js";
6
- import { BarChartV2 as It } from "../../components/chartblocks/BarchartV2.es.js";
7
- import { EmptyBarChart as xt } from "../../components/chartblocks/EmptyBarChart.es.js";
8
- import { ANALYTICS_EVENTS_CONFIG as P } from "../../analytics/analyticsEventsConfig.es.js";
9
- import { useAnalyticsEvent as Et } from "../../analytics/useAnalyticsEvent.es.js";
10
- import { DoubleBarChart as Rt } from "../../components/chartblocks/DoubleBarChart.es.js";
11
- import { toLegendItems as Ft } from "../../blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils.es.js";
12
- import { getDefaultSelection as Ot, getDrillDownConfig as jt, getFlattenedDataSeries as Gt, resolveDrillDownSubHeader as Ht, splitProjectedTransaction as wt, toStoreFilter as kt } from "./utils.es.js";
13
- import { getDynamicCtaBasedOnTriggers as Nt } from "../util.es.js";
14
- import { TransactionDrillDown as Kt } from "./TransactionDrillDown.es.js";
15
- import { useTransactionHistory as Mt } from "./useTransactionHistory.es.js";
16
- import { TransactionDetailsBlock as Pt } from "../TransactionDetailsBlock/TransactionDetailsBlock.es.js";
17
- import { useLayoutEffect as Vt, useState as m } from "react";
18
- import { observer as zt } from "mobx-react-lite";
19
- import { Fragment as Ut, jsx as r, jsxs as Wt } from "react/jsx-runtime";
20
- import { useTheme as Yt } from "@mui/material/styles";
21
- var fe = zt(({ beat: s }) => {
22
- const D = Yt(), { actionDrawer: B, setActionContext: S } = Dt(), { insights_payload: c } = s, V = Nt(B, c?.primary_cta, c?.secondary_cta, c?.in_description_cta)?.variant, { top: e, filterMode: u, header: z, colors: U, filterStrategy: W, tipSection: v, subTabAriaLabels: Y, slotData: $, beatTransactions: q, hideListHeader: J, averageFormat: Q, subTabs: X } = jt(V ?? ""), { instanceSlotData: o, beatTransactions: g, spendCategoryGuids: L, allAccountGuids: I, categoryName: Z, displayedDateRange: h, transactionStore: tt } = Mt(s, {
23
- slotData: $,
24
- beatTransactions: q
25
- }), { common: et, insights_feed: n } = yt(), { isCopyLoaded: ot } = At(), [at, x] = m(!1), [nt, rt] = m(!1), E = Et(), { dataSeries: p, chartData: b, comparisonBars: i } = Gt({
3
+ import Lt from "../../../common/components/drawer/Drawer.es.js";
4
+ import It from "../../../common/components/Loader.es.js";
5
+ import { BAR_ARIA_LABEL as xt } from "../../blocks/ChartBlocks/BarchartBlock/utils.es.js";
6
+ import { BarChartV2 as Et } from "../../components/chartblocks/BarchartV2.es.js";
7
+ import { EmptyBarChart as Rt } from "../../components/chartblocks/EmptyBarChart.es.js";
8
+ import { ANALYTICS_EVENTS_CONFIG as V } from "../../analytics/analyticsEventsConfig.es.js";
9
+ import { useAnalyticsEvent as Ft } from "../../analytics/useAnalyticsEvent.es.js";
10
+ import { DoubleBarChart as Ot } from "../../components/chartblocks/DoubleBarChart.es.js";
11
+ import { toLegendItems as jt } from "../../blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils.es.js";
12
+ import { getDefaultSelection as Gt, getDrillDownConfig as Ht, getFlattenedDataSeries as wt, resolveDrillDownSubHeader as kt, splitProjectedTransaction as Nt, toStoreFilter as Kt } from "./utils.es.js";
13
+ import { getDynamicCtaBasedOnTriggers as Mt } from "../util.es.js";
14
+ import { TransactionDrillDown as Pt } from "./TransactionDrillDown.es.js";
15
+ import { useTransactionHistory as Vt } from "./useTransactionHistory.es.js";
16
+ import { TransactionDetailsBlock as zt } from "../TransactionDetailsBlock/TransactionDetailsBlock.es.js";
17
+ import { useLayoutEffect as Ut, useState as m } from "react";
18
+ import { observer as Wt } from "mobx-react-lite";
19
+ import { Fragment as Yt, jsx as r, jsxs as $t } from "react/jsx-runtime";
20
+ import { useTheme as qt } from "@mui/material/styles";
21
+ var Te = Wt(({ beat: s }) => {
22
+ const D = qt(), { actionDrawer: S, setActionContext: v } = vt(), { insights_payload: c } = s, B = Mt(S, c?.primary_cta, c?.secondary_cta, c?.in_description_cta), z = B?.variant, { top: e, filterMode: u, header: U, colors: W, filterStrategy: Y, tipSection: L, subTabAriaLabels: $, slotData: q, beatTransactions: J, hideListHeader: Q, tipAboveSubTabs: X, averageFormat: Z, subTabs: tt } = Ht(z ?? ""), { instanceSlotData: o, beatTransactions: g, spendCategoryGuids: I, allAccountGuids: x, categoryName: et, displayedDateRange: h, transactionStore: ot } = Vt(s, {
23
+ slotData: q,
24
+ beatTransactions: J
25
+ }, B?.drilldown_data), { common: at, insights_feed: n } = Dt(), { isCopyLoaded: nt } = St(), [rt, E] = m(!1), [st, it] = m(!1), R = Ft(), { dataSeries: p, chartData: b, comparisonBars: i } = wt({
26
26
  data: o?.data_series,
27
- ariaLabel: e === "doubleBar" ? n?.general?.in_month_you_had_a_category_of_amount ?? "_1{month}, _2{category}: _3{amount}" : Lt,
27
+ ariaLabel: e === "doubleBar" ? n?.general?.in_month_you_had_a_category_of_amount ?? "_1{month}, _2{category}: _3{amount}" : xt,
28
28
  top: e,
29
29
  beatTransactions: g
30
- }), d = e === "doubleBar", st = e === "tabsOnly", l = d ? i : b, { chartBarIndex: R, subTabIndex: it } = Ot({
30
+ }), d = e === "doubleBar", lt = e === "tabsOnly", l = d ? i : b, { chartBarIndex: F, subTabIndex: ct } = Gt({
31
31
  chartTabCount: b.length,
32
32
  comparisonTabCount: i.length,
33
- actionDrawer: B,
33
+ actionDrawer: S,
34
34
  beatGuid: s.guid
35
- }), [a, T] = m(R), [_, F] = m(it), [lt, ct] = m(l.length);
36
- l.length !== lt && (ct(l.length), T(R));
37
- const C = (t) => W({
35
+ }), [a, T] = m(F), [_, O] = m(ct), [dt, mt] = m(l.length);
36
+ l.length !== dt && (mt(l.length), T(F));
37
+ const C = (t) => Y({
38
38
  beat: s,
39
39
  beatTransactions: g,
40
40
  dataSeries: p,
@@ -43,21 +43,21 @@ var fe = zt(({ beat: s }) => {
43
43
  subIndex: _,
44
44
  isLastTab: t === l.length - 1,
45
45
  instanceSlotData: o,
46
- spendCategoryGuids: L,
46
+ spendCategoryGuids: I,
47
47
  displayedDateRange: h
48
- }), dt = g.map((t) => t.guid).join(","), mt = L.join(","), ut = I.join(","), gt = e === "list" || e === "tabsOnly" || e === "monthTabs" || p.length > 0, O = () => {
48
+ }), ut = g.map((t) => t.guid).join(","), gt = I.join(","), pt = x.join(","), bt = e === "list" || e === "tabsOnly" || e === "monthTabs" || p.length > 0, j = () => {
49
49
  if (u !== "store") return;
50
- const t = gt ? C(a) : {
50
+ const t = bt ? C(a) : {
51
51
  accounts: [],
52
52
  custom: () => !1
53
53
  };
54
- tt.setFilter(kt(t, {
55
- allAccountGuids: I,
54
+ ot.setFilter(Kt(t, {
55
+ allAccountGuids: x,
56
56
  displayedDateRange: h
57
57
  }));
58
58
  };
59
- Vt(() => {
60
- O();
59
+ Ut(() => {
60
+ j();
61
61
  }, [
62
62
  s.guid,
63
63
  a,
@@ -66,50 +66,50 @@ var fe = zt(({ beat: s }) => {
66
66
  p.length,
67
67
  o,
68
68
  h,
69
- mt,
69
+ gt,
70
+ pt,
70
71
  ut,
71
- dt,
72
72
  e
73
73
  ]);
74
- const j = Ht(c), y = z?.({
74
+ const G = kt(c), y = U?.({
75
75
  title: c?.title,
76
- subHeader: j,
77
- categoryName: Z,
76
+ subHeader: G,
77
+ categoryName: et,
78
78
  selectedDate: b[a]?.date ?? void 0
79
- }), G = U(D, o?.category_guid);
80
- if (!ot) return /* @__PURE__ */ r(vt, {});
81
- const [H, w] = o?.legends ?? [], pt = u === "local" ? (t) => C(t).custom ?? (() => !0) : void 0, { transactions: bt, projectedTransaction: A } = wt(g), ft = u === "local" ? bt : void 0, k = n.general.projected_amount, ht = A && k && C(a).custom?.(A) ? {
82
- heading: k,
79
+ }), H = W(D, o?.category_guid);
80
+ if (!nt) return /* @__PURE__ */ r(It, {});
81
+ const [w, k] = o?.legends ?? [], ft = u === "local" ? (t) => C(t).custom ?? (() => !0) : void 0, { transactions: ht, projectedTransaction: A } = Nt(g), Tt = u === "local" ? ht : void 0, N = n.general.projected_amount, _t = A && N && C(a).custom?.(A) ? {
82
+ heading: N,
83
83
  transaction: A
84
- } : void 0, N = (t, f) => {
85
- E(P.DRAWER_CHART_BAR_CLICKED), T(t), f !== void 0 && F(f);
86
- }, Tt = (t) => {
87
- E(P.TAB_SELECTED), T(t);
88
- }, K = d ? Ft([{
89
- ...H,
84
+ } : void 0, K = (t, f) => {
85
+ R(V.DRAWER_CHART_BAR_CLICKED), T(t), f !== void 0 && O(f);
86
+ }, Ct = (t) => {
87
+ R(V.TAB_SELECTED), T(t);
88
+ }, M = d ? jt([{
89
+ ...w,
90
90
  value: i[a]?.main
91
91
  }, {
92
- ...w,
92
+ ...k,
93
93
  value: i[a]?.comparison
94
- }]) : void 0, _t = Y?.(n) ?? [], M = d ? (K ?? []).map((t, f) => ({
94
+ }]) : void 0, yt = $?.(n) ?? [], P = d ? (M ?? []).map((t, f) => ({
95
95
  label: t.label,
96
- ariaLabel: _t[f]
97
- })) : st ? p.flatMap((t) => t.localized_label ? [{ label: t.localized_label }] : []) : X?.({
96
+ ariaLabel: yt[f]
97
+ })) : lt ? p.flatMap((t) => t.localized_label ? [{ label: t.localized_label }] : []) : tt?.({
98
98
  instanceSlotData: o,
99
99
  copy: n
100
- }).map((t) => ({ label: t })) ?? [], Ct = d || e === "singleBar" || e === "upcomingBill" ? l.length ? d ? /* @__PURE__ */ r(Rt, {
100
+ }).map((t) => ({ label: t })) ?? [], At = d || e === "singleBar" || e === "upcomingBill" ? l.length ? d ? /* @__PURE__ */ r(Ot, {
101
101
  bars: i,
102
- colors: G,
102
+ colors: H,
103
103
  legendPosition: "top",
104
- legends: K,
105
- onBarClick: N,
104
+ legends: M,
105
+ onBarClick: K,
106
106
  selectedIndex: a
107
- }) : /* @__PURE__ */ r(It, {
107
+ }) : /* @__PURE__ */ r(Et, {
108
108
  amounts: {
109
109
  average: o?.average_amount,
110
- formattedAverage: Bt(o?.average_amount ?? 0, Q ?? "0,0.00")
110
+ formattedAverage: Bt(o?.average_amount ?? 0, Z ?? "0,0.00")
111
111
  },
112
- color: G[0] ?? D.palette.primary.main,
112
+ color: H[0] ?? D.palette.primary.main,
113
113
  data: b,
114
114
  legendPosition: "top",
115
115
  heightOverride: 172,
@@ -119,44 +119,45 @@ var fe = zt(({ beat: s }) => {
119
119
  left: 24,
120
120
  right: 24
121
121
  },
122
- monthlyAmountLabel: H?.label ?? n.general.monthly_amount,
123
- onBarClick: N,
122
+ monthlyAmountLabel: w?.label ?? n.general.monthly_amount,
123
+ onBarClick: K,
124
124
  selectedTabIndex: a,
125
- trendAmountLabel: w?.label ?? n.general.trend
126
- }) : /* @__PURE__ */ r(xt, {}) : null;
127
- return /* @__PURE__ */ Wt(Ut, { children: [/* @__PURE__ */ r(Kt, {
128
- baseTransactions: ft,
129
- hideListHeader: J,
130
- projectedRow: ht,
125
+ trendAmountLabel: k?.label ?? n.general.trend
126
+ }) : /* @__PURE__ */ r(Rt, {}) : null;
127
+ return /* @__PURE__ */ $t(Yt, { children: [/* @__PURE__ */ r(Pt, {
128
+ baseTransactions: Tt,
129
+ hideListHeader: Q,
130
+ tipAboveSubTabs: X,
131
+ projectedRow: _t,
131
132
  heading: y?.heading,
132
133
  icon: y?.icon,
133
- onSelectionChange: Tt,
134
+ onSelectionChange: Ct,
134
135
  selectedIndex: a,
135
136
  subHeadingText: y?.subHeadingText,
136
137
  tabs: l,
137
- top: Ct,
138
- ...M.length > 0 && { subTabs: {
139
- tabs: M,
138
+ top: At,
139
+ ...P.length > 0 && { subTabs: {
140
+ tabs: P,
140
141
  selectedIndex: _,
141
- onChange: F
142
+ onChange: O
142
143
  } },
143
- ...v && { tipSection: !nt && (v(rt, n, j?.text, o) ?? !1) },
144
- transactionFilter: pt,
144
+ ...L && { tipSection: !st && (L(it, n, G?.text, o) ?? !1) },
145
+ transactionFilter: ft,
145
146
  onEachRowClick: (t) => {
146
- S({ transaction_guid: t }), x(!0);
147
+ v({ transaction_guid: t }), E(!0);
147
148
  }
148
- }), /* @__PURE__ */ r(St, {
149
- ariaLabelClose: et.close_aria,
150
- isOpen: at,
149
+ }), /* @__PURE__ */ r(Lt, {
150
+ ariaLabelClose: at.close_aria,
151
+ isOpen: rt,
151
152
  onClose: () => {
152
- x(!1), S({ transaction_guid: void 0 }), O();
153
+ E(!1), v({ transaction_guid: void 0 }), j();
153
154
  },
154
155
  title: n.general.transaction_details_title,
155
- children: /* @__PURE__ */ r(Pt, { beat: s })
156
+ children: /* @__PURE__ */ r(zt, { beat: s })
156
157
  })] });
157
158
  });
158
159
  export {
159
- fe as TransactionHistoryBlock
160
+ Te as TransactionHistoryBlock
160
161
  };
161
162
 
162
163
  //# sourceMappingURL=TransactionHistoryBlock.es.js.map