@mx-cartographer/experiences 9.7.127 → 9.7.129

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 (72) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/core/types/localization/InsightsFeedCopy.d.ts +11 -15
  3. package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.d.ts +5 -1
  4. package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js +77 -30
  5. package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js.map +1 -1
  6. package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListContent.d.ts +26 -13
  7. package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListContent.es.js +107 -136
  8. package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListContent.es.js.map +1 -1
  9. package/dist/insights-v2/actionBlocks/AccountListBlock/layout.d.ts +21 -7
  10. package/dist/insights-v2/actionBlocks/AccountListBlock/layout.es.js +34 -17
  11. package/dist/insights-v2/actionBlocks/AccountListBlock/layout.es.js.map +1 -1
  12. package/dist/insights-v2/actionBlocks/AccountListBlock/useAccountListPrepare.d.ts +3 -1
  13. package/dist/insights-v2/actionBlocks/AccountListBlock/useAccountListPrepare.es.js +10 -8
  14. package/dist/insights-v2/actionBlocks/AccountListBlock/useAccountListPrepare.es.js.map +1 -1
  15. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js +101 -105
  16. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js.map +1 -1
  17. package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/RecurringTransactionBlock.d.ts +10 -12
  18. package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/RecurringTransactionBlock.es.js +20 -19
  19. package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/RecurringTransactionBlock.es.js.map +1 -1
  20. package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/index.d.ts +1 -1
  21. package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/useRecurringTransactionBlock.d.ts +3 -12
  22. package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/useRecurringTransactionBlock.es.js +8 -8
  23. package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/useRecurringTransactionBlock.es.js.map +1 -1
  24. package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/useRecurringTransactionPrepare.d.ts +9 -0
  25. package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/useRecurringTransactionPrepare.es.js +27 -10
  26. package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/useRecurringTransactionPrepare.es.js.map +1 -1
  27. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.d.ts +1 -7
  28. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js +54 -63
  29. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js.map +1 -1
  30. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashContent.es.js +29 -75
  31. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashContent.es.js.map +1 -1
  32. package/dist/insights-v2/actionBlocks/RemainingCashBlock/layout.d.ts +12 -0
  33. package/dist/insights-v2/actionBlocks/RemainingCashBlock/layout.es.js +18 -9
  34. package/dist/insights-v2/actionBlocks/RemainingCashBlock/layout.es.js.map +1 -1
  35. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +66 -65
  36. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
  37. package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js +24 -30
  38. package/dist/insights-v2/blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js.map +1 -1
  39. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +84 -101
  40. package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
  41. package/dist/insights-v2/components/AmountBreakdownCard.es.js +9 -8
  42. package/dist/insights-v2/components/AmountBreakdownCard.es.js.map +1 -1
  43. package/dist/insights-v2/components/CategoryTile.d.ts +14 -0
  44. package/dist/insights-v2/components/CategoryTile.es.js +28 -0
  45. package/dist/insights-v2/components/CategoryTile.es.js.map +1 -0
  46. package/dist/insights-v2/components/InsightListRow.d.ts +31 -0
  47. package/dist/insights-v2/components/InsightListRow.es.js +111 -0
  48. package/dist/insights-v2/components/InsightListRow.es.js.map +1 -0
  49. package/dist/insights-v2/components/LogoMark.d.ts +3 -3
  50. package/dist/insights-v2/components/LogoMark.es.js +11 -10
  51. package/dist/insights-v2/components/LogoMark.es.js.map +1 -1
  52. package/dist/insights-v2/components/SubTabs.d.ts +2 -1
  53. package/dist/insights-v2/components/SubTabs.es.js +10 -10
  54. package/dist/insights-v2/components/SubTabs.es.js.map +1 -1
  55. package/dist/insights-v2/index.es.js +12 -12
  56. package/dist/insights-v2/mappings/blocks.es.js +21 -21
  57. package/dist/recurringtransactions/components/RecurringTransactionDetails.d.ts +3 -1
  58. package/dist/recurringtransactions/components/RecurringTransactionDetails.es.js +169 -120
  59. package/dist/recurringtransactions/components/RecurringTransactionDetails.es.js.map +1 -1
  60. package/dist/recurringtransactions/components/RecurringTransactionList.d.ts +3 -1
  61. package/dist/recurringtransactions/components/RecurringTransactionList.es.js +151 -118
  62. package/dist/recurringtransactions/components/RecurringTransactionList.es.js.map +1 -1
  63. package/dist/transactions/components/shared/TransactionDetails.d.ts +1 -6
  64. package/dist/transactions/components/shared/TransactionDetails.es.js +149 -199
  65. package/dist/transactions/components/shared/TransactionDetails.es.js.map +1 -1
  66. package/dist/transactions/components/shared/transactiondetails/Description.d.ts +2 -0
  67. package/dist/transactions/components/shared/transactiondetails/Description.es.js +59 -50
  68. package/dist/transactions/components/shared/transactiondetails/Description.es.js.map +1 -1
  69. package/dist/transactions/components/shared/transactiondetails/TransactionHeaderParts.d.ts +10 -0
  70. package/dist/transactions/components/shared/transactiondetails/TransactionHeaderParts.es.js +68 -0
  71. package/dist/transactions/components/shared/transactiondetails/TransactionHeaderParts.es.js.map +1 -0
  72. package/package.json +1 -1
@@ -1,12 +1,13 @@
1
- import { formatSignedCurrency as d } from "../../../core/utils/NumberFormatting.es.js";
2
- import { getLogoElevation as x } from "../../components/logoShadow.es.js";
1
+ import { formatSignedCurrency as l } from "../../../core/utils/NumberFormatting.es.js";
2
+ import { getLogoElevation as h } from "../../components/logoShadow.es.js";
3
+ import s from "../../components/InsightListRow.es.js";
3
4
  import { createElement as b } from "react";
4
5
  import i from "@mui/material/Stack";
5
6
  import { Text as a } from "@mxenabled/mxui";
6
7
  import { jsx as r, jsxs as n } from "react/jsx-runtime";
