@mx-cartographer/experiences 9.7.185 → 9.7.187

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 (25) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/common/components/charts/linechart/CustomMark.es.js +26 -29
  3. package/dist/common/components/charts/linechart/CustomMark.es.js.map +1 -1
  4. package/dist/common/utils/MouseOnly.d.ts +2 -0
  5. package/dist/common/utils/MouseOnly.es.js +8 -0
  6. package/dist/common/utils/MouseOnly.es.js.map +1 -0
  7. package/dist/core/types/localization/InsightsFeedCopy.d.ts +2 -0
  8. package/dist/insights/hooks/useContainerDimensions.es.js +11 -9
  9. package/dist/insights/hooks/useContainerDimensions.es.js.map +1 -1
  10. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +79 -77
  11. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
  12. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +2 -0
  13. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +29 -30
  14. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
  15. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChart.es.js +19 -19
  16. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChart.es.js.map +1 -1
  17. package/dist/insights-v2/components/chartblocks/ChartLegend.d.ts +3 -1
  18. package/dist/insights-v2/components/chartblocks/ChartLegend.es.js +10 -10
  19. package/dist/insights-v2/components/chartblocks/ChartLegend.es.js.map +1 -1
  20. package/dist/insights-v2/components/chartblocks/DoubleBarChart.d.ts +3 -1
  21. package/dist/insights-v2/components/chartblocks/DoubleBarChart.es.js +32 -31
  22. package/dist/insights-v2/components/chartblocks/DoubleBarChart.es.js.map +1 -1
  23. package/dist/networth/components/NetWorthListItem.es.js +25 -24
  24. package/dist/networth/components/NetWorthListItem.es.js.map +1 -1
  25. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## [9.7.187] - 11-18-2026
2
+
3
+ - **FIXED** - Month selection in the net worth widget on touch devices (WELL-50)
4
+
5
+ ## [9.7.186] - 11-18-2026
6
+
7
+ - **FIXED** - Monthly Deposit Summary's donut and legend stay centred in a wider card (WEC-2341)
8
+ - **FIXED** - Monthly Deposit Summary's drawer legend reads "Deposit", with no amount (WEC-2341)
9
+ - **FIXED** - Spend, Savings, Debt and Cost of Living to Income drawers draw their legend at one size (13px), and Savings to Income's tip has no close button (WEC-2341)
10
+ - **FIXED** - Bar charts follow their card's width when the card resizes, so Savings Account Balance Summary no longer clips its last bars (WEC-2341)
11
+
1
12
  ## [9.7.185] - 11-18-2026
2
13
 
3
14
  - **CHANGED** - Insights 2.0 mini: the instance_slot fills the host's fixed-height card (Pulse's 312px mini slide) with its contents centred vertically, putting the description and link at the card's bottom. `BaseLayout` now wraps the block in a Box between the header and the description; full cards look unchanged (WEC-2365)
@@ -1,18 +1,19 @@
1
1
  import { formatCurrency as F } from "../../../../core/utils/NumberFormatting.es.js";
2
2
  import { MARKER_SHAPE_PATHS as T } from "./utils/markerShapes.es.js";
3
+ import { mouseOnly as M } from "../../../utils/MouseOnly.es.js";
3
4
  import x from "react";
4
- import { Fragment as k, jsx as h, jsxs as S } from "react/jsx-runtime";
5
+ import { Fragment as S, jsx as h, jsxs as A } from "react/jsx-runtime";
5
6
  import { useTheme as B } from "@mui/material/styles";
6
7
  import I from "@mui/material/useMediaQuery";
