@mx-cartographer/experiences 9.7.134 → 9.7.135

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 CHANGED
@@ -1,3 +1,8 @@
1
+ ## [9.7.135] - 11-11-2026
2
+
3
+ - **ADDED** - Insights 2.0 Monthly Savings to Income Comparison: `DoubleBarChartBlock` renders the `savings_to_income` layout variant (Savings vs Income, chartMono palette), and the `savings_to_income` drawer matches Figma 1243:73833: 6 month tabs from the opening CTA's `drilldown_data` (the card's 4 months until a beat carries them), the "Financial experts suggest saving 20%" tip above the Savings / Income tabs and the Transactions heading above the list. Drawer series from tupac !4066 and ditto !125; tip copy (`savings_to_income_tip_message`, `savings_to_income_tip_percentage`, optional) from mrs_content !506 (WEC-2229)
4
+ - **CHANGED** - The Savings vs. Income drawer title copy key is renamed `monthly_savings_to_income_drawer_title` → `savings_to_income_drawer_title` (a required field on the exported `TransactionHistoryBlock` copy type; paired mrs_content !501, published), and its Savings tab reads the new optional `general.savings_transactions` accessible name (already in mrs_content) (WEC-2229)
5
+
1
6
  ## [9.7.134] - 11-11-2026
2
7
 
3
8
  - **ADDED** - Insights 2.0 merchant quiz block and merchant spending drawer, with a zero state and loading state (MEW2-3474)