7
- import p from "@mui/material/Box";
8
- import s from "@mui/material/Divider";
9
- var h = ({ label: t, value: e }) => /* @__PURE__ */ n(i, {
8
+ import u from "@mui/material/Box";
9
+ import x from "@mui/material/Divider";
10
+ var c = ({ label: t, value: o }) => /* @__PURE__ */ n(i, {
10
11
  sx: {
11
12
  alignItems: "center",
12
13
  flexDirection: "row",
@@ -22,9 +23,9 @@ var h = ({ label: t, value: e }) => /* @__PURE__ */ n(i, {
22
23
  bold: !0,
23
24
  sx: { fontVariantNumeric: "tabular-nums" },
24
25
  variant: "body1",
25
- children: e
26
+ children: o
26
27
  })]
27
- }), u = ({ cashOnHand: t, cashOnHandLabel: e, remaining: o, upcomingExpenses: l, upcomingExpensesLabel: c }) => /* @__PURE__ */ r(i, {
28
+ }), f = ({ cashOnHand: t, cashOnHandLabel: o, remaining: e, upcomingExpenses: d, upcomingExpensesLabel: p }) => /* @__PURE__ */ r(i, {
28
29
  sx: {
29
30
  pb: 8,
30
31
  pt: 24,
@@ -34,12 +35,12 @@ var h = ({ label: t, value: e }) => /* @__PURE__ */ n(i, {
34
35
  sx: {
35
36
  bgcolor: "background.paper",
36
37
  borderRadius: "8px",
37
- boxShadow: x,
38
+ boxShadow: h,
38
39
  gap: 16,
39
40
  p: 16
40
41
  },
41
- children: [o && /* @__PURE__ */ n(i, {
42
- "aria-label": `${d(o.amount)}, ${o.caption}`,
42
+ children: [e && /* @__PURE__ */ n(i, {
43
+ "aria-label": `${l(e.amount)}, ${e.caption}`,
43
44
  role: "group",
44
45
  sx: {
45
46
  alignItems: "center",
@@ -52,12 +53,12 @@ var h = ({ label: t, value: e }) => /* @__PURE__ */ n(i, {
52
53
  bold: !0,
53
54
  component: "p",
54
55
  variant: "h2",
55
- children: d(o.amount)
56
+ children: l(e.amount)
56
57
  }), /* @__PURE__ */ r(a, {
57
58
  "aria-hidden": !0,
58
59
  color: "text.secondary",
59
60
  variant: "subtitle2",
60
- children: o.caption
61
+ children: e.caption
61
62
  })]
62
63
  }), /* @__PURE__ */ n(i, {
63
64
  sx: {
@@ -67,66 +68,19 @@ var h = ({ label: t, value: e }) => /* @__PURE__ */ n(i, {
67
68
  overflow: "hidden"
68
69
  },
69
70
  children: [
70
- /* @__PURE__ */ r(h, {
71
- label: e,
72
- value: d(t)
71
+ /* @__PURE__ */ r(c, {
72
+ label: o,
73
+ value: l(t)
73
74
  }),
74
- /* @__PURE__ */ r(s, {}),
75
- /* @__PURE__ */ r(h, {
76
- label: c,
77
- value: d(-l)
75
+ /* @__PURE__ */ r(x, {}),
76
+ /* @__PURE__ */ r(c, {
77
+ label: p,
78
+ value: l(-d)
78
79
  })
79
80
  ]
80
81
  })]
81
82
  })
82
- }), f = ({ amount: t, isLast: e, leading: o, name: l }) => /* @__PURE__ */ n(p, {
83
- component: "li",
84
- sx: { position: "relative" },
85
- children: [/* @__PURE__ */ n(i, {
86
- sx: {
87
- alignItems: "center",
88
- flexDirection: "row",
89
- gap: 16,
90
- px: 24,
91
- py: 16
92
- },
93
- children: [/* @__PURE__ */ n(i, {
94
- sx: {
95
- alignItems: "center",
96
- flexDirection: "row",
97
- flexGrow: 1,
98
- gap: 12,
99
- minWidth: 0
100
- },
101
- children: [/* @__PURE__ */ r(p, {
102
- sx: {
103
- display: "flex",
104
- flexShrink: 0,
105
- height: 32,
106
- width: 32
107
- },
108
- children: o
109
- }), /* @__PURE__ */ r(a, {
110
- truncate: !0,
111
- variant: "body1",
112
- children: l
113
- })]
114
- }), /* @__PURE__ */ r(a, {
115
- bold: !0,
116
- sx: {
117
- flexShrink: 0,
118
- fontVariantNumeric: "tabular-nums"
119
- },
120
- variant: "body1",
121
- children: d(t)
122
- })]
123
- }), /* @__PURE__ */ r(s, { sx: {
124
- bottom: 0,
125
- left: e ? 0 : 24,
126
- position: "absolute",
127
- right: 0
128
- } })]
129
- }), m = ({ header: t, rows: e }) => /* @__PURE__ */ n(i, { children: [/* @__PURE__ */ r(p, {
83
+ }), m = ({ header: t, rows: o }) => /* @__PURE__ */ n(i, { children: [/* @__PURE__ */ r(u, {
130
84
  sx: {
131
85
  pb: 4,
132
86
  pt: 16,
@@ -146,24 +100,24 @@ var h = ({ label: t, value: e }) => /* @__PURE__ */ n(i, {
146
100
  m: 0,
147
101
  p: 0
148
102
  },
149
- children: e.map(({ key: o, ...l }, c) => /* @__PURE__ */ b(f, {
150
- ...l,
151
- isLast: c === e.length - 1,
152
- key: o
103
+ children: o.map(({ key: e, ...d }, p) => /* @__PURE__ */ b(s, {
104
+ ...d,
105
+ isLast: p === o.length - 1,
106
+ key: e
153
107
  }))
154
- })] }), R = ({ accounts: t, expenses: e, summary: o }) => /* @__PURE__ */ n(i, {
108
+ })] }), I = ({ accounts: t, expenses: o, summary: e }) => /* @__PURE__ */ n(i, {
155
109
  sx: {
156
110
  bgcolor: "background.default",
157
111
  pb: 24
158
112
  },
159
113
  children: [
160
- /* @__PURE__ */ r(u, { ...o }),
114
+ /* @__PURE__ */ r(f, { ...e }),
161
115
  t.rows.length > 0 && /* @__PURE__ */ r(m, { ...t }),
162
- e.rows.length > 0 && /* @__PURE__ */ r(m, { ...e })
116
+ o.rows.length > 0 && /* @__PURE__ */ r(m, { ...o })
163
117
  ]
164
118
  });
165
119
  export {
166
- R as default
120
+ I as default
167
121
  };
168
122
 
169
123
  //# sourceMappingURL=RemainingCashContent.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RemainingCashContent.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashContent.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Divider from '@mui/material/Divider'\nimport Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { formatSignedCurrency } from '../../../core/utils/NumberFormatting'\nimport { getLogoElevation } from '../../components/logoShadow'\n\nexport interface RemainingCashRow {\n key: string\n name: string\n amount: number\n /** The row's 32px logo: an account's institution or an expense's category. */\n leading: ReactNode\n}\n\ninterface RemainingCashSectionProps {\n header: string\n /** Already grouped and ordered, including any \"Other (#)\" row. */\n rows: RemainingCashRow[]\n}\n\ninterface RemainingCashSummaryProps {\n /** Omitted when there is no upcoming payday: a \"remaining until payday\" figure has no meaning. */\n remaining?: { amount: number; caption: string }\n cashOnHand: number\n upcomingExpenses: number\n cashOnHandLabel: string\n upcomingExpensesLabel: string\n}\n\nexport interface RemainingCashContentProps {\n summary: RemainingCashSummaryProps\n accounts: RemainingCashSectionProps\n expenses: RemainingCashSectionProps\n}\n\nconst BreakdownRow = ({ label, value }: { label: string; value: string }) => (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 16, minHeight: 44, px: 24 }}>\n <Text sx={{ flexGrow: 1 }} variant=\"body1\">\n {label}\n </Text>\n <Text bold={true} sx={{ fontVariantNumeric: 'tabular-nums' }} variant=\"body1\">\n {value}\n </Text>\n </Stack>\n)\n\nconst Summary = ({\n cashOnHand,\n cashOnHandLabel,\n remaining,\n upcomingExpenses,\n upcomingExpensesLabel,\n}: RemainingCashSummaryProps) => (\n <Stack sx={{ pb: 8, pt: 24, px: 24 }}>\n <Stack\n sx={{\n bgcolor: 'background.paper',\n borderRadius: '8px',\n boxShadow: getLogoElevation,\n gap: 16,\n p: 16,\n }}\n >\n {remaining && (\n // One announcement (\"$2,350.00, Remaining until payday (7 days)\") instead of two loose text\n // nodes. The amount keeps the h2 look but is a paragraph: it is a value, not a heading.\n <Stack\n aria-label={`${formatSignedCurrency(remaining.amount)}, ${remaining.caption}`}\n role=\"group\"\n sx={{ alignItems: 'center', justifyContent: 'center', minHeight: 72, p: 12 }}\n >\n <Text aria-hidden={true} bold={true} component=\"p\" variant=\"h2\">\n {formatSignedCurrency(remaining.amount)}\n </Text>\n <Text aria-hidden={true} color=\"text.secondary\" variant=\"subtitle2\">\n {remaining.caption}\n </Text>\n </Stack>\n )}\n <Stack\n sx={{\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: '8px',\n overflow: 'hidden',\n }}\n >\n <BreakdownRow label={cashOnHandLabel} value={formatSignedCurrency(cashOnHand)} />\n <Divider />\n {/* Shown as a deduction (-$1,200.00) per Figma; the expense rows below show positive amounts. */}\n <BreakdownRow\n label={upcomingExpensesLabel}\n value={formatSignedCurrency(-upcomingExpenses)}\n />\n </Stack>\n </Stack>\n </Stack>\n)\n\n/** One 64px row. The last row's divider runs full width; the rest are inset 24px (Figma). */\nconst RowItem = ({\n amount,\n isLast,\n leading,\n name,\n}: Omit<RemainingCashRow, 'key'> & { isLast: boolean }) => (\n <Box component=\"li\" sx={{ position: 'relative' }}>\n {/* 64px as in Figma: 16px above and below the 32px logo, the row's tallest item. */}\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 16, px: 24, py: 16 }}>\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', flexGrow: 1, gap: 12, minWidth: 0 }}>\n <Box sx={{ display: 'flex', flexShrink: 0, height: 32, width: 32 }}>{leading}</Box>\n <Text truncate={true} variant=\"body1\">\n {name}\n </Text>\n </Stack>\n <Text bold={true} sx={{ flexShrink: 0, fontVariantNumeric: 'tabular-nums' }} variant=\"body1\">\n {formatSignedCurrency(amount)}\n </Text>\n </Stack>\n <Divider sx={{ bottom: 0, left: isLast ? 0 : 24, position: 'absolute', right: 0 }} />\n </Box>\n)\n\n// The drawer title is the h2, so section headers are h3 and each section is a real list.\nconst Section = ({ header, rows }: RemainingCashSectionProps) => (\n <Stack>\n <Box sx={{ pb: 4, pt: 16, px: 24 }}>\n <Text bold={true} component=\"h3\" variant=\"body1\">\n {header}\n </Text>\n </Box>\n <Stack component=\"ul\" sx={{ bgcolor: 'background.paper', listStyle: 'none', m: 0, p: 0 }}>\n {rows.map(({ key, ...row }, index) => (\n <RowItem {...row} isLast={index === rows.length - 1} key={key} />\n ))}\n </Stack>\n </Stack>\n)\n\n/** Presentational body of the Remaining Cash drawer (Figma 9936:39163, minus the drawer header). */\nconst RemainingCashContent = ({ accounts, expenses, summary }: RemainingCashContentProps) => (\n <Stack sx={{ bgcolor: 'background.default', pb: 24 }}>\n <Summary {...summary} />\n {accounts.rows.length > 0 && <Section {...accounts} />}\n {expenses.rows.length > 0 && <Section {...expenses} />}\n </Stack>\n)\n\nexport default RemainingCashContent\n"],"mappings":";;;;;;;;AAwCA,IAAM,IAAA,CAAgB,EAAE,OAAA,GAAO,OAAA,EAAA,MAC7B,gBAAA,EAAC,GAAD;AAAA,EAAO,IAAI;AAAA,IAAE,YAAY;AAAA,IAAU,eAAe;AAAA,IAAO,KAAK;AAAA,IAAI,WAAW;AAAA,IAAI,IAAI;AAAA,EAAG;AAAA,EAAxF,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,IAAM,IAAI,EAAE,UAAU,EAAE;AAAA,IAAG,SAAQ;AAAA,IAChC,UAAA;AAAA,EACG,CAAA,GACN,gBAAA,EAAC,GAAD;AAAA,IAAM,MAAM;AAAA,IAAM,IAAI,EAAE,oBAAoB,eAAe;AAAA,IAAG,SAAQ;AAAA,IACnE,UAAA;AAAA,EACG,CAAA,CACD;IAGH,IAAA,CAAW,EACf,YAAA,GACA,iBAAA,GACA,WAAA,GACA,kBAAA,GACA,uBAAA,EAAA,MAEA,gBAAA,EAAC,GAAD;AAAA,EAAO,IAAI;AAAA,IAA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IAAE,IAAI;AAAA,IAAG,IAAI;AAAA,IAAI,IAAI;AAAA,EAAG;AAAA,EAC/B,UAAA,gBAAA,EAAC,GAAD;AAAA,IAAM,MAAM;AAAA,IAAM,WAAU;AAAA,IAAK,SAAQ;AAAA,IACtC,UAAA;AAAA,EACG,CAAA;AACH,CAAA,GACL,gBAAA,EAAC,GAAD;AAAA,EAAO,WAAU;AAAA,EAAK,IAAI;AAAA,IAAE,SAAS;AAAA,IAAoB,WAAW;AAAA,IAAQ,GAAG;AAAA,IAAG,GAAG;AAAA,EAAE;AAAA,EACpF,UAAA,EAAK,IAAA,CAAK,EAAE,KAAA,GAAK,GAAG,EAAA,GAAO,MAC1B,gBAAA,EAAC,GAAD;AAAA,IAAS,GAAI;AAAA,IAAK,QAAQ,MAAU,EAAK,SAAS;AAAA,IAAQ,KAAA;AAAA,EAAM,CAAA,CACjE;AACI,CAAA,CACF,EAAA,CAAA,GAIH,IAAA,CAAwB,EAAE,UAAA,GAAU,UAAA,GAAU,SAAA,EAAA,MAClD,gBAAA,EAAC,GAAD;AAAA,EAAO,IAAI;AAAA,IAAE,SAAS;AAAA,IAAsB,IAAI;AAAA,EAAG;AAAA,EAAnD,UAAA;AAAA,IACE,gBAAA,EAAC,GAAD,EAAS,GAAI,EAAU,CAAA;AAAA,IACtB,EAAS,KAAK,SAAS,KAAK,gBAAA,EAAC,GAAD,EAAS,GAAI,EAAW,CAAA;AAAA,IACpD,EAAS,KAAK,SAAS,KAAK,gBAAA,EAAC,GAAD,EAAS,GAAI,EAAW,CAAA;AAAA,EAChD"}
1
+ {"version":3,"file":"RemainingCashContent.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashContent.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Divider from '@mui/material/Divider'\nimport Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { formatSignedCurrency } from '../../../core/utils/NumberFormatting'\nimport InsightListRow from '../../components/InsightListRow'\nimport { getLogoElevation } from '../../components/logoShadow'\n\nexport interface RemainingCashRow {\n key: string\n name: string\n amount: number\n /** The row's 32px logo: an account's institution or an expense's category. */\n leading: ReactNode\n}\n\ninterface RemainingCashSectionProps {\n header: string\n /** Already grouped and ordered, including any \"Other (#)\" row. */\n rows: RemainingCashRow[]\n}\n\ninterface RemainingCashSummaryProps {\n /** Omitted when there is no upcoming payday: a \"remaining until payday\" figure has no meaning. */\n remaining?: { amount: number; caption: string }\n cashOnHand: number\n upcomingExpenses: number\n cashOnHandLabel: string\n upcomingExpensesLabel: string\n}\n\nexport interface RemainingCashContentProps {\n summary: RemainingCashSummaryProps\n accounts: RemainingCashSectionProps\n expenses: RemainingCashSectionProps\n}\n\nconst BreakdownRow = ({ label, value }: { label: string; value: string }) => (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 16, minHeight: 44, px: 24 }}>\n <Text sx={{ flexGrow: 1 }} variant=\"body1\">\n {label}\n </Text>\n <Text bold={true} sx={{ fontVariantNumeric: 'tabular-nums' }} variant=\"body1\">\n {value}\n </Text>\n </Stack>\n)\n\nconst Summary = ({\n cashOnHand,\n cashOnHandLabel,\n remaining,\n upcomingExpenses,\n upcomingExpensesLabel,\n}: RemainingCashSummaryProps) => (\n <Stack sx={{ pb: 8, pt: 24, px: 24 }}>\n <Stack\n sx={{\n bgcolor: 'background.paper',\n borderRadius: '8px',\n boxShadow: getLogoElevation,\n gap: 16,\n p: 16,\n }}\n >\n {remaining && (\n // One announcement (\"$2,350.00, Remaining until payday (7 days)\") instead of two loose text\n // nodes. The amount keeps the h2 look but is a paragraph: it is a value, not a heading.\n <Stack\n aria-label={`${formatSignedCurrency(remaining.amount)}, ${remaining.caption}`}\n role=\"group\"\n sx={{ alignItems: 'center', justifyContent: 'center', minHeight: 72, p: 12 }}\n >\n <Text aria-hidden={true} bold={true} component=\"p\" variant=\"h2\">\n {formatSignedCurrency(remaining.amount)}\n </Text>\n <Text aria-hidden={true} color=\"text.secondary\" variant=\"subtitle2\">\n {remaining.caption}\n </Text>\n </Stack>\n )}\n <Stack\n sx={{\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: '8px',\n overflow: 'hidden',\n }}\n >\n <BreakdownRow label={cashOnHandLabel} value={formatSignedCurrency(cashOnHand)} />\n <Divider />\n {/* Shown as a deduction (-$1,200.00) per Figma; the expense rows below show positive amounts. */}\n <BreakdownRow\n label={upcomingExpensesLabel}\n value={formatSignedCurrency(-upcomingExpenses)}\n />\n </Stack>\n </Stack>\n </Stack>\n)\n\n// The drawer title is the h2, so section headers are h3 and each section is a real list.\nconst Section = ({ header, rows }: RemainingCashSectionProps) => (\n <Stack>\n <Box sx={{ pb: 4, pt: 16, px: 24 }}>\n <Text bold={true} component=\"h3\" variant=\"body1\">\n {header}\n </Text>\n </Box>\n <Stack component=\"ul\" sx={{ bgcolor: 'background.paper', listStyle: 'none', m: 0, p: 0 }}>\n {rows.map(({ key, ...row }, index) => (\n <InsightListRow {...row} isLast={index === rows.length - 1} key={key} />\n ))}\n </Stack>\n </Stack>\n)\n\n/** Presentational body of the Remaining Cash drawer (Figma 9936:39163, minus the drawer header). */\nconst RemainingCashContent = ({ accounts, expenses, summary }: RemainingCashContentProps) => (\n <Stack sx={{ bgcolor: 'background.default', pb: 24 }}>\n <Summary {...summary} />\n {accounts.rows.length > 0 && <Section {...accounts} />}\n {expenses.rows.length > 0 && <Section {...expenses} />}\n </Stack>\n)\n\nexport default RemainingCashContent\n"],"mappings":";;;;;;;;;AAyCA,IAAM,IAAA,CAAgB,EAAE,OAAA,GAAO,OAAA,EAAA,MAC7B,gBAAA,EAAC,GAAD;AAAA,EAAO,IAAI;AAAA,IAAE,YAAY;AAAA,IAAU,eAAe;AAAA,IAAO,KAAK;AAAA,IAAI,WAAW;AAAA,IAAI,IAAI;AAAA,EAAG;AAAA,EAAxF,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,IAAM,IAAI,EAAE,UAAU,EAA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AA,IACtB,EAAS,KAAK,SAAS,KAAK,gBAAA,EAAC,GAAD,EAAS,GAAI,EAAW,CAAA;AAAA,IACpD,EAAS,KAAK,SAAS,KAAK,gBAAA,EAAC,GAAD,EAAS,GAAI,EAAW,CAAA;AAAA,EAChD"}
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  import { RemainingCashCopy } from '../../../core';
2
3
  /** Rows shown per section before the rest fold into an "Other (#)" row (Figma shows two). */
3
4
  export declare const ROW_LIMIT = 2;
@@ -12,5 +13,16 @@ export interface GroupedRows<T> {
12
13
  export declare const groupRows: <T extends {
13
14
  amount: number;
14
15
  }>(rows: T[]) => GroupedRows<T>;
16
+ export interface FoldableRow {
17
+ key: string;
18
+ name: string;
19
+ amount: number;
20
+ leading: ReactNode;
21
+ }
22
+ /** Top rows by amount, then one "Other (#)" row with the rest's count and total. */
23
+ export declare const foldOtherRows: <T extends FoldableRow>(rows: T[], otherLabel: {
24
+ one: string;
25
+ multi: string;
26
+ }, otherLeading: ReactNode) => (T | FoldableRow)[];
15
27
  export declare const getCaption: (copy: RemainingCashCopy, days: number) => string;
16
28
  export declare const getOtherLabel: (templateOne: string, templateMulti: string, count: number) => string;
@@ -1,20 +1,29 @@
1
1
  import { buildDynamicCopy as a, buildPluralCopy as i } from "../../../core/utils/Localization.es.js";
2
- var l = (t) => {
3
- const r = [...t].sort((e, o) => o.amount - e.amount);
4
- if (r.length <= 2) return { shown: r };
5
- const n = r.slice(2);
2
+ var u = (r) => {
3
+ const t = [...r].sort((e, o) => o.amount - e.amount);
4
+ if (t.length <= 2) return { shown: t };
5
+ const n = t.slice(2);
6
6
  return {
7
- shown: r.slice(0, 2),
7
+ shown: t.slice(0, 2),
8
8
  others: {
9
9
  count: n.length,
10
10
  total: n.reduce((e, o) => e + o.amount, 0)
11
11
  }
12
12
  };
13
- }, s = (t, r) => r === 1 ? t.remaining_until_payday_one : a(t.remaining_until_payday, String(r)), g = (t, r, n) => i(t, r, n, String(n));
13
+ }, m = (r, t, n) => {
14
+ const { others: e, shown: o } = u(r);
15
+ return e ? [...o, {
16
+ amount: e.total,
17
+ key: "other",
18
+ leading: n,
19
+ name: l(t.one, t.multi, e.count)
20
+ }] : o;
21
+ }, g = (r, t) => t === 1 ? r.remaining_until_payday_one : a(r.remaining_until_payday, String(t)), l = (r, t, n) => i(r, t, n, String(n));
14
22
  export {
15
- s as getCaption,
16
- g as getOtherLabel,
17
- l as groupRows
23
+ m as foldOtherRows,
24
+ g as getCaption,
25
+ l as getOtherLabel,
26
+ u as groupRows
18
27
  };
19
28
 
20
29
  //# sourceMappingURL=layout.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/RemainingCashBlock/layout.ts"],"sourcesContent":["import type { RemainingCashCopy } from '../../../core'\nimport { buildDynamicCopy, buildPluralCopy } from '../../../core/utils/Localization'\n\n/** Rows shown per section before the rest fold into an \"Other (#)\" row (Figma shows two). */\nexport const ROW_LIMIT = 2\n\nexport interface GroupedRows<T> {\n shown: T[]\n others?: { count: number; total: number }\n}\n\n/** Largest rows first (stable for ties), capped at `ROW_LIMIT`; the remainder as a count and total. */\nexport const groupRows = <T extends { amount: number }>(rows: T[]): GroupedRows<T> => {\n const sorted = [...rows].sort((a, b) => b.amount - a.amount)\n\n if (sorted.length <= ROW_LIMIT) return { shown: sorted }\n\n const rest = sorted.slice(ROW_LIMIT)\n\n return {\n shown: sorted.slice(0, ROW_LIMIT),\n others: { count: rest.length, total: rest.reduce((total, r) => total + r.amount, 0) },\n }\n}\n\nexport const getCaption = (copy: RemainingCashCopy, days: number): string => {\n if (days === 1) return copy.remaining_until_payday_one\n\n return buildDynamicCopy(copy.remaining_until_payday, String(days)) as string\n}\n\nexport const getOtherLabel = (templateOne: string, templateMulti: string, count: number): string =>\n buildPluralCopy(templateOne, templateMulti, count, String(count)) as string\n"],"mappings":";AAYA,IAAa,IAAA,CAA2C,MAA8B;AACpF,QAAM,IAAS,CAAC,GAAG,CAAI,EAAE,KAAA,CAAM,GAAG,MAAM,EAAE,SAAS,EAAE,MAAM;AAE3D,MAAI,EAAO,UAAA,EAAqB,QAAO,EAAE,OAAO,EAAO;AAEvD,QAAM,IAAO,EAAO,MAAA,CAAe;AAEnC,SAAO;AAAA,IACL,OAAO,EAAO,MAAM,GAAA,CAAY;AAAA,IAChC,QAAQ;AAAA,MAAE,OAAO,EAAK;AAAA,MAAQ,OAAO,EAAK,OAAA,CAAQ,GAAO,MAAM,IAAQ,EAAE,QAAQ,CAAC;AAAA,IAAE;AAAA,EACtF;AACF,GAEa,IAAA,CAAc,GAAyB,MAC9C,MAAS,IAAU,EAAK,6BAErB,EAAiB,EAAK,wBAAwB,OAAO,CAAI,CAAC,GAGtD,IAAA,CAAiB,GAAqB,GAAuB,MACxE,EAAgB,GAAa,GAAe,GAAO,OAAO,CAAK,CAAC"}
1
+ {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/RemainingCashBlock/layout.ts"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport type { RemainingCashCopy } from '../../../core'\nimport { buildDynamicCopy, buildPluralCopy } from '../../../core/utils/Localization'\n\n/** Rows shown per section before the rest fold into an \"Other (#)\" row (Figma shows two). */\nexport const ROW_LIMIT = 2\n\nexport interface GroupedRows<T> {\n shown: T[]\n others?: { count: number; total: number }\n}\n\n/** Largest rows first (stable for ties), capped at `ROW_LIMIT`; the remainder as a count and total. */\nexport const groupRows = <T extends { amount: number }>(rows: T[]): GroupedRows<T> => {\n const sorted = [...rows].sort((a, b) => b.amount - a.amount)\n\n if (sorted.length <= ROW_LIMIT) return { shown: sorted }\n\n const rest = sorted.slice(ROW_LIMIT)\n\n return {\n shown: sorted.slice(0, ROW_LIMIT),\n others: { count: rest.length, total: rest.reduce((total, r) => total + r.amount, 0) },\n }\n}\n\nexport interface FoldableRow {\n key: string\n name: string\n amount: number\n leading: ReactNode\n}\n\n/** Top rows by amount, then one \"Other (#)\" row with the rest's count and total. */\nexport const foldOtherRows = <T extends FoldableRow>(\n rows: T[],\n otherLabel: { one: string; multi: string },\n otherLeading: ReactNode,\n): (T | FoldableRow)[] => {\n const { others, shown } = groupRows(rows)\n\n if (!others) return shown\n\n return [\n ...shown,\n {\n amount: others.total,\n key: 'other',\n leading: otherLeading,\n name: getOtherLabel(otherLabel.one, otherLabel.multi, others.count),\n },\n ]\n}\n\nexport const getCaption = (copy: RemainingCashCopy, days: number): string => {\n if (days === 1) return copy.remaining_until_payday_one\n\n return buildDynamicCopy(copy.remaining_until_payday, String(days)) as string\n}\n\nexport const getOtherLabel = (templateOne: string, templateMulti: string, count: number): string =>\n buildPluralCopy(templateOne, templateMulti, count, String(count)) as string\n"],"mappings":";AAcA,IAAa,IAAA,CAA2C,MAA8B;AACpF,QAAM,IAAS,CAAC,GAAG,CAAI,EAAE,KAAA,CAAM,GAAG,MAAM,EAAE,SAAS,EAAE,MAAM;AAE3D,MAAI,EAAO,UAAA,EAAqB,QAAO,EAAE,OAAO,EAAO;AAEvD,QAAM,IAAO,EAAO,MAAA,CAAe;AAEnC,SAAO;AAAA,IACL,OAAO,EAAO,MAAM,GAAA,CAAY;AAAA,IAChC,QAAQ;AAAA,MAAE,OAAO,EAAK;AAAA,MAAQ,OAAO,EAAK,OAAA,CAAQ,GAAO,MAAM,IAAQ,EAAE,QAAQ,CAAC;AAAA,IAAE;AAAA,EACtF;AACF,GAUa,IAAA,CACX,GACA,GACA,MACwB;AACxB,QAAM,EAAE,QAAA,GAAQ,OAAA,EAAA,IAAU,EAAU,CAAI;AAExC,SAAK,IAEE,CACL,GAAG,GACH;AAAA,IACE,QAAQ,EAAO;AAAA,IACf,KAAK;AAAA,IACL,SAAS;AAAA,IACT,MAAM,EAAc,EAAW,KAAK,EAAW,OAAO,EAAO,KAAK;AAAA,EACpE,CACF,IAVoB;AAWtB,GAEa,IAAA,CAAc,GAAyB,MAC9C,MAAS,IAAU,EAAK,6BAErB,EAAiB,EAAK,wBAAwB,OAAO,CAAI,CAAC,GAGtD,IAAA,CAAiB,GAAqB,GAAuB,MACxE,EAAgB,GAAa,GAAe,GAAO,OAAO,CAAK,CAAC"}
@@ -5,8 +5,8 @@ import { fromUnixUTC as A } from "../../../core/utils/DateUtil.es.js";
5
5
  import { getCategoryColor as P } from "../../../core/utils/CategoryUtil.es.js";
6
6
  import { buildDataSeries as M } from "../../blocks/ChartBlocks/BarchartBlock/utils.es.js";
7
7
  import { getLayoutConfig as I } from "../../blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js";
8
- import { buildProjectedBillTransaction as w, calendarDateOf as H, finiteNumberOf as m, guidListOf as N, nonEmptyStringOf as b } from "./utils.es.js";
9
- import { MerchantLogo as Y } from "@mxenabled/mxui";
8
+ import w from "../../components/LogoMark.es.js";
9
+ import { buildProjectedBillTransaction as H, calendarDateOf as Y, finiteNumberOf as m, guidListOf as N, nonEmptyStringOf as b } from "./utils.es.js";
10
10
  import { Icon as F } from "@mxenabled/mx-icons";
11
11
  import { jsx as c } from "react/jsx-runtime";
12
12
  import { endOfMonth as C, fromUnixTime as x, isValid as L, parseISO as p, startOfMonth as B } from "date-fns";
@@ -28,24 +28,24 @@ var i = {
28
28
  start: B(T(t)),
29
29
  end: C(T(t))
30
30
  }), G = (t) => t?.length ? { accounts: t } : {}, V = ({ beat: t }) => {
31
- const { account_guid: e, from_date: a, to_date: r } = t.insights_payload?.drilldown_data ?? {};
32
- return typeof e != "string" || typeof a != "number" || typeof r != "number" || !Number.isFinite(a) || !Number.isFinite(r) || r <= a ? {
31
+ const { account_guid: e, from_date: a, to_date: o } = t.insights_payload?.drilldown_data ?? {};
32
+ return typeof e != "string" || typeof a != "number" || typeof o != "number" || !Number.isFinite(a) || !Number.isFinite(o) || o <= a ? {
33
33
  accounts: [],
34
34
  custom: () => !1
35
35
  } : {
36
36
  accounts: [e],
37
- custom: (o) => !o.is_hidden && o.feed_status !== U.PENDING,
37
+ custom: (r) => !r.is_hidden && r.feed_status !== U.PENDING,
38
38
  showSplits: !0,
39
39
  dateRange: {
40
40
  start: A(a),
41
- end: A(r - 1)
41
+ end: A(o - 1)
42
42
  }
43
43
  };
44
44
  }, W = (t) => {
45
45
  const e = t?.drilldown_data ?? {};
46
46
  return {
47
47
  transaction_guids: N(e.transaction_guids),
48
- date: H(e.due_date),
48
+ date: Y(e.due_date),
49
49
  amount: m(e.amount),
50
50
  category_guid: b(e.category_guid),
51
51
  average_amount: m(e.average_amount),
@@ -54,15 +54,15 @@ var i = {
54
54
  }, _ = (t) => {
55
55
  const e = t;
56
56
  return Array.isArray(e?.names) && Array.isArray(e?.data) ? e : void 0;
57
- }, j = (t) => {
57
+ }, k = (t) => {
58
58
  const e = t?.drilldown_data ?? {};
59
59
  return {
60
60
  account_guids: N(e.account_guids),
61
61
  data_series: _(e.data_series),
62
62
  average_amount: m(e.average_amount)
63
63
  };
64
- }, R = ["income", "other"], k = (t) => {
65
- const e = t?.drilldown_data ?? {}, a = t?.instance_slot?.data?.legends?.map(({ label: r }) => r);
64
+ }, R = ["income", "other"], j = (t) => {
65
+ const e = t?.drilldown_data ?? {}, a = t?.instance_slot?.data?.legends?.map(({ label: o }) => o);
66
66
  return {
67
67
  data_series: _(e.data_series),
68
68
  average_amount: m(e.average_amount),
@@ -70,57 +70,57 @@ var i = {
70
70
  sub_tab_labels: a?.length === R.length ? a : void 0
71
71
  };
72
72
  }, z = 2, K = (t, e) => {
73
- const a = e ?? {}, r = _(a.series), o = Array.isArray(a.labels) ? a.labels.map(b) : [];
74
- return !r || o.length !== z || !o.every((s) => !!s) ? {} : {
75
- data_series: r,
76
- legends: o.map((s) => ({
73
+ const a = e ?? {}, o = _(a.series), r = Array.isArray(a.labels) ? a.labels.map(b) : [];
74
+ return !o || r.length !== z || !r.every((s) => !!s) ? {} : {
75
+ data_series: o,
76
+ legends: r.map((s) => ({
77
77
  label: s,
78
78
  value: 0
79
79
  }))
80
80
  };
81
- }, $ = (t, e) => M(_(e?.series)).flatMap((a) => a.aggregated_guids ?? []), q = (t, e) => {
82
- const a = e.transaction_history_block?.monthly_debt_to_income_tip_message, r = e.transaction_history_block?.monthly_debt_to_income_tip_limit;
83
- if (!(!a || !r))
81
+ }, q = (t, e) => M(_(e?.series)).flatMap((a) => a.aggregated_guids ?? []), J = (t, e) => {
82
+ const a = e.transaction_history_block?.monthly_debt_to_income_tip_message, o = e.transaction_history_block?.monthly_debt_to_income_tip_limit;
83
+ if (!(!a || !o))
84
84
  return {
85
- message: h(a, /* @__PURE__ */ c("strong", { children: e.general.tip_section_title }), /* @__PURE__ */ c("strong", { children: r })),
85
+ message: h(a, /* @__PURE__ */ c("strong", { children: e.general.tip_section_title }), /* @__PURE__ */ c("strong", { children: o })),
86
86
  onDismiss: () => t(!0)
87
87
  };
88
- }, J = (t) => M(_(t.insights_payload?.drilldown_data?.data_series)).flatMap((e) => e.aggregated_guids ?? []), Q = (t, e) => {
89
- const a = w(t, e);
88
+ }, Q = (t) => M(_(t.insights_payload?.drilldown_data?.data_series)).flatMap((e) => e.aggregated_guids ?? []), X = (t, e) => {
89
+ const a = H(t, e);
90
90
  return a ? [...t, a] : t;
91
- }, X = (t, e, a, r) => {
92
- const o = r?.merchant_name, s = r?.date;
93
- if (!o || !s) return;
91
+ }, Z = (t, e, a, o) => {
92
+ const r = o?.merchant_name, s = o?.date;
93
+ if (!r || !s) return;
94
94
  const n = e.transaction_history_block?.upcoming_bill_tip_message;
95
95
  if (n)
96
96
  return {
97
- message: h(n, /* @__PURE__ */ c("strong", { children: e.general.tip_section_title }), o, E(p(s), D.FULL_MONTH_DAY)),
97
+ message: h(n, /* @__PURE__ */ c("strong", { children: e.general.tip_section_title }), r, E(p(s), D.FULL_MONTH_DAY)),
98
98
  onDismiss: () => t(!0)
99
99
  };
100
100
  }, v = ({ beatTransactions: t, dataSeries: e, selectedIndex: a }) => {
101
- const r = e[a], o = r?.guid, s = t.find((n) => n.guid === o)?.has_been_split;
101
+ const o = e[a], r = o?.guid, s = t.find((n) => n.guid === r)?.has_been_split;
102
102
  return {
103
- custom: (n) => n.guid === o,
104
- dateRange: S(r?.date),
103
+ custom: (n) => n.guid === r,
104
+ dateRange: S(o?.date),
105
105
  showSplits: !s
106
106
  };
107
- }, Z = ({ dataSeries: t, selectedIndex: e, instanceSlotData: a }) => {
108
- const r = t[e], o = a.category_guid ?? r?.guid;
107
+ }, $ = ({ dataSeries: t, selectedIndex: e, instanceSlotData: a }) => {
108
+ const o = t[e], r = a.category_guid ?? o?.guid;
109
109
  return {
110
- custom: (s) => s.category_guid === o || s.top_level_category_guid === o,
111
- dateRange: S(r?.date)
110
+ custom: (s) => s.category_guid === r || s.top_level_category_guid === r,
111
+ dateRange: S(o?.date)
112
112
  };
113
- }, tt = ({ dataSeries: t, selectedIndex: e, spendCategoryGuids: a, instanceSlotData: r }) => {
114
- const o = t[e];
113
+ }, tt = ({ dataSeries: t, selectedIndex: e, spendCategoryGuids: a, instanceSlotData: o }) => {
114
+ const r = t[e];
115
115
  return {
116
116
  custom: (s) => !!s.top_level_category_guid && a.includes(s.top_level_category_guid),
117
- dateRange: S(o?.date),
118
- ...G(r.account_guids)
117
+ dateRange: S(r?.date),
118
+ ...G(o.account_guids)
119
119
  };
120
- }, et = (t) => typeof t == "number" ? x(t) : p(t ?? ""), at = ({ beat: t, dataSeries: e, selectedIndex: a, isLastTab: r, instanceSlotData: o }) => {
121
- const s = e[a], { start: n, end: g } = S(s?.date), l = et(t.created_at), u = o.account_guids, O = {
120
+ }, et = (t) => typeof t == "number" ? x(t) : p(t ?? ""), at = ({ beat: t, dataSeries: e, selectedIndex: a, isLastTab: o, instanceSlotData: r }) => {
121
+ const s = e[a], { start: n, end: g } = S(s?.date), l = et(t.created_at), u = r.account_guids, O = {
122
122
  start: n,
123
- end: r && L(l) && l < g ? l : g
123
+ end: o && L(l) && l < g ? l : g
124
124
  };
125
125
  return u?.length ? {
126
126
  dateRange: O,
@@ -131,23 +131,23 @@ var i = {
131
131
  custom: () => !1
132
132
  };
133
133
  }, f = (t, e, a) => {
134
- const r = new Set(t), o = p(e ?? "");
135
- return !r.size || !L(o) ? {
134
+ const o = new Set(t), r = p(e ?? "");
135
+ return !o.size || !L(r) ? {
136
136
  accounts: [],
137
137
  custom: () => !1
138
138
  } : {
139
- custom: (s) => r.has(s.guid),
139
+ custom: (s) => o.has(s.guid),
140
140
  dateRange: {
141
- start: B(o),
142
- end: C(o)
141
+ start: B(r),
142
+ end: C(r)
143
143
  },
144
144
  ...G(a)
145
145
  };
146
- }, rt = ({ beat: t, dataSeries: e, selectedIndex: a }) => f(e[a]?.aggregated_guids, e[a]?.date, t.account_guids), y = ({ beat: t, comparisonBars: e, selectedIndex: a, subIndex: r }) => {
147
- const o = e[a];
148
- return f(r === 1 ? o?.comparisonGuids : o?.mainGuids, o?.date, t.account_guids);
149
- }, ot = ({ beat: t, dataSeries: e, subIndex: a }) => f(e[a]?.aggregated_guids, e[a]?.date, t.account_guids), st = (t) => {
150
- const { dataSeries: e, selectedIndex: a, subIndex: r, instanceSlotData: o } = t, s = e[a], n = new Set(o.income_transaction_guids), g = R[r] === "income", l = o.sub_tab_labels ? s?.aggregated_guids?.filter((u) => n.has(u) === g) : s?.aggregated_guids;
146
+ }, ot = ({ beat: t, dataSeries: e, selectedIndex: a }) => f(e[a]?.aggregated_guids, e[a]?.date, t.account_guids), y = ({ beat: t, comparisonBars: e, selectedIndex: a, subIndex: o }) => {
147
+ const r = e[a];
148
+ return f(o === 1 ? r?.comparisonGuids : r?.mainGuids, r?.date, t.account_guids);
149
+ }, rt = ({ beat: t, dataSeries: e, subIndex: a }) => f(e[a]?.aggregated_guids, e[a]?.date, t.account_guids), st = (t) => {
150
+ const { dataSeries: e, selectedIndex: a, subIndex: o, instanceSlotData: r } = t, s = e[a], n = new Set(r.income_transaction_guids), g = R[o] === "income", l = r.sub_tab_labels ? s?.aggregated_guids?.filter((u) => n.has(u) === g) : s?.aggregated_guids;
151
151
  return f(l, s?.date);
152
152
  }, yt = {
153
153
  [i.TRANSACTION]: {
@@ -161,10 +161,11 @@ var i = {
161
161
  return {
162
162
  heading: e,
163
163
  subHeadingText: a?.text || void 0,
164
- icon: /* @__PURE__ */ c(Y, {
165
- alt: a?.text,
166
- categoryGuid: a?.logo?.category_guid || "",
167
- merchantGuid: a?.logo?.merchant_guid || "",
164
+ icon: /* @__PURE__ */ c(w, {
165
+ logo: {
166
+ ...a?.logo,
167
+ merchant_name: a?.text ?? a?.logo?.merchant_name
168
+ },
168
169
  size: 16
169
170
  })
170
171
  };
@@ -177,7 +178,7 @@ var i = {
177
178
  [i.CATEGORY_SPEND]: {
178
179
  top: "singleBar",
179
180
  averageFormat: "0,0",
180
- filterStrategy: Z,
181
+ filterStrategy: $,
181
182
  scope: "store",
182
183
  filterMode: "store",
183
184
  colors: (t, e) => [d(t, e)],
@@ -201,7 +202,7 @@ var i = {
201
202
  [i.ACCOUNT_BALANCE]: {
202
203
  top: "singleBar",
203
204
  filterStrategy: at,
204
- slotData: j,
205
+ slotData: k,
205
206
  scope: "store",
206
207
  filterMode: "store",
207
208
  colors: (t) => [t.palette.success.main]
@@ -213,9 +214,9 @@ var i = {
213
214
  filterMode: "local",
214
215
  colors: (t, e) => [d(t, e)],
215
216
  slotData: W,
216
- beatTransactions: Q,
217
+ beatTransactions: X,
217
218
  fetchMissingTransactions: (t) => t.insights_payload?.drilldown_data?.transaction_guids,
218
- tipSection: X
219
+ tipSection: Z
219
220
  },
220
221
  [i.DEPOSIT_SUMMARY]: {
221
222
  top: "singleBar",
@@ -223,8 +224,8 @@ var i = {
223
224
  scope: "store",
224
225
  filterMode: "store",
225
226
  colors: (t) => [t.palette.success.main],
226
- slotData: k,
227
- fetchMissingTransactions: J,
227
+ slotData: j,
228
+ fetchMissingTransactions: Q,
228
229
  subTabs: ({ instanceSlotData: t }) => t.sub_tab_labels ?? []
229
230
  },
230
231
  [i.LOW_BALANCE]: {
@@ -237,7 +238,7 @@ var i = {
237
238
  },
238
239
  [i.SUBSCRIPTION_AGGREGATE]: {
239
240
  top: "monthTabs",
240
- filterStrategy: rt,
241
+ filterStrategy: ot,
241
242
  scope: "store",
242
243
  filterMode: "store",
243
244
  colors: (t) => [t.palette.primary.main]
@@ -266,14 +267,14 @@ var i = {
266
267
  colors: (t) => I(t, "debt_to_income")?.color ?? [],
267
268
  subTabAriaLabels: (t) => [void 0, t.general.income_transactions],
268
269
  slotData: K,
269
- fetchMissingTransactions: $,
270
- tipSection: q,
270
+ fetchMissingTransactions: q,
271
+ tipSection: J,
271
272
  tipAboveSubTabs: !0,
272
273
  hideListHeader: !0
273
274
  },
274
275
  [i.NON_ESSENTIAL_CATEGORY]: {
275
276
  top: "tabsOnly",
276
- filterStrategy: ot,
277
+ filterStrategy: rt,
277
278
  scope: "store",
278
279
  filterMode: "store",
279
280
  colors: (t) => [t.palette.primary.main]
@@ -290,10 +291,10 @@ export {
290
291
  bt as FALLBACK,
291
292
  yt as layout,
292
293
  K as resolveDebtToIncomeSlotData,
293
- k as resolveDepositSummarySlotData,
294
- j as resolveSavingsContributionsSlotData,
294
+ j as resolveDepositSummarySlotData,
295
+ k as resolveSavingsContributionsSlotData,
295
296
  W as resolveUpcomingBillSlotData,
296
- Q as resolveUpcomingBillTransactions
297
+ X as resolveUpcomingBillTransactions
297
298
  };
298
299
 
299
300
  //# sourceMappingURL=layout.es.js.map