7
- var P = "M4,0A4,4,0,1,1,-4,0A4,4,0,1,1,4,0", s = 5, R = 12, u = 16, K = (t) => {
8
- const a = B(), o = t.showLabel, e = t.style, A = e?.markLabelStyles, l = Number(t.x), d = Number(t.y), r = t.variant === "compact", y = t.handlers?.onMarkClick, L = t.handlers?.onMouseEnter, v = t.handlers?.onMouseLeave, _ = I(a.breakpoints.up("sm")), f = x.useRef(null), [w, E] = x.useState(0), b = t.valueFormatterString ? F(t.yData[t.dataIndex], t.valueFormatterString) : String(t.yData[t.dataIndex]), M = _ ? a.typography.body2?.fontSize : a.typography.caption?.fontSize;
8
+ var R = "M4,0A4,4,0,1,1,-4,0A4,4,0,1,1,4,0", s = 5, z = 12, y = 16, j = (t) => {
9
+ const a = B(), o = t.showLabel, e = t.style, L = e?.markLabelStyles, l = Number(t.x), d = Number(t.y), r = t.variant === "compact", u = t.handlers?.onMarkClick, v = t.handlers?.onMouseEnter, P = t.handlers?.onMouseLeave, _ = I(a.breakpoints.up("sm")), f = x.useRef(null), [w, E] = x.useState(0), b = t.valueFormatterString ? F(t.yData[t.dataIndex], t.valueFormatterString) : String(t.yData[t.dataIndex]), g = _ ? a.typography.body2?.fontSize : a.typography.caption?.fontSize;
9
10
  x.useLayoutEffect(() => {
10
11
  r && o && E(f.current?.getBBox?.().width ?? 0);
11
12
  }, [
12
13
  r,
13
14
  o,
14
15
  b,
15
- M,
16
+ g,
16
17
  t.labelFontSize
17
18
  ]);
18
19
  let n = {
@@ -21,28 +22,28 @@ var P = "M4,0A4,4,0,1,1,-4,0A4,4,0,1,1,4,0", s = 5, R = 12, u = 16, K = (t) => {
21
22
  width: 30,
22
23
  x: l - 15,
23
24
  y: d - 30
24
- }, c = {
25
+ }, m = {
25
26
  x: l,
26
27
  y: d - 16
27
28
  };
28
29
  if (r) {
29
- const m = t.dataIndex === 0 ? "start" : t.dataIndex === t.yData.length - 1 ? "end" : "middle", i = w + 4, g = {
30
+ const c = t.dataIndex === 0 ? "start" : t.dataIndex === t.yData.length - 1 ? "end" : "middle", i = w + 4, C = {
30
31
  start: l - s,
31
32
  middle: l - i / 2,
32
33
  end: l + s - i
33
- }[m], C = d - s - R;
34
+ }[c], k = d - s - z;
34
35
  n = {
35
- height: u,
36
+ height: y,
36
37
  rx: 2,
37
38
  width: i,
38
- x: g,
39
- y: C - u
40
- }, c = {
41
- x: g + i / 2,
42
- y: C - u / 2
39
+ x: C,
40
+ y: k - y
41
+ }, m = {
42
+ x: C + i / 2,
43
+ y: k - y / 2
43
44
  };
44
45
  }
45
- return /* @__PURE__ */ S(k, { children: [o && /* @__PURE__ */ S(k, { children: [t.labelBackgroundColor && /* @__PURE__ */ h("rect", {
46
+ return /* @__PURE__ */ A(S, { children: [o && /* @__PURE__ */ A(S, { children: [t.labelBackgroundColor && /* @__PURE__ */ h("rect", {
46
47
  fill: t.labelBackgroundColor,
47
48
  height: n.height,
48
49
  rx: n.rx,
@@ -55,26 +56,22 @@ var P = "M4,0A4,4,0,1,1,-4,0A4,4,0,1,1,4,0", s = 5, R = 12, u = 16, K = (t) => {
55
56
  fill: t.labelFontColor ? t.labelFontColor : a.palette.text.primary,
56
57
  ref: f,
57
58
  style: {
58
- fontSize: t.labelFontSize ? t.labelFontSize : M,
59
- ...A
59
+ fontSize: t.labelFontSize ? t.labelFontSize : g,
60
+ ...L
60
61
  },
61
62
  textAnchor: "middle",
62
- x: c.x,
63
- y: c.y,
63
+ x: m.x,
64
+ y: m.y,
64
65
  children: b
65
66
  })] }), t.showMark && /* @__PURE__ */ h("path", {
66
- cursor: y ? "pointer" : "unset",
67
- d: r ? P : T[t.shape ?? "circle"],
67
+ cursor: u ? "pointer" : "unset",
68
+ d: r ? R : T[t.shape ?? "circle"],
68
69
  height: "20px",
69
- onClick: (m) => {
70
- y?.(m, t.dataIndex);
71
- },
72
- onMouseEnter: () => {
73
- L?.(t.dataIndex);
74
- },
75
- onMouseLeave: () => {
76
- v?.();
70
+ onClick: (c) => {
71
+ u?.(c, t.dataIndex);
77
72
  },
73
+ onPointerEnter: M(() => v?.(t.dataIndex)),
74
+ onPointerLeave: M(() => P?.()),
78
75
  style: {
79
76
  fill: e?.fill ? e.fill : a.palette.background.paper,
80
77
  stroke: e?.stroke ? e.stroke : a.palette.primary.main,
@@ -87,7 +84,7 @@ var P = "M4,0A4,4,0,1,1,-4,0A4,4,0,1,1,4,0", s = 5, R = 12, u = 16, K = (t) => {
87
84
  })] });
88
85
  };
89
86
  export {
90
- K as CustomMark
87
+ j as CustomMark
91
88
  };
92
89
 
93
90
  //# sourceMappingURL=CustomMark.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomMark.es.js","names":[],"sources":["../../../../../src/common/components/charts/linechart/CustomMark.tsx"],"sourcesContent":["import React from 'react'\n\nimport { useTheme } from '@mui/material/styles'\nimport useMediaQuery from '@mui/material/useMediaQuery'\n\nimport type { MarkElementProps } from '@mui/x-charts'\n\nimport { MARKER_SHAPE_PATHS } from './utils/markerShapes'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nexport type MarkHandlers = {\n onMarkClick?: (event: React.MouseEvent<SVGPathElement, MouseEvent>, dataIndex: number) => void\n onMouseEnter?: (dataIndex: number) => void\n onMouseLeave?: () => void\n}\n\n// compact: a 10px mark, and a 16px label box that fits its text, 12px above the mark.\n// The first and last label alignment assumes a single series.\nexport type MarkVariant = 'default' | 'compact'\n\nconst COMPACT_MARK_PATH = 'M4,0A4,4,0,1,1,-4,0A4,4,0,1,1,4,0'\nconst COMPACT_MARK_RADIUS = 5\nconst COMPACT_LABEL_GAP = 12\nconst COMPACT_LABEL_HEIGHT = 16\nconst COMPACT_LABEL_PADDING = 2\n\ninterface CustomMarkProps extends MarkElementProps {\n handlers?: MarkHandlers\n showLabel: boolean\n showMark?: boolean\n variant?: MarkVariant\n yData: number[]\n style?: React.CSSProperties & {\n markLabelStyles?: React.CSSProperties\n }\n labelBackgroundColor?: string\n labelFontColor?: string\n labelFontSize?: number\n valueFormatterString?: string\n}\n\nexport const CustomMark: React.FC<CustomMarkProps> = (props) => {\n const theme = useTheme()\n const showLabel = props.showLabel\n const styles = props.style\n const markLabelStyles = styles?.markLabelStyles\n const xNumber = Number(props.x)\n const yNumber = Number(props.y)\n const isCompact = props.variant === 'compact'\n\n const handleMarkClick = props.handlers?.onMarkClick\n const handleMouseEnter = props.handlers?.onMouseEnter\n const handleMouseLeave = props.handlers?.onMouseLeave\n\n const isSmallScreenUp = useMediaQuery(theme.breakpoints.up('sm'))\n const textRef = React.useRef<SVGTextElement>(null)\n const [textWidth, setTextWidth] = React.useState(0)\n\n // Calculate text dimensions for proper background sizing\n const formattedValue = props.valueFormatterString\n ? formatCurrency(props.yData[props.dataIndex], props.valueFormatterString)\n : String(props.yData[props.dataIndex])\n const fontSize = isSmallScreenUp\n ? theme.typography.body2?.fontSize\n : theme.typography.caption?.fontSize\n\n React.useLayoutEffect(() => {\n if (isCompact && showLabel) setTextWidth(textRef.current?.getBBox?.().width ?? 0)\n }, [isCompact, showLabel, formattedValue, fontSize, props.labelFontSize])\n\n let rect = { height: 24, rx: 3, width: 30, x: xNumber - 15, y: yNumber - 30 }\n let text = { x: xNumber, y: yNumber - 16 }\n\n if (isCompact) {\n // The first and last labels line up with the outer edge of their mark, so they stay inside the plot.\n const align =\n props.dataIndex === 0\n ? 'start'\n : props.dataIndex === props.yData.length - 1\n ? 'end'\n : 'middle'\n const width = textWidth + COMPACT_LABEL_PADDING * 2\n const boxX = {\n start: xNumber - COMPACT_MARK_RADIUS,\n middle: xNumber - width / 2,\n end: xNumber + COMPACT_MARK_RADIUS - width,\n }[align]\n const boxBottom = yNumber - COMPACT_MARK_RADIUS - COMPACT_LABEL_GAP\n\n rect = {\n height: COMPACT_LABEL_HEIGHT,\n rx: 2,\n width,\n x: boxX,\n y: boxBottom - COMPACT_LABEL_HEIGHT,\n }\n text = { x: boxX + width / 2, y: boxBottom - COMPACT_LABEL_HEIGHT / 2 }\n }\n\n return (\n <>\n {showLabel && (\n <>\n {props.labelBackgroundColor && (\n <rect\n fill={props.labelBackgroundColor}\n height={rect.height}\n rx={rect.rx}\n width={rect.width}\n x={rect.x}\n y={rect.y}\n />\n )}\n\n <text\n className=\"MuiLineChart-markLabel\"\n dominantBaseline=\"middle\"\n fill={props.labelFontColor ? props.labelFontColor : theme.palette.text.primary}\n ref={textRef}\n style={{\n fontSize: props.labelFontSize ? props.labelFontSize : fontSize,\n ...markLabelStyles,\n }}\n textAnchor=\"middle\"\n x={text.x}\n y={text.y}\n >\n {formattedValue}\n </text>\n </>\n )}\n {props.showMark && (\n <path\n cursor={handleMarkClick ? 'pointer' : 'unset'}\n d={isCompact ? COMPACT_MARK_PATH : MARKER_SHAPE_PATHS[props.shape ?? 'circle']}\n height=\"20px\"\n onClick={(event) => {\n handleMarkClick?.(event, props.dataIndex)\n }}\n onMouseEnter={() => {\n handleMouseEnter?.(props.dataIndex)\n }}\n onMouseLeave={() => {\n handleMouseLeave?.()\n }}\n style={{\n fill: styles?.fill ? styles.fill : theme.palette.background.paper,\n stroke: styles?.stroke ? styles.stroke : theme.palette.primary.main,\n strokeWidth: 2,\n transform: `translate(${props.x}px, ${props.y}px)`,\n transformOrigin: `${props.x}px, ${props.y}px`,\n filter: styles?.filter ? styles.filter : 'none',\n }}\n width=\"20px\"\n />\n )}\n </>\n )\n}\n"],"mappings":";;;;;;AAoBA,IAAM,IAAoB,qCACpB,IAAsB,GACtB,IAAoB,IACpB,IAAuB,IAkBhB,IAAA,CAAyC,MAAU;AAC9D,QAAM,IAAQ,EAAS,GACjB,IAAY,EAAM,WAClB,IAAS,EAAM,OACf,IAAkB,GAAQ,iBAC1B,IAAU,OAAO,EAAM,CAAC,GACxB,IAAU,OAAO,EAAM,CAAC,GACxB,IAAY,EAAM,YAAY,WAE9B,IAAkB,EAAM,UAAU,aAClC,IAAmB,EAAM,UAAU,cACnC,IAAmB,EAAM,UAAU,cAEnC,IAAkB,EAAc,EAAM,YAAY,GAAG,IAAI,CAAC,GAC1D,IAAU,EAAM,OAAuB,IAAI,GAC3C,CAAC,GAAW,CAAA,IAAgB,EAAM,SAAS,CAAC,GAG5C,IAAiB,EAAM,uBACzB,EAAe,EAAM,MAAM,EAAM,SAAA,GAAY,EAAM,oBAAoB,IACvE,OAAO,EAAM,MAAM,EAAM,SAAA,CAAU,GACjC,IAAW,IACb,EAAM,WAAW,OAAO,WACxB,EAAM,WAAW,SAAS;AAE9B,EAAA,E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M,EAAM,iBAAiB,EAAM,iBAAiB,EAAM,QAAQ,KAAK;AAAA,IACvE,KAAK;AAAA,IACL,OAAO;AAAA,MACL,UAAU,EAAM,gBAAgB,EAAM,gBAAgB;AAAA,MACtD,GAAG;AAAA,IACL;AAAA,IACA,YAAW;AAAA,IACX,GAAG,EAAK;AAAA,IACR,GAAG,EAAK;AAAA,IAEP,UAAA;AAAA,EACG,CAAA,CACN,EAAA,CAAA,GAEH,EAAM,YACL,gBAAA,EAAC,QAAD;AAAA,IACE,QAAQ,IAAkB,YAAY;AAAA,IACtC,GAAG,IAAY,IAAoB,EAAmB,EAAM,SAAS,QAAA;AAAA,IACrE,QAAO;AAAA,IACP,SAAA,CAAU,MAAU;AAClB,MAAA,IAAkB,GAAO,EAAM,SAAS;AAAA,IAC1C;AAAA,IACA,cAAA,MAAoB;AAClB,MAAA,IAAmB,EAAM,SAAS;AAAA,IACpC;AAAA,IACA,cAAA,MAAoB;AAClB,MAAA,IAAmB;AAAA,IACrB;AAAA,IACA,OAAO;AAAA,MACL,MAAM,GAAQ,OAAO,EAAO,OAAO,EAAM,QAAQ,WAAW;AAAA,MAC5D,QAAQ,GAAQ,SAAS,EAAO,SAAS,EAAM,QAAQ,QAAQ;AAAA,MAC/D,aAAa;AAAA,MACb,WAAW,aAAa,EAAM,CAAA,OAAQ,EAAM,CAAA;AAAA,MAC5C,iBAAiB,GAAG,EAAM,CAAA,OAAQ,EAAM,CAAA;AAAA,MACxC,QAAQ,GAAQ,SAAS,EAAO,SAAS;AAAA,IAC3C;AAAA,IACA,OAAM;AAAA,EACP,CAAA,CAEH,EAAA,CAAA;AAEN"}
1
+ {"version":3,"file":"CustomMark.es.js","names":[],"sources":["../../../../../src/common/components/charts/linechart/CustomMark.tsx"],"sourcesContent":["import React from 'react'\n\nimport { useTheme } from '@mui/material/styles'\nimport useMediaQuery from '@mui/material/useMediaQuery'\n\nimport type { MarkElementProps } from '@mui/x-charts'\n\nimport { MARKER_SHAPE_PATHS } from './utils/markerShapes'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\nimport { mouseOnly } from '../../../utils/MouseOnly'\n\nexport type MarkHandlers = {\n onMarkClick?: (event: React.MouseEvent<SVGPathElement, MouseEvent>, dataIndex: number) => void\n onMouseEnter?: (dataIndex: number) => void\n onMouseLeave?: () => void\n}\n\n// compact: a 10px mark, and a 16px label box that fits its text, 12px above the mark.\n// The first and last label alignment assumes a single series.\nexport type MarkVariant = 'default' | 'compact'\n\nconst COMPACT_MARK_PATH = 'M4,0A4,4,0,1,1,-4,0A4,4,0,1,1,4,0'\nconst COMPACT_MARK_RADIUS = 5\nconst COMPACT_LABEL_GAP = 12\nconst COMPACT_LABEL_HEIGHT = 16\nconst COMPACT_LABEL_PADDING = 2\n\ninterface CustomMarkProps extends MarkElementProps {\n handlers?: MarkHandlers\n showLabel: boolean\n showMark?: boolean\n variant?: MarkVariant\n yData: number[]\n style?: React.CSSProperties & {\n markLabelStyles?: React.CSSProperties\n }\n labelBackgroundColor?: string\n labelFontColor?: string\n labelFontSize?: number\n valueFormatterString?: string\n}\n\nexport const CustomMark: React.FC<CustomMarkProps> = (props) => {\n const theme = useTheme()\n const showLabel = props.showLabel\n const styles = props.style\n const markLabelStyles = styles?.markLabelStyles\n const xNumber = Number(props.x)\n const yNumber = Number(props.y)\n const isCompact = props.variant === 'compact'\n\n const handleMarkClick = props.handlers?.onMarkClick\n const handleMouseEnter = props.handlers?.onMouseEnter\n const handleMouseLeave = props.handlers?.onMouseLeave\n\n const isSmallScreenUp = useMediaQuery(theme.breakpoints.up('sm'))\n const textRef = React.useRef<SVGTextElement>(null)\n const [textWidth, setTextWidth] = React.useState(0)\n\n // Calculate text dimensions for proper background sizing\n const formattedValue = props.valueFormatterString\n ? formatCurrency(props.yData[props.dataIndex], props.valueFormatterString)\n : String(props.yData[props.dataIndex])\n const fontSize = isSmallScreenUp\n ? theme.typography.body2?.fontSize\n : theme.typography.caption?.fontSize\n\n React.useLayoutEffect(() => {\n if (isCompact && showLabel) setTextWidth(textRef.current?.getBBox?.().width ?? 0)\n }, [isCompact, showLabel, formattedValue, fontSize, props.labelFontSize])\n\n let rect = { height: 24, rx: 3, width: 30, x: xNumber - 15, y: yNumber - 30 }\n let text = { x: xNumber, y: yNumber - 16 }\n\n if (isCompact) {\n // The first and last labels line up with the outer edge of their mark, so they stay inside the plot.\n const align =\n props.dataIndex === 0\n ? 'start'\n : props.dataIndex === props.yData.length - 1\n ? 'end'\n : 'middle'\n const width = textWidth + COMPACT_LABEL_PADDING * 2\n const boxX = {\n start: xNumber - COMPACT_MARK_RADIUS,\n middle: xNumber - width / 2,\n end: xNumber + COMPACT_MARK_RADIUS - width,\n }[align]\n const boxBottom = yNumber - COMPACT_MARK_RADIUS - COMPACT_LABEL_GAP\n\n rect = {\n height: COMPACT_LABEL_HEIGHT,\n rx: 2,\n width,\n x: boxX,\n y: boxBottom - COMPACT_LABEL_HEIGHT,\n }\n text = { x: boxX + width / 2, y: boxBottom - COMPACT_LABEL_HEIGHT / 2 }\n }\n\n return (\n <>\n {showLabel && (\n <>\n {props.labelBackgroundColor && (\n <rect\n fill={props.labelBackgroundColor}\n height={rect.height}\n rx={rect.rx}\n width={rect.width}\n x={rect.x}\n y={rect.y}\n />\n )}\n\n <text\n className=\"MuiLineChart-markLabel\"\n dominantBaseline=\"middle\"\n fill={props.labelFontColor ? props.labelFontColor : theme.palette.text.primary}\n ref={textRef}\n style={{\n fontSize: props.labelFontSize ? props.labelFontSize : fontSize,\n ...markLabelStyles,\n }}\n textAnchor=\"middle\"\n x={text.x}\n y={text.y}\n >\n {formattedValue}\n </text>\n </>\n )}\n {props.showMark && (\n <path\n cursor={handleMarkClick ? 'pointer' : 'unset'}\n d={isCompact ? COMPACT_MARK_PATH : MARKER_SHAPE_PATHS[props.shape ?? 'circle']}\n height=\"20px\"\n onClick={(event) => {\n handleMarkClick?.(event, props.dataIndex)\n }}\n onPointerEnter={mouseOnly(() => handleMouseEnter?.(props.dataIndex))}\n onPointerLeave={mouseOnly(() => handleMouseLeave?.())}\n style={{\n fill: styles?.fill ? styles.fill : theme.palette.background.paper,\n stroke: styles?.stroke ? styles.stroke : theme.palette.primary.main,\n strokeWidth: 2,\n transform: `translate(${props.x}px, ${props.y}px)`,\n transformOrigin: `${props.x}px, ${props.y}px`,\n filter: styles?.filter ? styles.filter : 'none',\n }}\n width=\"20px\"\n />\n )}\n </>\n )\n}\n"],"mappings":";;;;;;;AAqBA,IAAM,IAAoB,qCACpB,IAAsB,GACtB,IAAoB,IACpB,IAAuB,IAkBhB,IAAA,CAAyC,MAAU;AAC9D,QAAM,IAAQ,EAAS,GACjB,IAAY,EAAM,WAClB,IAAS,EAAM,OACf,IAAkB,GAAQ,iBAC1B,IAAU,OAAO,EAAM,CAAC,GACxB,IAAU,OAAO,EAAM,CAAC,GACxB,IAAY,EAAM,YAAY,WAE9B,IAAkB,EAAM,UAAU,aAClC,IAAmB,EAAM,UAAU,cACnC,IAAmB,EAAM,UAAU,cAEnC,IAAkB,EAAc,EAAM,YAAY,GAAG,IAAI,CAAC,GAC1D,IAAU,EAAM,OAAuB,IAAI,GAC3C,CAAC,GAAW,CAAA,IAAgB,EAAM,SAAS,CAAC,GAG5C,IAAiB,EAAM,uBACzB,EAAe,EAAM,MAAM,EAAM,SAAA,GAAY,EAAM,oBAAoB,IACvE,OAAO,EAAM,MAAM,EAAM,SAAA,CAAU,GACjC,IAAW,IACb,EAAM,WAAW,OAAO,WACxB,EAAM,WAAW,SAAS;AAE9B,EAAA,EAAM,gBAAA,MAAsB;AAC1B,IAAI,KAAa,KAAW,EAAa,EAAQ,SAAS,UAAU,EAAE,SAAS,CAAC;AAAA,EAClF,GAAG;AAAA,IAAC;AAAA,IAAW;AAAA,IAAW;AAAA,IAAgB;AAAA,IAAU,EAAM;AAAA,EAAa,CAAC;AAExE,MAAI,IAAO;AAAA,IAAE,QAAQ;AAAA,IAAI,IAAI;AAAA,IAAG,OAAO;AAAA,IAAI,GAAG,IAAU;AAAA,IA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,EAAC,QAAD;AAAA,IACE,QAAQ,IAAkB,YAAY;AAAA,IACtC,GAAG,IAAY,IAAoB,EAAmB,EAAM,SAAS,QAAA;AAAA,IACrE,QAAO;AAAA,IACP,SAAA,CAAU,MAAU;AAClB,MAAA,IAAkB,GAAO,EAAM,SAAS;AAAA,IAC1C;AAAA,IACA,gBAAgB,EAAA,MAAgB,IAAmB,EAAM,SAAS,CAAC;AAAA,IACnE,gBAAgB,EAAA,MAAgB,IAAmB,CAAC;AAAA,IACpD,OAAO;AAAA,MACL,MAAM,GAAQ,OAAO,EAAO,OAAO,EAAM,QAAQ,WAAW;AAAA,MAC5D,QAAQ,GAAQ,SAAS,EAAO,SAAS,EAAM,QAAQ,QAAQ;AAAA,MAC/D,aAAa;AAAA,MACb,WAAW,aAAa,EAAM,CAAA,OAAQ,EAAM,CAAA;AAAA,MAC5C,iBAAiB,GAAG,EAAM,CAAA,OAAQ,EAAM,CAAA;AAAA,MACxC,QAAQ,GAAQ,SAAS,EAAO,SAAS;AAAA,IAC3C;AAAA,IACA,OAAM;AAAA,EACP,CAAA,CAEH,EAAA,CAAA;AAEN"}
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare const mouseOnly: (handler: () => void) => (event: React.PointerEvent) => void;
@@ -0,0 +1,8 @@
1
+ var p = (e) => (o) => {
2
+ o.pointerType === "mouse" && e();
3
+ };
4
+ export {
5
+ p as mouseOnly
6
+ };
7
+
8
+ //# sourceMappingURL=MouseOnly.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MouseOnly.es.js","names":[],"sources":["../../../src/common/utils/MouseOnly.ts"],"sourcesContent":["import type React from 'react'\n\n// On iOS, a hover handler that changes the screen cancels the tap's click, so a tapped item\n// would show as hovered but never become selected. Touch and pen (Apple Pencil hits the same\n// problem) skip hover and go straight to click.\nexport const mouseOnly =\n (handler: () => void) =>\n (event: React.PointerEvent): void => {\n if (event.pointerType === 'mouse') handler()\n }\n"],"mappings":"AAKA,IAAa,IAAA,CACV,MAAA,CACA,MAAoC;AACnC,EAAI,EAAM,gBAAgB,WAAS,EAAQ;AAC7C"}
@@ -4,6 +4,8 @@ interface DynamicKeyValue {
4
4
  }
5
5
  export interface GeneralInsightsFeedCopy {
6
6
  decreased_text: string;
7
+ /** "Deposit": the deposit summary drawer's bar legend. */
8
+ deposit?: string;
7
9
  dismiss: string;
8
10
  embedded_description: string;
9
11
  error_heading: string;
@@ -1,26 +1,28 @@
1
- import { useEffect as o, useState as d } from "react";
2
- var u = (e) => {
3
- const [i, s] = d({
1
+ import { useEffect as h, useState as u } from "react";
2
+ var c = (e) => {
3
+ const [o, d] = u({
4
4
  width: 0,
5
5
  height: 0
6
6
  });
7
- return o(() => {
7
+ return h(() => {
8
8
  const t = () => {
9
9
  if (e.current) {
10
10
  const { offsetWidth: n, offsetHeight: r } = e.current;
11
- s({
11
+ d((s) => s.width === n && s.height === r ? s : {
12
12
  width: n,
13
13
  height: r
14
14
  });
15
15
  }
16
16
  };
17
- return t(), window.addEventListener("resize", t), () => {
18
- window.removeEventListener("resize", t);
17
+ t(), window.addEventListener("resize", t);
18
+ const i = typeof ResizeObserver < "u" ? new ResizeObserver(t) : void 0;
19
+ return e.current && i?.observe(e.current), () => {
20
+ window.removeEventListener("resize", t), i?.disconnect();
19
21
  };
20
- }, [e]), i;
22
+ }, [e]), o;
21
23
  };
22
24
  export {
23
- u as useContainerDimensions
25
+ c as useContainerDimensions
24
26
  };
25
27
 
26
28
  //# sourceMappingURL=useContainerDimensions.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useContainerDimensions.es.js","names":[],"sources":["../../../src/insights/hooks/useContainerDimensions.ts"],"sourcesContent":["import React, { useEffect, useState } from 'react'\n\nexport const useContainerDimensions = (containerRef: React.RefObject<HTMLDivElement | null>) => {\n const [dimensions, setDimensions] = useState({ width: 0, height: 0 })\n\n useEffect(() => {\n const updateDimensions = () => {\n if (containerRef.current) {\n const { offsetWidth, offsetHeight } = containerRef.current\n setDimensions({ width: offsetWidth, height: offsetHeight })\n }\n }\n\n updateDimensions()\n window.addEventListener('resize', updateDimensions)\n\n return () => {\n window.removeEventListener('resize', updateDimensions)\n }\n }, [containerRef])\n\n return dimensions\n}\n"],"mappings":";AAEA,IAAa,IAAA,CAA0B,MAAyD;AAC9F,QAAM,CAAC,GAAY,CAAA,IAAiB,EAAS;AAAA,IAAE,OAAO;AAAA,IAAG,QAAQ;AAAA,EAAE,CAAC;AAEpE,SAAA,EAAA,MAAgB;AACd,UAAM,IAAA,MAAyB;AAC7B,UAAI,EAAa,SAAS;AACxB,cAAM,EAAE,aAAA,GAAa,cAAA,EAAA,IAAiB,EAAa;AACnD,QAAA,EAAc;AAAA,UAAE,OAAO;AAAA,UAAa,QAAQ;AAAA,QAAa,CAAC;AAAA,MAC5D;AAAA,IACF;AAEA,WAAA,EAAiB,GACjB,OAAO,iBAAiB,UAAU,CAAgB,GAElD,MAAa;AACX,aAAO,oBAAoB,UAAU,CAAgB;AAAA,IACvD;AAAA,EACF,GAAG,CAAC,CAAY,CAAC,GAEV;AACT"}
1
+ {"version":3,"file":"useContainerDimensions.es.js","names":[],"sources":["../../../src/insights/hooks/useContainerDimensions.ts"],"sourcesContent":["import React, { useEffect, useState } from 'react'\n\nexport const useContainerDimensions = (containerRef: React.RefObject<HTMLDivElement | null>) => {\n const [dimensions, setDimensions] = useState({ width: 0, height: 0 })\n\n useEffect(() => {\n const updateDimensions = () => {\n if (containerRef.current) {\n const { offsetWidth, offsetHeight } = containerRef.current\n // Same size → same object, so a resize tick that changes nothing doesn't re-render.\n setDimensions((prev) =>\n prev.width === offsetWidth && prev.height === offsetHeight\n ? prev\n : { width: offsetWidth, height: offsetHeight },\n )\n }\n }\n\n updateDimensions()\n window.addEventListener('resize', updateDimensions)\n // The container can resize without the window (a card narrowed after mount); without this a\n // chart keeps its first width and overflows the card.\n const observer =\n typeof ResizeObserver !== 'undefined' ? new ResizeObserver(updateDimensions) : undefined\n if (containerRef.current) observer?.observe(containerRef.current)\n\n return () => {\n window.removeEventListener('resize', updateDimensions)\n observer?.disconnect()\n }\n }, [containerRef])\n\n return dimensions\n}\n"],"mappings":";AAEA,IAAa,IAAA,CAA0B,MAAyD;AAC9F,QAAM,CAAC,GAAY,CAAA,IAAiB,EAAS;AAAA,IAAE,OAAO;AAAA,IAAG,QAAQ;AAAA,EAAE,CAAC;AAEpE,SAAA,EAAA,MAAgB;AACd,UAAM,IAAA,MAAyB;AAC7B,UAAI,EAAa,SAAS;AACxB,cAAM,EAAE,aAAA,GAAa,cAAA,EAAA,IAAiB,EAAa;AAEnD,QAAA,EAAA,CAAe,MACb,EAAK,UAAU,KAAe,EAAK,WAAW,IAC1C,IACA;AAAA,UAAE,OAAO;AAAA,UAAa,QAAQ;AAAA,QAAa,CACjD;AAAA,MACF;AAAA,IACF;AAEA,IAAA,EAAiB,GACjB,OAAO,iBAAiB,UAAU,CAAgB;AAGlD,UAAM,IACJ,OAAO,iBAAmB,MAAc,IAAI,eAAe,CAAgB,IAAI;AACjF,WAAI,EAAa,WAAS,GAAU,QAAQ,EAAa,OAAO,GAEhE,MAAa;AACX,aAAO,oBAAoB,UAAU,CAAgB,GACrD,GAAU,WAAW;AAAA,IACvB;AAAA,EACF,GAAG,CAAC,CAAY,CAAC,GAEV;AACT"}
@@ -1,36 +1,36 @@
1
- import { useGlobalCopyStore as Ct, useInsightsV2Store as yt } from "../../../common/context/hooks.es.js";
2
- import { CURRENCY_FORMAT as _t, formatCurrency as Tt } from "../../../core/utils/NumberFormatting.es.js";
3
- import At from "../../../common/components/drawer/Drawer.es.js";
4
- import { BAR_ARIA_LABEL as Dt } from "../../blocks/ChartBlocks/BarchartBlock/utils.es.js";
5
- import { BarChartV2 as St } from "../../components/chartblocks/BarchartV2.es.js";
6
- import { EmptyBarChart as vt } from "../../components/chartblocks/EmptyBarChart.es.js";
7
- import { ANALYTICS_EVENTS_CONFIG as M } from "../../analytics/analyticsEventsConfig.es.js";
8
- import { useAnalyticsEvent as Bt } from "../../analytics/useAnalyticsEvent.es.js";
9
- import { DoubleBarChart as Lt } from "../../components/chartblocks/DoubleBarChart.es.js";
10
- import { toLegendItems as It } from "../../blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils.es.js";
11
- import { getDefaultSelection as Et, getDrillDownConfig as Rt, getFlattenedDataSeries as xt, resolveDrillDownSubHeader as Ft, toStoreFilter as Ot } from "./utils.es.js";
12
- import { useOpenedCta as Gt } from "../useOpenedCta.es.js";
13
- import { TransactionDrillDown as Ht } from "./TransactionDrillDown.es.js";
14
- import { useTransactionHistory as wt } from "./useTransactionHistory.es.js";
15
- import { TransactionDetailsBlock as Nt } from "../TransactionDetailsBlock/TransactionDetailsBlock.es.js";
16
- import { useRequiredCopy as jt } from "../useRequiredCopy.es.js";
17
- import { useLayoutEffect as kt, useState as d } from "react";
18
- import { observer as Mt } from "mobx-react-lite";
19
- import { Fragment as Kt, jsx as l, jsxs as Vt } from "react/jsx-runtime";
20
- import { useTheme as Pt } from "@mui/material/styles";
21
- var zt = (a) => a.insights_feed, ge = Mt(({ beat: a, cta: K }) => {
22
- const _ = Pt(), { actionDrawer: V, setActionContext: T } = yt(), { insights_payload: A } = a, P = Gt(a), D = K ?? P, z = D?.variant, { top: e, filterMode: m, header: Y, colors: q, filterStrategy: U, tipSection: S, subTabAriaLabels: W, slotData: $, averageFormat: J, subTabs: Q, boldLabel: X } = Rt(z ?? ""), { instanceSlotData: o, beatTransactions: u, spendCategoryGuids: v, allAccountGuids: B, categoryName: Z, displayedDateRange: h, transactionStore: tt } = wt(a, { slotData: $ }, D?.drilldown_data), { common: et } = Ct(), n = jt(zt), [ot, L] = d(!1), [at, nt] = d(!1), I = Bt(), { dataSeries: g, chartData: p, comparisonBars: s } = xt({
1
+ import { useGlobalCopyStore as _t, useInsightsV2Store as Tt } from "../../../common/context/hooks.es.js";
2
+ import { CURRENCY_FORMAT as At, formatCurrency as Dt } from "../../../core/utils/NumberFormatting.es.js";
3
+ import Lt from "../../../common/components/drawer/Drawer.es.js";
4
+ import { BAR_ARIA_LABEL as St } from "../../blocks/ChartBlocks/BarchartBlock/utils.es.js";
5
+ import { BarChartV2 as vt } from "../../components/chartblocks/BarchartV2.es.js";
6
+ import { EmptyBarChart as Bt } from "../../components/chartblocks/EmptyBarChart.es.js";
7
+ import { ANALYTICS_EVENTS_CONFIG as k } from "../../analytics/analyticsEventsConfig.es.js";
8
+ import { useAnalyticsEvent as It } from "../../analytics/useAnalyticsEvent.es.js";
9
+ import { DoubleBarChart as Et } from "../../components/chartblocks/DoubleBarChart.es.js";
10
+ import { toLegendItems as Rt } from "../../blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils.es.js";
11
+ import { getDefaultSelection as xt, getDrillDownConfig as Ft, getFlattenedDataSeries as Ot, resolveDrillDownSubHeader as wt, toStoreFilter as Gt } from "./utils.es.js";
12
+ import { useOpenedCta as Ht } from "../useOpenedCta.es.js";
13
+ import { TransactionDrillDown as Mt } from "./TransactionDrillDown.es.js";
14
+ import { useTransactionHistory as Nt } from "./useTransactionHistory.es.js";
15
+ import { TransactionDetailsBlock as jt } from "../TransactionDetailsBlock/TransactionDetailsBlock.es.js";
16
+ import { useRequiredCopy as kt } from "../useRequiredCopy.es.js";
17
+ import { useLayoutEffect as Vt, useState as d } from "react";
18
+ import { observer as Kt } from "mobx-react-lite";
19
+ import { Fragment as Pt, jsx as l, jsxs as zt } from "react/jsx-runtime";
20
+ import { useTheme as Yt } from "@mui/material/styles";
21
+ var qt = (a) => a.insights_feed, be = Kt(({ beat: a, cta: V }) => {
22
+ const _ = Yt(), { actionDrawer: K, setActionContext: T } = Tt(), { insights_payload: A } = a, P = Ht(a), D = V ?? P, z = D?.variant, { top: e, filterMode: m, header: Y, colors: q, filterStrategy: U, tipSection: L, subTabAriaLabels: W, slotData: $, averageFormat: J, subTabs: Q, boldLabel: X, barLegendLabel: Z, showMonthlyAmount: tt } = Ft(z ?? ""), { instanceSlotData: o, beatTransactions: u, spendCategoryGuids: S, allAccountGuids: v, categoryName: et, displayedDateRange: f, transactionStore: ot } = Nt(a, { slotData: $ }, D?.drilldown_data), { common: at } = _t(), n = kt(qt), [nt, B] = d(!1), [rt, st] = d(!1), I = It(), { dataSeries: g, chartData: p, comparisonBars: s } = Ot({
23
23
  data: o?.data_series,
24
- ariaLabel: e === "doubleBar" ? n?.general?.in_month_you_had_a_category_of_amount ?? "_1{month}, _2{category}: _3{amount}" : Dt,
24
+ ariaLabel: e === "doubleBar" ? n?.general?.in_month_you_had_a_category_of_amount ?? "_1{month}, _2{category}: _3{amount}" : St,
25
25
  top: e,
26
26
  beatTransactions: u
27
- }), c = e === "doubleBar", rt = e === "tabsOnly", i = c ? s : p, { chartBarIndex: E, subTabIndex: st } = Et({
27
+ }), c = e === "doubleBar", it = e === "tabsOnly", i = c ? s : p, { chartBarIndex: E, subTabIndex: lt } = xt({
28
28
  chartTabCount: p.length,
29
29
  comparisonTabCount: s.length,
30
- actionDrawer: V,
30
+ actionDrawer: K,
31
31
  beatGuid: a.guid
32
- }), [r, C] = d(E), [y, R] = d(st), [it, lt] = d(i.length);
33
- i.length !== it && (lt(i.length), C(E));
32
+ }), [r, C] = d(E), [y, R] = d(lt), [ct, dt] = d(i.length);
33
+ i.length !== ct && (dt(i.length), C(E));
34
34
  const x = (t) => U({
35
35
  beat: a,
36
36
  beatTransactions: u,
@@ -40,20 +40,20 @@ var zt = (a) => a.insights_feed, ge = Mt(({ beat: a, cta: K }) => {
40
40
  subIndex: y,
41
41
  isLastTab: t === i.length - 1,
42
42
  instanceSlotData: o,
43
- spendCategoryGuids: v,
44
- displayedDateRange: h
45
- }), ct = u.map((t) => t.guid).join(","), dt = v.join(","), mt = B.join(","), ut = e === "list" || e === "tabsOnly" || e === "monthTabs" || g.length > 0, F = () => {
43
+ spendCategoryGuids: S,
44
+ displayedDateRange: f
45
+ }), mt = u.map((t) => t.guid).join(","), ut = S.join(","), gt = v.join(","), pt = e === "list" || e === "tabsOnly" || e === "monthTabs" || g.length > 0, F = () => {
46
46
  if (m !== "store") return;
47
- const t = ut ? x(r) : {
47
+ const t = pt ? x(r) : {
48
48
  accounts: [],
49
49
  custom: () => !1
50
50
  };
51
- tt.setFilter(Ot(t, {
52
- allAccountGuids: B,
53
- displayedDateRange: h
51
+ ot.setFilter(Gt(t, {
52
+ allAccountGuids: v,
53
+ displayedDateRange: f
54
54
  }));
55
55
  };
56
- kt(() => {
56
+ Vt(() => {
57
57
  F();
58
58
  }, [
59
59
  a.guid,
@@ -62,49 +62,50 @@ var zt = (a) => a.insights_feed, ge = Mt(({ beat: a, cta: K }) => {
62
62
  m,
63
63
  g.length,
64
64
  o,
65
- h,
66
- dt,
65
+ f,
66
+ ut,
67
+ gt,
67
68
  mt,
68
- ct,
69
69
  e
70
70
  ]);
71
- const O = Ft(A), b = Y?.({
71
+ const O = wt(A), b = Y?.({
72
72
  title: A?.title,
73
73
  subHeader: O,
74
- categoryName: Z,
74
+ categoryName: et,
75
75
  selectedDate: p[r]?.date ?? void 0,
76
76
  slotData: o,
77
77
  copy: n
78
- }), G = q(_, o?.category_guid), [H, w] = o?.legends ?? [], gt = m === "local" ? (t) => x(t).custom ?? (() => !0) : void 0, pt = m === "local" ? u : void 0, N = (t, f) => {
79
- I(M.DRAWER_CHART_BAR_CLICKED), C(t), f !== void 0 && R(f);
80
- }, bt = (t) => {
81
- I(M.TAB_SELECTED), C(t);
82
- }, j = c ? It([{
83
- ...H,
78
+ }), w = q(_, o?.category_guid), [G, H] = o?.legends ?? [], bt = m === "local" ? (t) => x(t).custom ?? (() => !0) : void 0, ht = m === "local" ? u : void 0, M = (t, h) => {
79
+ I(k.DRAWER_CHART_BAR_CLICKED), C(t), h !== void 0 && R(h);
80
+ }, ft = (t) => {
81
+ I(k.TAB_SELECTED), C(t);
82
+ }, N = c ? Rt([{
83
+ ...G,
84
84
  value: s[r]?.main
85
85
  }, {
86
- ...w,
86
+ ...H,
87
87
  value: s[r]?.comparison
88
- }]) : void 0, ft = W?.(n) ?? [], k = c ? (j ?? []).map((t, f) => ({
88
+ }]) : void 0, Ct = W?.(n) ?? [], j = c ? (N ?? []).map((t, h) => ({
89
89
  label: t.label,
90
- ariaLabel: ft[f]
91
- })) : rt ? g.flatMap((t) => t.localized_label ? [{ label: t.localized_label }] : []) : Q?.({
90
+ ariaLabel: Ct[h]
91
+ })) : it ? g.flatMap((t) => t.localized_label ? [{ label: t.localized_label }] : []) : Q?.({
92
92
  instanceSlotData: o,
93
93
  copy: n
94
- }).map((t) => ({ label: t })) ?? [], ht = c || e === "singleBar" || e === "upcomingBill" ? i.length ? c ? /* @__PURE__ */ l(Lt, {
94
+ }).map((t) => ({ label: t })) ?? [], yt = c || e === "singleBar" || e === "upcomingBill" ? i.length ? c ? /* @__PURE__ */ l(Et, {
95
95
  bars: s,
96
96
  boldLabel: X,
97
- colors: G,
97
+ colors: w,
98
98
  legendPosition: "top",
99
- legends: j,
100
- onBarClick: N,
99
+ legendVariant: "body2",
100
+ legends: N,
101
+ onBarClick: M,
101
102
  selectedIndex: r
102
- }) : /* @__PURE__ */ l(St, {
103
+ }) : /* @__PURE__ */ l(vt, {
103
104
  amounts: {
104
105
  average: o?.average_amount,
105
- formattedAverage: Tt(o?.average_amount ?? 0, J ?? _t.cents)
106
+ formattedAverage: Dt(o?.average_amount ?? 0, J ?? At.cents)
106
107
  },
107
- color: G[0] ?? _.palette.primary.main,
108
+ color: w[0] ?? _.palette.primary.main,
108
109
  data: p,
109
110
  legendPosition: "top",
110
111
  heightOverride: 172,
@@ -114,44 +115,45 @@ var zt = (a) => a.insights_feed, ge = Mt(({ beat: a, cta: K }) => {
114
115
  left: 24,
115
116
  right: 24
116
117
  },
117
- monthlyAmountLabel: H?.label ?? n.general.monthly_amount,
118
- onBarClick: N,
118
+ monthlyAmountLabel: Z?.(n) ?? G?.label ?? n.general.monthly_amount,
119
+ onBarClick: M,
119
120
  selectedTabIndex: r,
120
- trendAmountLabel: w?.label ?? n.general.trend
121
- }) : /* @__PURE__ */ l(vt, {}) : null;
122
- return /* @__PURE__ */ Vt(Kt, { children: [/* @__PURE__ */ l(Ht, {
123
- baseTransactions: pt,
121
+ showMonthlyAmount: tt,
122
+ trendAmountLabel: H?.label ?? n.general.trend
123
+ }) : /* @__PURE__ */ l(Bt, {}) : null;
124
+ return /* @__PURE__ */ zt(Pt, { children: [/* @__PURE__ */ l(Mt, {
125
+ baseTransactions: ht,
124
126
  heading: b?.heading,
125
127
  icon: b?.icon,
126
128
  logo: b?.logo,
127
- onSelectionChange: bt,
129
+ onSelectionChange: ft,
128
130
  selectedIndex: r,
129
131
  subHeadingText: b?.subHeadingText,
130
132
  tabs: i,
131
- top: ht,
132
- ...k.length > 0 && { subTabs: {
133
- tabs: k,
133
+ top: yt,
134
+ ...j.length > 0 && { subTabs: {
135
+ tabs: j,
134
136
  selectedIndex: y,
135
137
  onChange: R
136
138
  } },
137
- ...S && { tipSection: !at && (S(nt, n, O?.text, o) ?? !1) },
138
- transactionFilter: gt,
139
+ ...L && { tipSection: !rt && (L(st, n, O?.text, o) ?? !1) },
140
+ transactionFilter: bt,
139
141
  onEachRowClick: (t) => {
140
- T({ transaction_guid: t }), L(!0);
142
+ T({ transaction_guid: t }), B(!0);
141
143
  }
142
- }), /* @__PURE__ */ l(At, {
143
- ariaLabelClose: et.close_aria,
144
- isOpen: ot,
144
+ }), /* @__PURE__ */ l(Lt, {
145
+ ariaLabelClose: at.close_aria,
146
+ isOpen: nt,
145
147
  onClose: () => {
146
- L(!1), T({ transaction_guid: void 0 }), F();
148
+ B(!1), T({ transaction_guid: void 0 }), F();
147
149
  },
148
150
  title: n.general.transaction_details_title,
149
- children: /* @__PURE__ */ l(Nt, { beat: a })
151
+ children: /* @__PURE__ */ l(jt, { beat: a })
150
152
  })] });
151
153
  });
152
154
  export {
153
- ge as TransactionHistoryBlock,
154
- zt as selectTransactionHistoryCopy
155
+ be as TransactionHistoryBlock,
156
+ qt as selectTransactionHistoryCopy
155
157
  };
156
158
 
157
159
  //# sourceMappingURL=TransactionHistoryBlock.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TransactionHistoryBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.tsx"],"sourcesContent":["import { useLayoutEffect, useState } from 'react'\n\nimport { useTheme } from '@mui/material/styles'\nimport { observer } from 'mobx-react-lite'\n\nimport type { Beat, DataSeries, GlobalCopy, Transaction } from '../../../core'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { ANALYTICS_EVENTS_CONFIG, useAnalyticsEvent } from '../../analytics'\nimport { BarChartV2 } from '../../components/chartblocks/BarchartV2'\nimport { DoubleBarChart } from '../../components/chartblocks/DoubleBarChart'\nimport { EmptyBarChart } from '../../components/chartblocks/EmptyBarChart'\nimport { BAR_ARIA_LABEL } from '../../blocks/ChartBlocks/BarchartBlock/utils'\nimport {\n COMPARISON_BAR_ARIA_LABEL,\n toLegendItems,\n} from '../../blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils'\n\nimport { TransactionDrillDown } from './TransactionDrillDown'\nimport { useTransactionHistory } from './useTransactionHistory'\nimport {\n getDefaultSelection,\n getDrillDownConfig,\n getFlattenedDataSeries,\n resolveDrillDownSubHeader,\n toStoreFilter,\n} from './utils'\nimport { Drawer, useInsightsV2Store, useGlobalCopyStore } from '../../../common'\nimport { TransactionDetailsBlock } from '../TransactionDetailsBlock'\nimport { useOpenedCta } from '../useOpenedCta'\nimport type { OpenedCta } from '../util'\nimport { useRequiredCopy } from '../useRequiredCopy'\n\ninterface TransactionHistoryProp {\n beat: Beat\n /**\n * The CTA to draw, for a drawer nested inside another block's drawer (Top Merchants → Merchant\n * History). Absent: the CTA that opened the beat's drawer.\n */\n cta?: OpenedCta\n}\n\nexport const selectTransactionHistoryCopy = (copy: GlobalCopy) => copy.insights_feed\n\nexport const TransactionHistoryBlock = observer(({ beat, cta }: TransactionHistoryProp) => {\n const theme = useTheme()\n\n const { actionDrawer, setActionContext } = useInsightsV2Store()\n\n const { insights_payload } = beat\n\n // The CTA that opened the drawer: its variant picks the view, and its drilldown_data feeds a\n // variant that reads its facts from the opener (Monthly Debt to Income). Only drilldown_data is passed\n // on: it is the payload's own object, stable across renders, while the opener may be rebuilt per render.\n const drawerCta = useOpenedCta(beat)\n const openedCta = cta ?? drawerCta\n const dynamicCtaVariant = openedCta?.variant\n\n const {\n top,\n filterMode,\n header,\n colors,\n filterStrategy,\n tipSection,\n subTabAriaLabels,\n slotData,\n averageFormat,\n subTabs,\n boldLabel,\n } = getDrillDownConfig(dynamicCtaVariant ?? '')\n\n const {\n instanceSlotData,\n beatTransactions,\n spendCategoryGuids,\n allAccountGuids,\n categoryName,\n displayedDateRange,\n transactionStore,\n } = useTransactionHistory(beat, { slotData }, openedCta?.drilldown_data)\n\n const { common: commonCopy } = useGlobalCopyStore()\n const insightsCopy = useRequiredCopy(selectTransactionHistoryCopy)\n\n const [isTransactionDetailsOpen, setIsTransactionDetailsOpen] = useState(false)\n\n const [closeTipSection, setCloseTipSection] = useState(false)\n\n const fireAnalyticsEvent = useAnalyticsEvent()\n\n const { dataSeries, chartData, comparisonBars } = getFlattenedDataSeries({\n data: instanceSlotData?.data_series as DataSeries,\n ariaLabel:\n top === 'doubleBar'\n ? (insightsCopy?.general?.in_month_you_had_a_category_of_amount ??\n COMPARISON_BAR_ARIA_LABEL)\n : BAR_ARIA_LABEL,\n top,\n beatTransactions,\n })\n\n const isDoubleBar = top === 'doubleBar'\n const isTabsOnly = top === 'tabsOnly'\n // The drawer's columns (and tabs): the double bar's month pairs, or the single bar's bars.\n const bars = isDoubleBar ? comparisonBars : chartData\n\n const { chartBarIndex, subTabIndex } = getDefaultSelection({\n chartTabCount: chartData.length,\n comparisonTabCount: comparisonBars.length,\n actionDrawer,\n beatGuid: beat.guid,\n })\n\n const [selectedIndex, setSelectedIndex] = useState(chartBarIndex)\n // The double-bar drawer's series tab (0 = main, e.g. Spend; 1 = comparison, e.g. Income).\n const [subIndex, setSubIndex] = useState(subTabIndex)\n\n // Bars built from the transaction store (Upcoming Bill's paid bills) can arrive after the drawer\n // opens: re-select the default when the bar count changes. Payload-built bars never change count.\n const [defaultedTabCount, setDefaultedTabCount] = useState(bars.length)\n if (bars.length !== defaultedTabCount) {\n setDefaultedTabCount(bars.length)\n setSelectedIndex(chartBarIndex)\n }\n\n const resolveFilter = (index: number) =>\n filterStrategy({\n beat,\n beatTransactions,\n dataSeries,\n comparisonBars,\n selectedIndex: index,\n subIndex,\n isLastTab: index === bars.length - 1,\n instanceSlotData,\n spendCategoryGuids,\n displayedDateRange,\n })\n\n // Content keys for the effect deps: these arrays get a new identity every render (MEW-3732).\n const beatTransactionGuidsKey = beatTransactions.map((transaction) => transaction.guid).join(',')\n const spendCategoryGuidsKey = spendCategoryGuids.join(',')\n const allAccountGuidsKey = allAccountGuids.join(',')\n\n // Re-applied on selection change and when the nested details drawer closes: AddMerchantBudgetAction\n // overwrites transactionStore.filter and never restores it. Chartless tops filter with no bars.\n const canApplyFilter =\n top === 'list' || top === 'tabsOnly' || top === 'monthTabs' || dataSeries.length > 0\n const applyCurrentSelectionFilter = () => {\n if (filterMode !== 'store') return\n // A chart drawer with no bars can name no rows: fail closed rather than keep the store's default\n // (every account) or a previous drawer's filter.\n const filter = canApplyFilter\n ? resolveFilter(selectedIndex)\n : { accounts: [], custom: () => false }\n transactionStore.setFilter(toStoreFilter(filter, { allAccountGuids, displayedDateRange }))\n }\n\n // store variants route the selection through the shared store filter; local (upcomingBill) variants\n // filter beatTransactions directly, so there's nothing to push to the store for them.\n useLayoutEffect(() => {\n applyCurrentSelectionFilter()\n }, [\n beat.guid,\n selectedIndex,\n subIndex,\n filterMode,\n dataSeries.length,\n instanceSlotData,\n displayedDateRange,\n spendCategoryGuidsKey,\n allAccountGuidsKey,\n beatTransactionGuidsKey,\n top,\n ])\n\n const subHeader = resolveDrillDownSubHeader(insights_payload)\n\n const headerContent = header?.({\n title: insights_payload?.title,\n subHeader,\n categoryName,\n selectedDate: chartData[selectedIndex]?.date ?? undefined,\n slotData: instanceSlotData,\n copy: insightsCopy,\n })\n\n const barColors = colors(theme, instanceSlotData?.category_guid)\n\n // `legends` is the block's additional_data ([0] main, [1] second series), as BarchartBlock reads it.\n const [mainLegend, comparisonLegend] = instanceSlotData?.legends ?? []\n\n const transactionFilter =\n filterMode === 'local'\n ? (index: number) => resolveFilter(index).custom ?? (() => true)\n : undefined\n\n const baseTransactions: Transaction[] | undefined =\n filterMode === 'local' ? beatTransactions : undefined\n\n // A chart bar click selects its column (and, on the double bar, its series); a month tab change\n // selects the month. MUI Tabs only fires onChange on real user selection, not on mount. The\n // series (Spend / Income) tab fires its own analytics via the shared SubTabs component.\n const selectBar = (index: number, seriesIndex?: number) => {\n fireAnalyticsEvent(ANALYTICS_EVENTS_CONFIG.DRAWER_CHART_BAR_CLICKED)\n setSelectedIndex(index)\n if (seriesIndex !== undefined) setSubIndex(seriesIndex)\n }\n const selectMonth = (index: number) => {\n fireAnalyticsEvent(ANALYTICS_EVENTS_CONFIG.TAB_SELECTED)\n setSelectedIndex(index)\n }\n\n // Double bar: the Spend / Income labels come from copy (additional_data); the legend carries the\n // selected month's two totals, and its labels name the series tabs.\n const doubleBarLegends = isDoubleBar\n ? toLegendItems([\n { ...mainLegend, value: comparisonBars[selectedIndex]?.main },\n { ...comparisonLegend, value: comparisonBars[selectedIndex]?.comparison },\n ])\n : undefined\n\n // Legacy pulse named these tabs \"Spend transactions\" / \"Income transactions\" for screen readers.\n const seriesAriaLabels = subTabAriaLabels?.(insightsCopy) ?? []\n\n // The second tab row: the double bar's series, a tabs-only drawer's sides, or the variant's `subTabs`.\n const sideTabs = isDoubleBar\n ? (doubleBarLegends ?? []).map((legend, index) => ({\n label: legend.label,\n ariaLabel: seriesAriaLabels[index],\n }))\n : isTabsOnly\n ? dataSeries.flatMap((row) => (row.localized_label ? [{ label: row.localized_label }] : []))\n : (subTabs?.({ instanceSlotData, copy: insightsCopy }).map((label) => ({ label })) ?? [])\n\n const renderChart = () => {\n if (!bars.length) return <EmptyBarChart />\n\n return isDoubleBar ? (\n <DoubleBarChart\n bars={comparisonBars}\n boldLabel={boldLabel}\n colors={barColors}\n legendPosition=\"top\"\n legends={doubleBarLegends}\n onBarClick={selectBar}\n selectedIndex={selectedIndex}\n />\n ) : (\n <BarChartV2\n amounts={{\n average: instanceSlotData?.average_amount,\n formattedAverage: formatCurrency(\n instanceSlotData?.average_amount ?? 0,\n averageFormat ?? CURRENCY_FORMAT.cents,\n ),\n }}\n color={barColors[0] ?? theme.palette.primary.main}\n data={chartData}\n legendPosition=\"top\"\n // Figma's chart drawer: 172px of bars under the 24px legend, 200px in all.\n heightOverride={172}\n margin={{\n bottom: 8,\n top: 24,\n left: 24,\n right: 24,\n }}\n // TODO: Temporary fallback while the backend doesn't always send `legends` on every\n // beat/variant. Remove this once the backend guarantees `legends` on the payload.\n monthlyAmountLabel={mainLegend?.label ?? insightsCopy.general.monthly_amount}\n onBarClick={selectBar}\n selectedTabIndex={selectedIndex}\n trendAmountLabel={comparisonLegend?.label ?? insightsCopy.general.trend}\n />\n )\n }\n\n // `list` (Low Account Balance), `tabsOnly` (Non-Essential Category Summary) and `monthTabs`\n // (Monthly Subscription Aggregate) drawers have no chart above their transaction list.\n const chartTop =\n isDoubleBar || top === 'singleBar' || top === 'upcomingBill' ? renderChart() : null\n\n return (\n <>\n <TransactionDrillDown\n baseTransactions={baseTransactions}\n heading={headerContent?.heading}\n icon={headerContent?.icon}\n logo={headerContent?.logo}\n onSelectionChange={selectMonth}\n selectedIndex={selectedIndex}\n subHeadingText={headerContent?.subHeadingText}\n tabs={bars}\n top={chartTop}\n {...(sideTabs.length > 0 && {\n subTabs: { tabs: sideTabs, selectedIndex: subIndex, onChange: setSubIndex },\n })}\n {...(tipSection && {\n tipSection:\n !closeTipSection &&\n (tipSection(setCloseTipSection, insightsCopy, subHeader?.text, instanceSlotData) ??\n false),\n })}\n transactionFilter={transactionFilter}\n onEachRowClick={(guid) => {\n setActionContext({ transaction_guid: guid })\n setIsTransactionDetailsOpen(true)\n }}\n />\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={isTransactionDetailsOpen}\n onClose={() => {\n setIsTransactionDetailsOpen(false)\n // Clear only the key this nested drawer owns — setActionContext merges, so an\n // explicit `{}` would be a no-op and leave transaction_guid stuck in the shared\n // context, and the outer drawer's own context (e.g. chartBarIndex) must survive.\n setActionContext({ transaction_guid: undefined })\n // Re-apply this block's own filter: a further-nested AddMerchantBudgetAction drawer may\n // have overwritten transactionStore.filter (merchant_guid-only) without restoring it.\n applyCurrentSelectionFilter()\n }}\n title={insightsCopy.general.transaction_details_title}\n >\n <TransactionDetailsBlock beat={beat} />\n </Drawer>\n </>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyCA,IAAa,KAAA,CAAgC,MAAqB,EAAK,eAE1D,KAA0B,GAAA,CAAU,EAAE,MAAA,GAAM,KAAA,EAAA,MAAkC;AACzF,QAAM,IAAQ,GAAS,GAEjB,EAAE,cAAA,GAAc,kBAAA,EAAA,IAAqB,GAAmB,GAExD,EAAE,kBAAA,EAAA,IAAqB,GAKvB,IAAY,GAAa,CAAI,GAC7B,IAAY,KAAO,GACnB,IAAoB,GAAW,SAE/B,EACJ,KAAA,GACA,YAAA,GACA,QAAA,GACA,QAAA,GACA,gBAAA,GACA,YAAA,GACA,kBAAA,GACA,UAAA,GACA,eAAA,GACA,SAAA,GACA,WAAA,EAAA,IACE,GAAmB,KAAqB,EAAE,GAExC,EACJ,kBAAA,GACA,kBAAA,GACA,oBAAA,GACA,iBAAA,GACA,cAAA,GACA,oBAAA,GACA,kBAAA,GAAA,IACE,GAAsB,GAAM,EAAE,UAAA,EAAS,GAAG,GAAW,cAAc,GAEjE,EAAE,QAAQ,GAAA,IAAe,GAAmB,GAC5C,IAAe,GAAgB,EAA4B,GAE3D,CAAC,IAA0B,CAAA,IAA+B,EAAS,EAAK,GAExE,CAAC,IAAiB,EAAA,IAAsB,EA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,GAAe;AAAA,IACxB,MAAM,GAAe;AAAA,IACrB,MAAM,GAAe;AAAA,IACrB,mBAAmB;AAAA,IACJ,eAAA;AAAA,IACf,gBAAgB,GAAe;AAAA,IAC/B,MAAM;AAAA,IACN,KAAK;AAAA,IACL,GAAK,EAAS,SAAS,KAAK,EAC1B,SAAS;AAAA,MAAE,MAAM;AAAA,MAAU,eAAe;AAAA,MAAU,UAAU;AAAA,IAAY,EAC5E;AAAA,IACA,GAAK,KAAc,EACjB,YACE,CAAC,OACA,EAAW,IAAoB,GAAc,GAAW,MAAM,CAAgB,KAC7E,IACN;AAAA,IACmB,mBAAA;AAAA,IACnB,gBAAA,CAAiB,MAAS;AACxB,MAAA,EAAiB,EAAE,kBAAkB,EAAK,CAAC,GAC3C,EAA4B,EAAI;AAAA,IAClC;AAAA,EACD,CAAA,GACD,gBAAA,EAAC,IAAD;AAAA,IACE,gBAAgB,GAAW;AAAA,IAC3B,QAAQ;AAAA,IACR,SAAA,MAAe;AACb,MAAA,EAA4B,EAAK,GAIjC,EAAiB,EAAE,kBAAkB,OAAU,CAAC,GAGhD,EAA4B;AAAA,IAC9B;AAAA,IACA,OAAO,EAAa,QAAQ;AAAA,IAE5B,UAAA,gBAAA,EAAC,IAAD,EAA+B,MAAA,EAAO,CAAA;AAAA,EAChC,CAAA,CACR,EAAA,CAAA;AAEN,CAAC"}
1
+ {"version":3,"file":"TransactionHistoryBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.tsx"],"sourcesContent":["import { useLayoutEffect, useState } from 'react'\n\nimport { useTheme } from '@mui/material/styles'\nimport { observer } from 'mobx-react-lite'\n\nimport type { Beat, DataSeries, GlobalCopy, Transaction } from '../../../core'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { ANALYTICS_EVENTS_CONFIG, useAnalyticsEvent } from '../../analytics'\nimport { BarChartV2 } from '../../components/chartblocks/BarchartV2'\nimport { DoubleBarChart } from '../../components/chartblocks/DoubleBarChart'\nimport { EmptyBarChart } from '../../components/chartblocks/EmptyBarChart'\nimport { BAR_ARIA_LABEL } from '../../blocks/ChartBlocks/BarchartBlock/utils'\nimport {\n COMPARISON_BAR_ARIA_LABEL,\n toLegendItems,\n} from '../../blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils'\n\nimport { TransactionDrillDown } from './TransactionDrillDown'\nimport { useTransactionHistory } from './useTransactionHistory'\nimport {\n getDefaultSelection,\n getDrillDownConfig,\n getFlattenedDataSeries,\n resolveDrillDownSubHeader,\n toStoreFilter,\n} from './utils'\nimport { Drawer, useInsightsV2Store, useGlobalCopyStore } from '../../../common'\nimport { TransactionDetailsBlock } from '../TransactionDetailsBlock'\nimport { useOpenedCta } from '../useOpenedCta'\nimport type { OpenedCta } from '../util'\nimport { useRequiredCopy } from '../useRequiredCopy'\n\ninterface TransactionHistoryProp {\n beat: Beat\n /**\n * The CTA to draw, for a drawer nested inside another block's drawer (Top Merchants → Merchant\n * History). Absent: the CTA that opened the beat's drawer.\n */\n cta?: OpenedCta\n}\n\nexport const selectTransactionHistoryCopy = (copy: GlobalCopy) => copy.insights_feed\n\nexport const TransactionHistoryBlock = observer(({ beat, cta }: TransactionHistoryProp) => {\n const theme = useTheme()\n\n const { actionDrawer, setActionContext } = useInsightsV2Store()\n\n const { insights_payload } = beat\n\n // The CTA that opened the drawer: its variant picks the view, and its drilldown_data feeds a\n // variant that reads its facts from the opener (Monthly Debt to Income). Only drilldown_data is passed\n // on: it is the payload's own object, stable across renders, while the opener may be rebuilt per render.\n const drawerCta = useOpenedCta(beat)\n const openedCta = cta ?? drawerCta\n const dynamicCtaVariant = openedCta?.variant\n\n const {\n top,\n filterMode,\n header,\n colors,\n filterStrategy,\n tipSection,\n subTabAriaLabels,\n slotData,\n averageFormat,\n subTabs,\n boldLabel,\n barLegendLabel,\n showMonthlyAmount,\n } = getDrillDownConfig(dynamicCtaVariant ?? '')\n\n const {\n instanceSlotData,\n beatTransactions,\n spendCategoryGuids,\n allAccountGuids,\n categoryName,\n displayedDateRange,\n transactionStore,\n } = useTransactionHistory(beat, { slotData }, openedCta?.drilldown_data)\n\n const { common: commonCopy } = useGlobalCopyStore()\n const insightsCopy = useRequiredCopy(selectTransactionHistoryCopy)\n\n const [isTransactionDetailsOpen, setIsTransactionDetailsOpen] = useState(false)\n\n const [closeTipSection, setCloseTipSection] = useState(false)\n\n const fireAnalyticsEvent = useAnalyticsEvent()\n\n const { dataSeries, chartData, comparisonBars } = getFlattenedDataSeries({\n data: instanceSlotData?.data_series as DataSeries,\n ariaLabel:\n top === 'doubleBar'\n ? (insightsCopy?.general?.in_month_you_had_a_category_of_amount ??\n COMPARISON_BAR_ARIA_LABEL)\n : BAR_ARIA_LABEL,\n top,\n beatTransactions,\n })\n\n const isDoubleBar = top === 'doubleBar'\n const isTabsOnly = top === 'tabsOnly'\n // The drawer's columns (and tabs): the double bar's month pairs, or the single bar's bars.\n const bars = isDoubleBar ? comparisonBars : chartData\n\n const { chartBarIndex, subTabIndex } = getDefaultSelection({\n chartTabCount: chartData.length,\n comparisonTabCount: comparisonBars.length,\n actionDrawer,\n beatGuid: beat.guid,\n })\n\n const [selectedIndex, setSelectedIndex] = useState(chartBarIndex)\n // The double-bar drawer's series tab (0 = main, e.g. Spend; 1 = comparison, e.g. Income).\n const [subIndex, setSubIndex] = useState(subTabIndex)\n\n // Bars built from the transaction store (Upcoming Bill's paid bills) can arrive after the drawer\n // opens: re-select the default when the bar count changes. Payload-built bars never change count.\n const [defaultedTabCount, setDefaultedTabCount] = useState(bars.length)\n if (bars.length !== defaultedTabCount) {\n setDefaultedTabCount(bars.length)\n setSelectedIndex(chartBarIndex)\n }\n\n const resolveFilter = (index: number) =>\n filterStrategy({\n beat,\n beatTransactions,\n dataSeries,\n comparisonBars,\n selectedIndex: index,\n subIndex,\n isLastTab: index === bars.length - 1,\n instanceSlotData,\n spendCategoryGuids,\n displayedDateRange,\n })\n\n // Content keys for the effect deps: these arrays get a new identity every render (MEW-3732).\n const beatTransactionGuidsKey = beatTransactions.map((transaction) => transaction.guid).join(',')\n const spendCategoryGuidsKey = spendCategoryGuids.join(',')\n const allAccountGuidsKey = allAccountGuids.join(',')\n\n // Re-applied on selection change and when the nested details drawer closes: AddMerchantBudgetAction\n // overwrites transactionStore.filter and never restores it. Chartless tops filter with no bars.\n const canApplyFilter =\n top === 'list' || top === 'tabsOnly' || top === 'monthTabs' || dataSeries.length > 0\n const applyCurrentSelectionFilter = () => {\n if (filterMode !== 'store') return\n // A chart drawer with no bars can name no rows: fail closed rather than keep the store's default\n // (every account) or a previous drawer's filter.\n const filter = canApplyFilter\n ? resolveFilter(selectedIndex)\n : { accounts: [], custom: () => false }\n transactionStore.setFilter(toStoreFilter(filter, { allAccountGuids, displayedDateRange }))\n }\n\n // store variants route the selection through the shared store filter; local (upcomingBill) variants\n // filter beatTransactions directly, so there's nothing to push to the store for them.\n useLayoutEffect(() => {\n applyCurrentSelectionFilter()\n }, [\n beat.guid,\n selectedIndex,\n subIndex,\n filterMode,\n dataSeries.length,\n instanceSlotData,\n displayedDateRange,\n spendCategoryGuidsKey,\n allAccountGuidsKey,\n beatTransactionGuidsKey,\n top,\n ])\n\n const subHeader = resolveDrillDownSubHeader(insights_payload)\n\n const headerContent = header?.({\n title: insights_payload?.title,\n subHeader,\n categoryName,\n selectedDate: chartData[selectedIndex]?.date ?? undefined,\n slotData: instanceSlotData,\n copy: insightsCopy,\n })\n\n const barColors = colors(theme, instanceSlotData?.category_guid)\n\n // `legends` is the block's additional_data ([0] main, [1] second series), as BarchartBlock reads it.\n const [mainLegend, comparisonLegend] = instanceSlotData?.legends ?? []\n\n const transactionFilter =\n filterMode === 'local'\n ? (index: number) => resolveFilter(index).custom ?? (() => true)\n : undefined\n\n const baseTransactions: Transaction[] | undefined =\n filterMode === 'local' ? beatTransactions : undefined\n\n // A chart bar click selects its column (and, on the double bar, its series); a month tab change\n // selects the month. MUI Tabs only fires onChange on real user selection, not on mount. The\n // series (Spend / Income) tab fires its own analytics via the shared SubTabs component.\n const selectBar = (index: number, seriesIndex?: number) => {\n fireAnalyticsEvent(ANALYTICS_EVENTS_CONFIG.DRAWER_CHART_BAR_CLICKED)\n setSelectedIndex(index)\n if (seriesIndex !== undefined) setSubIndex(seriesIndex)\n }\n const selectMonth = (index: number) => {\n fireAnalyticsEvent(ANALYTICS_EVENTS_CONFIG.TAB_SELECTED)\n setSelectedIndex(index)\n }\n\n // Double bar: the Spend / Income labels come from copy (additional_data); the legend carries the\n // selected month's two totals, and its labels name the series tabs.\n const doubleBarLegends = isDoubleBar\n ? toLegendItems([\n { ...mainLegend, value: comparisonBars[selectedIndex]?.main },\n { ...comparisonLegend, value: comparisonBars[selectedIndex]?.comparison },\n ])\n : undefined\n\n // Legacy pulse named these tabs \"Spend transactions\" / \"Income transactions\" for screen readers.\n const seriesAriaLabels = subTabAriaLabels?.(insightsCopy) ?? []\n\n // The second tab row: the double bar's series, a tabs-only drawer's sides, or the variant's `subTabs`.\n const sideTabs = isDoubleBar\n ? (doubleBarLegends ?? []).map((legend, index) => ({\n label: legend.label,\n ariaLabel: seriesAriaLabels[index],\n }))\n : isTabsOnly\n ? dataSeries.flatMap((row) => (row.localized_label ? [{ label: row.localized_label }] : []))\n : (subTabs?.({ instanceSlotData, copy: insightsCopy }).map((label) => ({ label })) ?? [])\n\n const renderChart = () => {\n if (!bars.length) return <EmptyBarChart />\n\n return isDoubleBar ? (\n <DoubleBarChart\n bars={comparisonBars}\n boldLabel={boldLabel}\n colors={barColors}\n legendPosition=\"top\"\n legendVariant=\"body2\"\n legends={doubleBarLegends}\n onBarClick={selectBar}\n selectedIndex={selectedIndex}\n />\n ) : (\n <BarChartV2\n amounts={{\n average: instanceSlotData?.average_amount,\n formattedAverage: formatCurrency(\n instanceSlotData?.average_amount ?? 0,\n averageFormat ?? CURRENCY_FORMAT.cents,\n ),\n }}\n color={barColors[0] ?? theme.palette.primary.main}\n data={chartData}\n legendPosition=\"top\"\n // Figma's chart drawer: 172px of bars under the 24px legend, 200px in all.\n heightOverride={172}\n margin={{\n bottom: 8,\n top: 24,\n left: 24,\n right: 24,\n }}\n // TODO: Temporary fallback while the backend doesn't always send `legends` on every\n // beat/variant. Remove this once the backend guarantees `legends` on the payload.\n monthlyAmountLabel={\n barLegendLabel?.(insightsCopy) ?? mainLegend?.label ?? insightsCopy.general.monthly_amount\n }\n onBarClick={selectBar}\n selectedTabIndex={selectedIndex}\n showMonthlyAmount={showMonthlyAmount}\n trendAmountLabel={comparisonLegend?.label ?? insightsCopy.general.trend}\n />\n )\n }\n\n // `list` (Low Account Balance), `tabsOnly` (Non-Essential Category Summary) and `monthTabs`\n // (Monthly Subscription Aggregate) drawers have no chart above their transaction list.\n const chartTop =\n isDoubleBar || top === 'singleBar' || top === 'upcomingBill' ? renderChart() : null\n\n return (\n <>\n <TransactionDrillDown\n baseTransactions={baseTransactions}\n heading={headerContent?.heading}\n icon={headerContent?.icon}\n logo={headerContent?.logo}\n onSelectionChange={selectMonth}\n selectedIndex={selectedIndex}\n subHeadingText={headerContent?.subHeadingText}\n tabs={bars}\n top={chartTop}\n {...(sideTabs.length > 0 && {\n subTabs: { tabs: sideTabs, selectedIndex: subIndex, onChange: setSubIndex },\n })}\n {...(tipSection && {\n tipSection:\n !closeTipSection &&\n (tipSection(setCloseTipSection, insightsCopy, subHeader?.text, instanceSlotData) ??\n false),\n })}\n transactionFilter={transactionFilter}\n onEachRowClick={(guid) => {\n setActionContext({ transaction_guid: guid })\n setIsTransactionDetailsOpen(true)\n }}\n />\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={isTransactionDetailsOpen}\n onClose={() => {\n setIsTransactionDetailsOpen(false)\n // Clear only the key this nested drawer owns — setActionContext merges, so an\n // explicit `{}` would be a no-op and leave transaction_guid stuck in the shared\n // context, and the outer drawer's own context (e.g. chartBarIndex) must survive.\n setActionContext({ transaction_guid: undefined })\n // Re-apply this block's own filter: a further-nested AddMerchantBudgetAction drawer may\n // have overwritten transactionStore.filter (merchant_guid-only) without restoring it.\n applyCurrentSelectionFilter()\n }}\n title={insightsCopy.general.transaction_details_title}\n >\n <TransactionDetailsBlock beat={beat} />\n </Drawer>\n </>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyCA,IAAa,KAAA,CAAgC,MAAqB,EAAK,eAE1D,KAA0B,GAAA,CAAU,EAAE,MAAA,GAAM,KAAA,EAAA,MAAkC;AACzF,QAAM,IAAQ,GAAS,GAEjB,EAAE,cAAA,GAAc,kBAAA,EAAA,IAAqB,GAAmB,GAExD,EAAE,kBAAA,EAAA,IAAqB,GAKvB,IAAY,GAAa,CAAI,GAC7B,IAAY,KAAO,GACnB,IAAoB,GAAW,SAE/B,EACJ,KAAA,GACA,YAAA,GACA,QAAA,GACA,QAAA,GACA,gBAAA,GACA,YAAA,GACA,kBAAA,GACA,UAAA,GACA,eAAA,GACA,SAAA,GACA,WAAA,GACA,gBAAA,GACA,mBAAA,GAAA,IACE,GAAmB,KAAqB,EAAE,GAExC,EACJ,kBAAA,GACA,kBAAA,GACA,oBAAA,GACA,iBAAA,GACA,cAAA,IACA,oBAAA,GACA,kBAAA,GAAA,IACE,GAAsB,GAAM,EAAE,UAAA,EAAS,GAAG,GAAW,cAAc,GAEjE,EAAE,QAAQ,GAAA,IAAe,GAAmB,GAC5C,IAAe,GAAgB,EAA4B,GAE3D,CAAC,IAA0B,CAAA,IAA+B,EAAS,EAAK,GAExE,CAAC,IAAiB,EAAA,IAAsB,EAAS,EAAK,GAEtD,IAAqB,GAAkB,GAEvC,EAAE,YAAA,GAAY,WAAA,GAAW,gBAAA,EAAA,IAAmB,GAAuB;AAAA,IACvE,MAAM,GAAkB;AAAA,IACxB,WACE,MAAQ,cACH,GAAc,SAAS,yCAAA,wCAExB;AAAA,IACN,KAAA;AAAA,IACA,kBAAA;AAAA,EACF,CAAC,GAEK,IAAc,MAAQ,aACtB,KAAa,MAAQ,YAErB,IAAO,IAAc,IAAi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;AAAA,MAAU,UAAU;AAAA,IAAY,EAC5E;AAAA,IACA,GAAK,KAAc,EACjB,YACE,CAAC,OACA,EAAW,IAAoB,GAAc,GAAW,MAAM,CAAgB,KAC7E,IACN;AAAA,IACmB,mBAAA;AAAA,IACnB,gBAAA,CAAiB,MAAS;AACxB,MAAA,EAAiB,EAAE,kBAAkB,EAAK,CAAC,GAC3C,EAA4B,EAAI;AAAA,IAClC;AAAA,EACD,CAAA,GACD,gBAAA,EAAC,IAAD;AAAA,IACE,gBAAgB,GAAW;AAAA,IAC3B,QAAQ;AAAA,IACR,SAAA,MAAe;AACb,MAAA,EAA4B,EAAK,GAIjC,EAAiB,EAAE,kBAAkB,OAAU,CAAC,GAGhD,EAA4B;AAAA,IAC9B;AAAA,IACA,OAAO,EAAa,QAAQ;AAAA,IAE5B,UAAA,gBAAA,EAAC,IAAD,EAA+B,MAAA,EAAO,CAAA;AAAA,EAChC,CAAA,CACR,EAAA,CAAA;AAEN,CAAC"}
@@ -81,6 +81,8 @@ export interface DrillDownVariantConfig {
81
81
  subTabAriaLabels?: (copy: InsightsFeedCopy) => (string | undefined)[];
82
82
  averageFormat?: CurrencyFormat;
83
83
  boldLabel?: boolean;
84
+ barLegendLabel?: (copy: InsightsFeedCopy) => string | undefined;
85
+ showMonthlyAmount?: boolean;
84
86
  title?: (copy: GlobalCopy, beat?: Beat) => string | undefined;
85
87
  }
86
88
  export declare const resolveUpcomingBillSlotData: SlotDataResolver;