@@ -44,6 +44,7 @@ interface GeneralInsightsFeedCopy {
44
44
  in_month_you_had_a_category_of_amount?: string;
45
45
  income_transactions?: string;
46
46
  spend_transactions?: string;
47
+ savings_transactions?: string;
47
48
  /** Subscription status CTA words: the ✓ / ✗ status and Undo. */
48
49
  confirmed?: string;
49
50
  incorrect?: string;
@@ -118,7 +119,7 @@ export interface TransactionHistoryBlock {
118
119
  upcoming_bill_drawer_title: string;
119
120
  monthly_spend_to_income_drawer_title: string;
120
121
  monthly_debt_to_income_drawer_title: string;
121
- monthly_savings_to_income_drawer_title: string;
122
+ savings_to_income_drawer_title: string;
122
123
  cost_living_to_income_drawer_title: string;
123
124
  non_essential_category_summary_drawer_title: string;
124
125
  monthly_deposit_summary_drawer_title: string;
@@ -132,6 +133,12 @@ export interface TransactionHistoryBlock {
132
133
  */
133
134
  monthly_debt_to_income_tip_message?: string;
134
135
  monthly_debt_to_income_tip_limit?: string;
136
+ /**
137
+ * The Savings vs. Income drawer's tip: `_1{tip}` the bold tip title and `_2{percentage}` the bold
138
+ * percentage (`savings_to_income_tip_percentage`, "20%"). Optional: without both, no tip.
139
+ */
140
+ savings_to_income_tip_message?: string;
141
+ savings_to_income_tip_percentage?: string;
135
142
  }
136
143
  export interface TransactionListBlockCopy {
137
144
  deposit_history_drawer_title?: string;
@@ -25,9 +25,8 @@ interface TransactionDrillDownProps {
25
25
  transaction: Transaction;
26
26
  };
27
27
  hideListHeader?: boolean;
28
- tipAboveSubTabs?: boolean;
29
28
  }
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) & {
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) & {
31
30
  displayName: string;
32
31
  };
33
32
  export default TransactionDrillDown;
@@ -1,148 +1,141 @@
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";
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";
9
9
  import "react";
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";
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";
15
15
  import { jsx as r, jsxs as o } from "react/jsx-runtime";
16
16
  import t from "@mui/material/Box";
17
- import rr from "@mui/material/Tab";
18
- import or from "@mui/material/Tabs";
19
- var I = {
17
+ import F from "@mui/material/Tab";
18
+ import H from "@mui/material/Tabs";
19
+ var rr = {
20
20
  color: "primary",
21
21
  name: "tips_and_updates",
22
22
  size: 20
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;
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;
29
29
  return /* @__PURE__ */ o(t, {
30
30
  sx: {
31
31
  bgcolor: "background.paper",
32
32
  width: "100%"
33
33
  },
34
- children: [f && /* @__PURE__ */ r(or, {
35
- "aria-label": N,
36
- onChange: U,
34
+ children: [p && /* @__PURE__ */ r(H, {
35
+ "aria-label": R,
36
+ onChange: E,
37
37
  sx: { mb: 0 },
38
- value: c,
38
+ value: s,
39
39
  variant: "fullWidth",
40
- children: v.map((i, e) => /* @__PURE__ */ r(rr, {
40
+ children: u.map((n, i) => /* @__PURE__ */ r(F, {
41
41
  "aria-controls": S,
42
- "aria-label": i.ariaLabel,
43
- id: w(e),
44
- label: i.label,
42
+ "aria-label": n.ariaLabel,
43
+ id: C(i),
44
+ label: n.label,
45
45
  sx: {
46
46
  minWidth: "auto",
47
47
  px: 0
48
48
  }
49
- }, `${i.label}-${e}`))
49
+ }, `${n.label}-${i}`))
50
50
  }), /* @__PURE__ */ o(t, {
51
- "aria-labelledby": f ? w(c) : void 0,
51
+ "aria-labelledby": p ? C(s) : void 0,
52
52
  id: S,
53
- role: f ? "tabpanel" : void 0,
53
+ role: p ? "tabpanel" : void 0,
54
54
  children: [
55
- (l || s) && /* @__PURE__ */ o(h, {
55
+ (e || l) && /* @__PURE__ */ o(f, {
56
56
  sx: {
57
57
  gap: 4,
58
58
  pt: 16,
59
59
  px: 24
60
60
  },
61
- children: [l && /* @__PURE__ */ r(Z, { children: l }), s && /* @__PURE__ */ o(h, {
61
+ children: [e && /* @__PURE__ */ r(X, { children: e }), l && /* @__PURE__ */ o(f, {
62
62
  sx: {
63
63
  alignItems: "center",
64
64
  flexDirection: "row",
65
65
  gap: 8
66
66
  },
67
- children: [P, /* @__PURE__ */ r(x, {
67
+ children: [w, /* @__PURE__ */ r(h, {
68
68
  color: "text.secondary",
69
69
  sx: { letterSpacing: "0.52px" },
70
70
  textTransform: "uppercase",
71
71
  variant: "body2",
72
- children: s
72
+ children: l
73
73
  })]
74
74
  })]
75
75
  }),
76
76
  /* @__PURE__ */ r(t, {
77
77
  sx: {
78
- pb: T ? 16 : 0,
78
+ pb: v ? 16 : 0,
79
79
  pt: 16
80
80
  },
81
- children: T
81
+ children: v
82
82
  }),
83
- y && a && /* @__PURE__ */ r(D, {
84
- icon: I,
85
- ...a
83
+ _ && /* @__PURE__ */ r(J, {
84
+ icon: rr,
85
+ ..._
86
86
  }),
87
- n && /* @__PURE__ */ r(Q, {
88
- ...n,
89
- id: B
87
+ a && /* @__PURE__ */ r(K, {
88
+ ...a,
89
+ id: D
90
90
  }),
91
91
  /* @__PURE__ */ o(t, {
92
- ...n && X(B, n.selectedIndex),
93
- children: [
94
- !y && a && /* @__PURE__ */ r(D, {
95
- icon: I,
96
- ...a
97
- }),
98
- (!m || b.length > 0) && /* @__PURE__ */ o(h, {
99
- sx: {
100
- alignItems: "center",
101
- borderBottomColor: "divider",
102
- borderBottomStyle: "solid",
103
- borderBottomWidth: 1,
104
- flexDirection: "row",
105
- justifyContent: m ? "flex-end" : "space-between",
106
- pb: 4,
107
- pt: 16,
108
- px: 24
92
+ ...a && M(D, a.selectedIndex),
93
+ children: [(!d || b.length > 0) && /* @__PURE__ */ o(f, {
94
+ sx: {
95
+ alignItems: "center",
96
+ borderBottomColor: "divider",
97
+ borderBottomStyle: "solid",
98
+ borderBottomWidth: 1,
99
+ flexDirection: "row",
100
+ justifyContent: d ? "flex-end" : "space-between",
101
+ pb: 4,
102
+ pt: 16,
103
+ px: 24
104
+ },
105
+ children: [!d && /* @__PURE__ */ r(h, {
106
+ bold: !0,
107
+ variant: "body1",
108
+ children: m.transactions_title
109
+ }), b.length > 0 && /* @__PURE__ */ r(Y, {
110
+ onClick: () => {
111
+ j(b, $);
109
112
  },
110
- children: [!m && /* @__PURE__ */ r(x, {
113
+ startIcon: /* @__PURE__ */ r(Z, { name: "ios_share" }),
114
+ sx: { height: 28 },
115
+ children: /* @__PURE__ */ r(h, {
111
116
  bold: !0,
112
- variant: "body1",
113
- children: p.transactions_title
114
- }), b.length > 0 && /* @__PURE__ */ r(F, {
115
- onClick: () => {
116
- V(b, E);
117
- },
118
- startIcon: /* @__PURE__ */ r(H, { name: "ios_share" }),
119
- sx: { height: 28 },
120
- children: /* @__PURE__ */ r(x, {
121
- bold: !0,
122
- variant: "body2",
123
- children: p.export_csv_btn
124
- })
125
- })]
126
- }),
127
- d ? /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ r(K, { children: d.heading }), /* @__PURE__ */ r(J, {
128
- component: "div",
129
- transaction: d.transaction
130
- })] }) : /* @__PURE__ */ r(t, {
131
- sx: { bgcolor: "background.default" },
132
- children: /* @__PURE__ */ r(M, {
133
- transaction: C,
134
- onClick: L
117
+ variant: "body2",
118
+ children: m.export_csv_btn
135
119
  })
120
+ })]
121
+ }), c ? /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ r(V, { children: c.heading }), /* @__PURE__ */ r(O, {
122
+ component: "div",
123
+ transaction: c.transaction
124
+ })] }) : /* @__PURE__ */ r(t, {
125
+ sx: { bgcolor: "background.default" },
126
+ children: /* @__PURE__ */ r(q, {
127
+ transaction: y,
128
+ onClick: k
136
129
  })
137
- ]
130
+ })]
138
131
  })
139
132
  ]
140
133
  })]
141
134
  });
142
135
  });
143
136
  export {
144
- gr as TransactionDrillDown,
145
- gr as default
137
+ _r as TransactionDrillDown,
138
+ _r as default
146
139
  };
147
140
 
148
141
  //# 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 // 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,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C,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}\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 {/* Every Figma chart drawer puts the tip under the chart, above any sub-tabs. */}\n {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 {(!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,EA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, useGlobalUiStore as St, useInsightsV2Store as vt } from "../../../common/context/hooks.es.js";
2
- import { CURRENCY_FORMAT as Bt, formatCurrency as Lt } from "../../../core/utils/NumberFormatting.es.js";
3
- import It from "../../../common/components/drawer/Drawer.es.js";
4
- import Et from "../../../common/components/Loader.es.js";
5
- import { BAR_ARIA_LABEL as Rt } from "../../blocks/ChartBlocks/BarchartBlock/utils.es.js";
6
- import { BarChartV2 as xt } from "../../components/chartblocks/BarchartV2.es.js";
7
- import { EmptyBarChart as Ft } from "../../components/chartblocks/EmptyBarChart.es.js";
1
+ import { useGlobalCopyStore as At, useGlobalUiStore as Dt, useInsightsV2Store as Bt } from "../../../common/context/hooks.es.js";
2
+ import { CURRENCY_FORMAT as St, formatCurrency as vt } from "../../../core/utils/NumberFormatting.es.js";
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 Et } from "../../blocks/ChartBlocks/BarchartBlock/utils.es.js";
6
+ import { BarChartV2 as Rt } from "../../components/chartblocks/BarchartV2.es.js";
7
+ import { EmptyBarChart as xt } from "../../components/chartblocks/EmptyBarChart.es.js";
8
8
  import { ANALYTICS_EVENTS_CONFIG as V } from "../../analytics/analyticsEventsConfig.es.js";
9
- import { useAnalyticsEvent as Ot } from "../../analytics/useAnalyticsEvent.es.js";
10
- import { DoubleBarChart as jt } from "../../components/chartblocks/DoubleBarChart.es.js";
11
- import { toLegendItems as Gt } from "../../blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils.es.js";
12
- import { getDefaultSelection as Ht, getDrillDownConfig as wt, getFlattenedDataSeries as Nt, resolveDrillDownSubHeader as kt, splitProjectedTransaction as Mt, toStoreFilter as Kt } from "./utils.es.js";
13
- import { getDynamicCtaBasedOnTriggers as Pt } from "../util.es.js";
14
- import { TransactionDrillDown as Vt } from "./TransactionDrillDown.es.js";
15
- import { useTransactionHistory as zt } from "./useTransactionHistory.es.js";
16
- import { TransactionDetailsBlock as Ut } from "../TransactionDetailsBlock/TransactionDetailsBlock.es.js";
17
- import { useLayoutEffect as Yt, useState as m } from "react";
18
- import { observer as Wt } from "mobx-react-lite";
19
- import { Fragment as $t, jsx as r, jsxs as qt } from "react/jsx-runtime";
20
- import { useTheme as Jt } from "@mui/material/styles";
21
- var _e = Wt(({ beat: s }) => {
22
- const D = Jt(), { actionDrawer: S, setActionContext: v } = vt(), { insights_payload: c } = s, B = Pt(S, c?.primary_cta, c?.secondary_cta, c?.in_description_cta), z = B?.variant, { top: e, filterMode: u, header: U, colors: Y, filterStrategy: W, tipSection: L, subTabAriaLabels: $, slotData: q, beatTransactions: J, hideListHeader: Q, tipAboveSubTabs: X, averageFormat: Z, subTabs: tt } = wt(z ?? ""), { instanceSlotData: o, beatTransactions: g, spendCategoryGuids: I, allAccountGuids: E, categoryName: et, displayedDateRange: h, transactionStore: ot } = zt(s, {
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 Nt, splitProjectedTransaction as kt, toStoreFilter as Mt } from "./utils.es.js";
13
+ import { getDynamicCtaBasedOnTriggers as Kt } 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 Yt } from "mobx-react-lite";
19
+ import { Fragment as Wt, jsx as r, jsxs as $t } from "react/jsx-runtime";
20
+ import { useTheme as qt } from "@mui/material/styles";
21
+ var _e = Yt(({ beat: s }) => {
22
+ const D = qt(), { actionDrawer: B, setActionContext: S } = Bt(), { insights_payload: c } = s, v = Kt(B, c?.primary_cta, c?.secondary_cta, c?.in_description_cta), z = v?.variant, { top: e, filterMode: u, header: U, colors: Y, filterStrategy: W, tipSection: L, subTabAriaLabels: $, slotData: q, beatTransactions: J, hideListHeader: Q, averageFormat: X, subTabs: Z } = Ht(z ?? ""), { instanceSlotData: o, beatTransactions: g, spendCategoryGuids: I, allAccountGuids: E, categoryName: tt, displayedDateRange: h, transactionStore: et } = Vt(s, {
23
23
  slotData: q,
24
24
  beatTransactions: J
25
- }, B?.drilldown_data), { common: at, insights_feed: n } = Dt(), { isCopyLoaded: nt } = St(), [rt, R] = m(!1), [st, it] = m(!1), x = Ot(), { dataSeries: p, chartData: b, comparisonBars: i } = Nt({
25
+ }, v?.drilldown_data), { common: ot, insights_feed: n } = At(), { isCopyLoaded: at } = Dt(), [nt, R] = m(!1), [rt, st] = m(!1), x = 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}" : Rt,
27
+ ariaLabel: e === "doubleBar" ? n?.general?.in_month_you_had_a_category_of_amount ?? "_1{month}, _2{category}: _3{amount}" : Et,
28
28
  top: e,
29
29
  beatTransactions: g
30
- }), d = e === "doubleBar", lt = e === "tabsOnly", l = d ? i : b, { chartBarIndex: F, subTabIndex: ct } = Ht({
30
+ }), d = e === "doubleBar", it = e === "tabsOnly", l = d ? i : b, { chartBarIndex: F, subTabIndex: lt } = Gt({
31
31
  chartTabCount: b.length,
32
32
  comparisonTabCount: i.length,
33
- actionDrawer: S,
33
+ actionDrawer: B,
34
34
  beatGuid: s.guid
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) => W({
35
+ }), [a, _] = m(F), [C, O] = m(lt), [ct, dt] = m(l.length);
36
+ l.length !== ct && (dt(l.length), _(F));
37
+ const T = (t) => W({
38
38
  beat: s,
39
39
  beatTransactions: g,
40
40
  dataSeries: p,
41
41
  comparisonBars: i,
42
42
  selectedIndex: t,
43
- subIndex: _,
43
+ subIndex: C,
44
44
  isLastTab: t === l.length - 1,
45
45
  instanceSlotData: o,
46
46
  spendCategoryGuids: I,
47
47
  displayedDateRange: h
48
- }), ut = g.map((t) => t.guid).join(","), gt = I.join(","), pt = E.join(","), bt = e === "list" || e === "tabsOnly" || e === "monthTabs" || p.length > 0, j = () => {
48
+ }), mt = g.map((t) => t.guid).join(","), ut = I.join(","), gt = E.join(","), pt = e === "list" || e === "tabsOnly" || e === "monthTabs" || p.length > 0, j = () => {
49
49
  if (u !== "store") return;
50
- const t = bt ? C(a) : {
50
+ const t = pt ? T(a) : {
51
51
  accounts: [],
52
52
  custom: () => !1
53
53
  };
54
- ot.setFilter(Kt(t, {
54
+ et.setFilter(Mt(t, {
55
55
  allAccountGuids: E,
56
56
  displayedDateRange: h
57
57
  }));
58
58
  };
59
- Yt(() => {
59
+ Ut(() => {
60
60
  j();
61
61
  }, [
62
62
  s.guid,
63
63
  a,
64
- _,
64
+ C,
65
65
  u,
66
66
  p.length,
67
67
  o,
68
68
  h,
69
- gt,
70
- pt,
71
69
  ut,
70
+ gt,
71
+ mt,
72
72
  e
73
73
  ]);
74
- const G = kt(c), y = U?.({
74
+ const G = Nt(c), y = U?.({
75
75
  title: c?.title,
76
76
  subHeader: G,
77
- categoryName: et,
77
+ categoryName: tt,
78
78
  selectedDate: b[a]?.date ?? void 0
79
79
  }), H = Y(D, o?.category_guid);
80
- if (!nt) return /* @__PURE__ */ r(Et, {});
81
- const [w, N] = o?.legends ?? [], ft = u === "local" ? (t) => C(t).custom ?? (() => !0) : void 0, { transactions: ht, projectedTransaction: A } = Mt(g), Tt = u === "local" ? ht : void 0, k = n.general.projected_amount, _t = A && k && C(a).custom?.(A) ? {
80
+ if (!at) return /* @__PURE__ */ r(It, {});
81
+ const [w, N] = o?.legends ?? [], bt = u === "local" ? (t) => T(t).custom ?? (() => !0) : void 0, { transactions: ft, projectedTransaction: A } = kt(g), ht = u === "local" ? ft : void 0, k = n.general.projected_amount, _t = A && k && T(a).custom?.(A) ? {
82
82
  heading: k,
83
83
  transaction: A
84
84
  } : void 0, M = (t, f) => {
85
- x(V.DRAWER_CHART_BAR_CLICKED), T(t), f !== void 0 && O(f);
85
+ x(V.DRAWER_CHART_BAR_CLICKED), _(t), f !== void 0 && O(f);
86
86
  }, Ct = (t) => {
87
- x(V.TAB_SELECTED), T(t);
88
- }, K = d ? Gt([{
87
+ x(V.TAB_SELECTED), _(t);
88
+ }, K = d ? jt([{
89
89
  ...w,
90
90
  value: i[a]?.main
91
91
  }, {
92
92
  ...N,
93
93
  value: i[a]?.comparison
94
- }]) : void 0, yt = $?.(n) ?? [], P = d ? (K ?? []).map((t, f) => ({
94
+ }]) : void 0, Tt = $?.(n) ?? [], P = d ? (K ?? []).map((t, f) => ({
95
95
  label: t.label,
96
- ariaLabel: yt[f]
97
- })) : lt ? p.flatMap((t) => t.localized_label ? [{ label: t.localized_label }] : []) : tt?.({
96
+ ariaLabel: Tt[f]
97
+ })) : it ? p.flatMap((t) => t.localized_label ? [{ label: t.localized_label }] : []) : Z?.({
98
98
  instanceSlotData: o,
99
99
  copy: n
100
- }).map((t) => ({ label: t })) ?? [], At = d || e === "singleBar" || e === "upcomingBill" ? l.length ? d ? /* @__PURE__ */ r(jt, {
100
+ }).map((t) => ({ label: t })) ?? [], yt = d || e === "singleBar" || e === "upcomingBill" ? l.length ? d ? /* @__PURE__ */ r(Ot, {
101
101
  bars: i,
102
102
  colors: H,
103
103
  legendPosition: "top",
104
104
  legends: K,
105
105
  onBarClick: M,
106
106
  selectedIndex: a
107
- }) : /* @__PURE__ */ r(xt, {
107
+ }) : /* @__PURE__ */ r(Rt, {
108
108
  amounts: {
109
109
  average: o?.average_amount,
110
- formattedAverage: Lt(o?.average_amount ?? 0, Z ?? Bt.cents)
110
+ formattedAverage: vt(o?.average_amount ?? 0, X ?? St.cents)
111
111
  },
112
112
  color: H[0] ?? D.palette.primary.main,
113
113
  data: b,
@@ -123,11 +123,10 @@ var _e = Wt(({ beat: s }) => {
123
123
  onBarClick: M,
124
124
  selectedTabIndex: a,
125
125
  trendAmountLabel: N?.label ?? n.general.trend
126
- }) : /* @__PURE__ */ r(Ft, {}) : null;
127
- return /* @__PURE__ */ qt($t, { children: [/* @__PURE__ */ r(Vt, {
128
- baseTransactions: Tt,
126
+ }) : /* @__PURE__ */ r(xt, {}) : null;
127
+ return /* @__PURE__ */ $t(Wt, { children: [/* @__PURE__ */ r(Pt, {
128
+ baseTransactions: ht,
129
129
  hideListHeader: Q,
130
- tipAboveSubTabs: X,
131
130
  projectedRow: _t,
132
131
  heading: y?.heading,
133
132
  icon: y?.icon,
@@ -135,25 +134,25 @@ var _e = Wt(({ beat: s }) => {
135
134
  selectedIndex: a,
136
135
  subHeadingText: y?.subHeadingText,
137
136
  tabs: l,
138
- top: At,
137
+ top: yt,
139
138
  ...P.length > 0 && { subTabs: {
140
139
  tabs: P,
141
- selectedIndex: _,
140
+ selectedIndex: C,
142
141
  onChange: O
143
142
  } },
144
- ...L && { tipSection: !st && (L(it, n, G?.text, o) ?? !1) },
145
- transactionFilter: ft,
143
+ ...L && { tipSection: !rt && (L(st, n, G?.text, o) ?? !1) },
144
+ transactionFilter: bt,
146
145
  onEachRowClick: (t) => {
147
- v({ transaction_guid: t }), R(!0);
146
+ S({ transaction_guid: t }), R(!0);
148
147
  }
149
- }), /* @__PURE__ */ r(It, {
150
- ariaLabelClose: at.close_aria,
151
- isOpen: rt,
148
+ }), /* @__PURE__ */ r(Lt, {
149
+ ariaLabelClose: ot.close_aria,
150
+ isOpen: nt,
152
151
  onClose: () => {
153
- R(!1), v({ transaction_guid: void 0 }), j();
152
+ R(!1), S({ transaction_guid: void 0 }), j();
154
153
  },
155
154
  title: n.general.transaction_details_title,
156
- children: /* @__PURE__ */ r(Ut, { beat: s })
155
+ children: /* @__PURE__ */ r(zt, { beat: s })
157
156
  })] });
158
157
  });
159
158
  export {