@mx-cartographer/experiences 9.7.159 → 9.7.161

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 (81) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/common/components/CurrencyDialog.d.ts +11 -1
  3. package/dist/common/components/CurrencyDialog.es.js +50 -44
  4. package/dist/common/components/CurrencyDialog.es.js.map +1 -1
  5. package/dist/common/components/ErrorBoundary.d.ts +1 -0
  6. package/dist/common/components/ErrorBoundary.es.js +1 -1
  7. package/dist/common/components/ErrorBoundary.es.js.map +1 -1
  8. package/dist/common/components/index.d.ts +1 -1
  9. package/dist/core/types/localization/InsightsFeedCopy.d.ts +8 -0
  10. package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.d.ts +2 -0
  11. package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js +39 -39
  12. package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js.map +1 -1
  13. package/dist/insights-v2/actionBlocks/AccountListBlock/index.d.ts +1 -1
  14. package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js +40 -35
  15. package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js.map +1 -1
  16. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.d.ts +1 -1
  17. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js +91 -91
  18. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js.map +1 -1
  19. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/layout.d.ts +42 -2
  20. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/layout.es.js +75 -15
  21. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/layout.es.js.map +1 -1
  22. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.d.ts +2 -0
  23. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js +73 -74
  24. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js.map +1 -1
  25. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/index.d.ts +1 -1
  26. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.d.ts +2 -0
  27. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.es.js +20 -21
  28. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.es.js.map +1 -1
  29. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/index.d.ts +1 -1
  30. package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.d.ts +2 -0
  31. package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js +36 -38
  32. package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js.map +1 -1
  33. package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/index.d.ts +1 -1
  34. package/dist/insights-v2/actionBlocks/OverdraftBlock/OverdraftBlock.d.ts +2 -0
  35. package/dist/insights-v2/actionBlocks/OverdraftBlock/OverdraftBlock.es.js +29 -30
  36. package/dist/insights-v2/actionBlocks/OverdraftBlock/OverdraftBlock.es.js.map +1 -1
  37. package/dist/insights-v2/actionBlocks/OverdraftBlock/index.d.ts +1 -1
  38. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.d.ts +2 -0
  39. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js +60 -59
  40. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js.map +1 -1
  41. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/index.d.ts +1 -1
  42. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.d.ts +2 -0
  43. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js +20 -20
  44. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js.map +1 -1
  45. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/index.d.ts +1 -1
  46. package/dist/insights-v2/actionBlocks/PlaceholderActionBlock.es.js.map +1 -1
  47. package/dist/insights-v2/actionBlocks/QuizMerchantBlock/QuizMerchantBlock.es.js +3 -3
  48. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.d.ts +2 -0
  49. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js +36 -36
  50. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js.map +1 -1
  51. package/dist/insights-v2/actionBlocks/RemainingCashBlock/index.d.ts +1 -1
  52. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.d.ts +2 -1
  53. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +77 -76
  54. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
  55. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js +64 -59
  56. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js.map +1 -1
  57. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListCreditLimitHeader.d.ts +11 -0
  58. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListCreditLimitHeader.es.js +138 -0
  59. package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListCreditLimitHeader.es.js.map +1 -0
  60. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.d.ts +13 -0
  61. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js +80 -63
  62. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js.map +1 -1
  63. package/dist/insights-v2/actionBlocks/useRequiredCopy.d.ts +3 -0
  64. package/dist/insights-v2/actionBlocks/useRequiredCopy.es.js +11 -0
  65. package/dist/insights-v2/actionBlocks/useRequiredCopy.es.js.map +1 -0
  66. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js +14 -14
  67. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js.map +1 -1
  68. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/layout.d.ts +9 -2
  69. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/layout.es.js +14 -7
  70. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/layout.es.js.map +1 -1
  71. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/utils.d.ts +7 -1
  72. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/utils.es.js +14 -7
  73. package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/utils.es.js.map +1 -1
  74. package/dist/insights-v2/blocks/ComponentBlocks/SavingsSummaryBlock/SavingsSummaryBlock.es.js +1 -1
  75. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js +4 -4
  76. package/dist/insights-v2/components/CompactInsightCard.es.js +164 -138
  77. package/dist/insights-v2/components/CompactInsightCard.es.js.map +1 -1
  78. package/dist/insights-v2/mappings/blocks.d.ts +1 -0
  79. package/dist/insights-v2/mappings/blocks.es.js +190 -178
  80. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  81. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## [9.7.161] - 11-16-2026
2
+
3
+ - **ADDED** - Credit Card Close to Limit experiences Insights V2 changes (WEC-2030)
4
+
5
+ ## [9.7.160] - 11-16-2026
6
+
7
+ - **ADDED** - `ErrorBoundary` (`./common`) accepts an optional `fallback`; without it the default message is unchanged (WEC-2262)
8
+ - **CHANGED** - Insights 2.0 action block registry entries declare their copy section; `ActionBlockLayer` shows the shared error message when it is missing instead of each block checking its own copy (WEC-2262)
9
+ - **CHANGED** - An action block that throws while rendering shows the shared error message inside its drawer and is reported, instead of crashing the feed (WEC-2262)
10
+ - **CHANGED** - A drawer whose block copy is missing is titled with `common.error_heading`, like the unknown-block drawer (WEC-2262)
11
+
1
12
  ## [9.7.159] - 11-16-2026
2
13
 
3
14
  - **FIXED** - Monthly Obligations Status: the On Track and Off Track amounts use the same H2 weight; Monthly Savings to Income Comparison: the card chart matches the Figma height and spacing (WEC-2115)
@@ -1,5 +1,14 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { ButtonProps } from '@mui/material/Button';
3
+ declare const UNIT_ADORNMENTS: {
4
+ currency: {
5
+ startAdornment: import("react/jsx-runtime").JSX.Element;
6
+ };
7
+ percent: {
8
+ endAdornment: import("react/jsx-runtime").JSX.Element;
9
+ };
10
+ };
11
+ export type CurrencyDialogUnit = keyof typeof UNIT_ADORNMENTS;
3
12
  interface CurrencyDialogProps {
4
13
  closeAriaLabel: string;
5
14
  /** Body copy; a node so callers can emphasise part of it (e.g. a bold account name). */
@@ -27,6 +36,7 @@ interface CurrencyDialogProps {
27
36
  /** A line under the title, e.g. the account a setting applies to. */
28
37
  subtitle?: ReactNode;
29
38
  title: string;
39
+ unit?: CurrencyDialogUnit;
30
40
  }
31
- declare const CurrencyDialog: ({ closeAriaLabel, content, errorText, inputLabel, inputValue, isOpen, isPrimaryDisabled, handleInputChange, handleInputClick, handleModalClose, handlePrimaryAction, handleSecondaryAction, primaryColor, primaryText, secondaryColor, secondaryText, subtitle, title, }: CurrencyDialogProps) => import("react/jsx-runtime").JSX.Element;
41
+ declare const CurrencyDialog: ({ closeAriaLabel, content, errorText, inputLabel, inputValue, isOpen, isPrimaryDisabled, handleInputChange, handleInputClick, handleModalClose, handlePrimaryAction, handleSecondaryAction, primaryColor, primaryText, secondaryColor, secondaryText, subtitle, title, unit, }: CurrencyDialogProps) => import("react/jsx-runtime").JSX.Element;
32
42
  export default CurrencyDialog;
@@ -1,34 +1,43 @@
1
- import { useScreenSize as S } from "../hooks/useScreenSize.es.js";
2
- import n from "@mui/material/Stack";
3
- import { H3 as j, P as M } from "@mxenabled/mxui";
1
+ import { useScreenSize as N } from "../hooks/useScreenSize.es.js";
2
+ import l from "@mui/material/Stack";
3
+ import { H3 as j, P as A } from "@mxenabled/mxui";
4
4
  import f from "@mui/material/Button";
5
5
  import { Icon as $ } from "@mxenabled/mx-icons";
6
- import { jsx as o, jsxs as t } from "react/jsx-runtime";
6
+ import { jsx as o, jsxs as r } from "react/jsx-runtime";
7
7
  import B from "@mui/material/Dialog";
8
8
  import F from "@mui/material/DialogContent";
9
9
  import H from "@mui/material/IconButton";
10
10
  import w from "@mui/material/DialogActions";
11
- import A from "@mui/material/InputAdornment";
12
- import N from "@mui/material/TextField";
13
- var X = ({ closeAriaLabel: h, content: g, errorText: a, inputLabel: r, inputValue: i, isOpen: u, isPrimaryDisabled: x = !1, handleInputChange: b, handleInputClick: C, handleModalClose: m, handlePrimaryAction: s, handleSecondaryAction: D, primaryColor: k = "primary", primaryText: p, secondaryColor: v = "primary", secondaryText: l, subtitle: y, title: c }) => {
14
- const d = x || (r ? !(i !== "" && i !== "0" && !isNaN(parseFloat(i ?? "0"))) : !1), { isSmallMobile: I } = S();
11
+ import h from "@mui/material/InputAdornment";
12
+ import P from "@mui/material/TextField";
13
+ var W = {
14
+ currency: { startAdornment: /* @__PURE__ */ o(h, {
15
+ position: "start",
16
+ children: "$"
17
+ }) },
18
+ percent: { endAdornment: /* @__PURE__ */ o(h, {
19
+ position: "end",
20
+ children: "%"
21
+ }) }
22
+ }, X = ({ closeAriaLabel: u, content: g, errorText: a, inputLabel: t, inputValue: e, isOpen: x, isPrimaryDisabled: b = !1, handleInputChange: C, handleInputClick: D, handleModalClose: c, handlePrimaryAction: m, handleSecondaryAction: y, primaryColor: v = "primary", primaryText: s, secondaryColor: I = "primary", secondaryText: n, subtitle: k, title: p, unit: S = "currency" }) => {
23
+ const d = b || (t ? !(e !== "" && e !== "0" && !isNaN(parseFloat(e ?? "0"))) : !1), { isSmallMobile: M } = N();
15
24
  return /* @__PURE__ */ o(B, {
16
- "aria-label": c,
25
+ "aria-label": p,
17
26
  "aria-labelledby": "modal-title",
18
27
  maxWidth: "xs",
19
- onClose: m,
20
- open: u,
28
+ onClose: c,
29
+ open: x,
21
30
  role: "dialog",
22
31
  sx: {
23
32
  "& .MuiDialogContent-root": { p: 0 },
24
- ...I && { "& .MuiDialog-paper": { minWidth: "100%" } }
33
+ ...M && { "& .MuiDialog-paper": { minWidth: "100%" } }
25
34
  },
26
- children: /* @__PURE__ */ o(F, { children: /* @__PURE__ */ t("form", {
27
- onSubmit: (e) => {
28
- e.preventDefault(), d || s();
35
+ children: /* @__PURE__ */ o(F, { children: /* @__PURE__ */ r("form", {
36
+ onSubmit: (i) => {
37
+ i.preventDefault(), d || m();
29
38
  },
30
39
  children: [
31
- /* @__PURE__ */ t(n, {
40
+ /* @__PURE__ */ r(l, {
32
41
  sx: {
33
42
  alignItems: "center",
34
43
  flexDirection: "row",
@@ -39,15 +48,15 @@ var X = ({ closeAriaLabel: h, content: g, errorText: a, inputLabel: r, inputValu
39
48
  pr: 16,
40
49
  pt: 24
41
50
  },
42
- children: [/* @__PURE__ */ t(n, {
51
+ children: [/* @__PURE__ */ r(l, {
43
52
  sx: { gap: 4 },
44
53
  children: [/* @__PURE__ */ o(j, {
45
54
  id: "modal-title",
46
- children: c
47
- }), y]
55
+ children: p
56
+ }), k]
48
57
  }), /* @__PURE__ */ o(H, {
49
- "aria-label": h,
50
- onClick: m,
58
+ "aria-label": u,
59
+ onClick: c,
51
60
  sx: {
52
61
  minHeight: 24,
53
62
  position: "absolute",
@@ -60,59 +69,56 @@ var X = ({ closeAriaLabel: h, content: g, errorText: a, inputLabel: r, inputValu
60
69
  })
61
70
  })]
62
71
  }),
63
- /* @__PURE__ */ t(n, {
72
+ /* @__PURE__ */ r(l, {
64
73
  sx: {
65
74
  gap: 24,
66
75
  px: 24
67
76
  },
68
- children: [/* @__PURE__ */ o(M, {
77
+ children: [/* @__PURE__ */ o(A, {
69
78
  variant: "subtitle1",
70
79
  children: g
71
- }), r && /* @__PURE__ */ o(N, {
80
+ }), t && /* @__PURE__ */ o(P, {
72
81
  autoFocus: !0,
73
82
  error: !!a,
74
83
  helperText: a,
75
84
  inputMode: "decimal",
76
- label: r,
77
- onChange: ({ target: { value: e } }) => {
78
- /^\d*\.?\d*$/.test(e) && b?.(e);
85
+ label: t,
86
+ onChange: ({ target: { value: i } }) => {
87
+ /^\d*\.?\d*$/.test(i) && C?.(i);
79
88
  },
80
- onClick: C,
89
+ onClick: D,
81
90
  slotProps: {
82
- input: { startAdornment: /* @__PURE__ */ o(A, {
83
- position: "start",
84
- children: "$"
85
- }) },
91
+ input: W[S],
86
92
  formHelperText: { role: "alert" },
87
93
  htmlInput: {
88
- "aria-label": r,
94
+ "aria-label": t,
89
95
  noValidate: !0,
90
96
  pattern: "[0-9]*\\.?[0-9]*"
91
97
  }
92
98
  },
93
99
  type: "text",
94
- value: i
100
+ value: e
95
101
  })]
96
102
  }),
97
- /* @__PURE__ */ t(w, {
103
+ /* @__PURE__ */ r(w, {
98
104
  sx: {
99
105
  justifyContent: "flex-end",
100
106
  gap: 16,
101
107
  p: 24,
102
108
  ">:not(style)~:not(style)": { ml: 0 }
103
109
  },
104
- children: [l && /* @__PURE__ */ o(f, {
105
- "aria-label": l,
106
- color: v,
107
- onClick: D,
108
- children: l
110
+ children: [n && /* @__PURE__ */ o(f, {
111
+ "aria-label": n,
112
+ color: I,
113
+ onClick: y,
114
+ children: n
109
115
  }), /* @__PURE__ */ o(f, {
110
- "aria-label": p,
111
- color: k,
116
+ "aria-label": s,
117
+ color: v,
112
118
  disabled: d,
113
- onClick: s,
119
+ onClick: m,
114
120
  variant: "contained",
115
- children: p
121
+ children: s
116
122
  })]
117
123
  })
118
124
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"CurrencyDialog.es.js","names":[],"sources":["../../../src/common/components/CurrencyDialog.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { H3, P } from '@mxenabled/mxui'\n\nimport Button, { type ButtonProps } from '@mui/material/Button'\nimport Dialog from '@mui/material/Dialog'\nimport DialogActions from '@mui/material/DialogActions'\nimport DialogContent from '@mui/material/DialogContent'\nimport IconButton from '@mui/material/IconButton'\nimport InputAdornment from '@mui/material/InputAdornment'\nimport Stack from '@mui/material/Stack'\nimport TextField from '@mui/material/TextField'\n\nimport { useScreenSize } from '../hooks'\n\ninterface CurrencyDialogProps {\n closeAriaLabel: string\n /** Body copy; a node so callers can emphasise part of it (e.g. a bold account name). */\n content?: ReactNode\n /** Validation or save error, shown under the input and marking it invalid. */\n errorText?: string\n inputLabel?: string\n inputValue?: string\n isOpen: boolean\n /** Disables the primary button on top of the built-in input check (e.g. while saving). */\n isPrimaryDisabled?: boolean\n handleInputChange?: (value: string) => void\n /**\n * Click on the amount input (e.g. analytics). Click, not focus: the input autofocuses on open,\n * so a focus callback would fire per open rather than per user interaction.\n */\n handleInputClick?: () => void\n handleModalClose: () => void\n handlePrimaryAction: () => void\n handleSecondaryAction?: () => void\n primaryColor?: ButtonProps['color']\n primaryText: string\n secondaryColor?: ButtonProps['color']\n secondaryText?: string\n /** A line under the title, e.g. the account a setting applies to. */\n subtitle?: ReactNode\n title: string\n}\n\n// Created for V2 of BudgetDetailsDrawer.\n// The previous design will be replaced once the new design is finalized.\n// Also needs to be updated to use the mxui library\n// with the updated Dialog components.\n\nconst CurrencyDialog = ({\n closeAriaLabel,\n content,\n errorText,\n inputLabel,\n inputValue,\n isOpen,\n isPrimaryDisabled = false,\n handleInputChange,\n handleInputClick,\n handleModalClose,\n handlePrimaryAction,\n handleSecondaryAction,\n primaryColor = 'primary',\n primaryText,\n secondaryColor = 'primary',\n secondaryText,\n subtitle,\n title,\n}: CurrencyDialogProps) => {\n const numericValue = parseFloat(inputValue ?? '0')\n const isValid = inputValue !== '' && inputValue !== '0' && !isNaN(numericValue)\n // One rule for the button and for Enter: the form's submit must not bypass a disabled button.\n const isPrimaryBlocked = isPrimaryDisabled || (inputLabel ? !isValid : false)\n\n const { isSmallMobile } = useScreenSize()\n\n return (\n <Dialog\n aria-label={title}\n aria-labelledby=\"modal-title\"\n maxWidth=\"xs\"\n onClose={handleModalClose}\n open={isOpen}\n role=\"dialog\"\n sx={{\n '& .MuiDialogContent-root': { p: 0 },\n ...(isSmallMobile && { '& .MuiDialog-paper': { minWidth: '100%' } }),\n }}\n >\n <DialogContent>\n <form\n onSubmit={(e) => {\n e.preventDefault()\n if (!isPrimaryBlocked) handlePrimaryAction()\n }}\n >\n <Stack\n sx={{\n alignItems: 'center',\n flexDirection: 'row',\n justifyContent: 'space-between',\n pb: 12,\n pl: 24,\n position: 'relative',\n pr: 16,\n pt: 24,\n }}\n >\n <Stack sx={{ gap: 4 }}>\n <H3 id=\"modal-title\">{title}</H3>\n {subtitle}\n </Stack>\n <IconButton\n aria-label={closeAriaLabel}\n onClick={handleModalClose}\n sx={{ minHeight: 24, position: 'absolute', right: 8, top: 18 }}\n >\n <Icon name=\"close\" sx={{ color: 'action.active' }} />\n </IconButton>\n </Stack>\n <Stack sx={{ gap: 24, px: 24 }}>\n <P variant=\"subtitle1\">{content}</P>\n {inputLabel && (\n <TextField\n autoFocus={true}\n error={!!errorText}\n helperText={errorText}\n inputMode=\"decimal\"\n label={inputLabel}\n onChange={({ target: { value } }) => {\n if (!/^\\d*\\.?\\d*$/.test(value)) return\n\n handleInputChange?.(value)\n }}\n onClick={handleInputClick}\n slotProps={{\n input: {\n startAdornment: <InputAdornment position=\"start\">$</InputAdornment>,\n },\n // Announce errors: focus is usually on the primary button when one appears.\n formHelperText: { role: 'alert' },\n htmlInput: {\n 'aria-label': inputLabel,\n noValidate: true,\n pattern: '[0-9]*\\\\.?[0-9]*',\n },\n }}\n type=\"text\"\n value={inputValue}\n />\n )}\n </Stack>\n <DialogActions\n sx={{\n justifyContent: 'flex-end',\n gap: 16,\n p: 24,\n '>:not(style)~:not(style)': { ml: 0 },\n }}\n >\n {secondaryText && (\n <Button\n aria-label={secondaryText}\n color={secondaryColor}\n onClick={handleSecondaryAction}\n >\n {secondaryText}\n </Button>\n )}\n <Button\n aria-label={primaryText}\n color={primaryColor}\n disabled={isPrimaryBlocked}\n onClick={handlePrimaryAction}\n variant=\"contained\"\n >\n {primaryText}\n </Button>\n </DialogActions>\n </form>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport default CurrencyDialog\n"],"mappings":";;;;;;;;;;;;AAkDA,IAAM,IAAA,CAAkB,EACtB,gBAAA,GACA,SAAA,GACA,WAAA,GACA,YAAA,GACA,YAAA,GACA,QAAA,GACA,mBAAA,IAAoB,IACpB,mBAAA,GACA,kBAAA,GACA,kBAAA,GACA,qBAAA,GACA,uBAAA,GACA,cAAA,IAAe,WACf,aAAA,GACA,gBAAA,IAAiB,WACjB,eAAA,GACA,UAAA,GACA,OAAA,EAAA,MACyB;AAIzB,QAAM,IAAmB,MAAsB,IAAa,EAF5C,MAAe,MAAM,MAAe,OAAO,CAAC,MADvC,WAAW,KAAc,GACoB,CAAY,KAEP,KAEjE,EAAE,eAAA,EAAA,IAAkB,EAAc;AAExC,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,cAAY;AAAA,IACZ,mBAAgB;AAAA,IAChB,UAAS;AAAA,IACT,SAAS;AAAA,IACT,MAAM;AAAA,IACN,MAAK;AAAA,IACL,IAAI;AAAA,MACF,4BAA4B,EAAE,GAAG,EAAE;AAAA,MACnC,GAAI,KAAiB,EAAE,sBAAsB,EAAE,UAAU,OAAO,EAAE;AAAA,IACpE;AAAA,IAEA,UAAA,gBAAA,EAAC,GAAD,EAAA,UACE,gBAAA,EAAC,QAAD;AAAA,MACE,UAAA,CAAW,MAAM;AACf,UAAE,eAAe,GACZ,KAAkB,EAAoB;AAAA,MAC7C;AAAA,MAJF,UAAA;AAAA,QAME,gBAAA,EAAC,GAAD;AAAA,UACE,IAAI;AAAA,YACF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AAiB,CAAA,EACpE;AAAA,cAEA,gBAAgB,EAAE,MAAM,QAAQ;AAAA,cAChC,WAAW;AAAA,gBACT,cAAc;AAAA,gBACd,YAAY;AAAA,gBACZ,SAAS;AAAA,cACX;AAAA,YACF;AAAA,YACA,MAAK;AAAA,YACL,OAAO;AAAA,UACR,CAAA,CAEE;AAAA;QACP,gBAAA,EAAC,GAAD;AAAA,UACE,IAAI;AAAA,YACF,gBAAgB;AAAA,YAChB,KAAK;AAAA,YACL,GAAG;AAAA,YACH,4BAA4B,EAAE,IAAI,EAAE;AAAA,UACtC;AAAA,UANF,UAAA,CAQG,KACC,gBAAA,EAAC,GAAD;AAAA,YACE,cAAY;AAAA,YACZ,OAAO;AAAA,YACP,SAAS;AAAA,YAER,UAAA;AAAA,UACK,CAAA,GAEV,gBAAA,EAAC,GAAD;AAAA,YACE,cAAY;AAAA,YACZ,OAAO;AAAA,YACP,UAAU;AAAA,YACV,SAAS;AAAA,YACT,SAAQ;AAAA,YAEP,UAAA;AAAA,UACK,CAAA,CACK;AAAA;MACX;AAAA,IACO,CAAA,EAAA,CAAA;AAAA,EACT,CAAA;AAEZ"}
1
+ {"version":3,"file":"CurrencyDialog.es.js","names":[],"sources":["../../../src/common/components/CurrencyDialog.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { H3, P } from '@mxenabled/mxui'\n\nimport Button, { type ButtonProps } from '@mui/material/Button'\nimport Dialog from '@mui/material/Dialog'\nimport DialogActions from '@mui/material/DialogActions'\nimport DialogContent from '@mui/material/DialogContent'\nimport IconButton from '@mui/material/IconButton'\nimport InputAdornment from '@mui/material/InputAdornment'\nimport Stack from '@mui/material/Stack'\nimport TextField from '@mui/material/TextField'\n\nimport { useScreenSize } from '../hooks'\n\nconst UNIT_ADORNMENTS = {\n currency: { startAdornment: <InputAdornment position=\"start\">$</InputAdornment> },\n percent: { endAdornment: <InputAdornment position=\"end\">%</InputAdornment> },\n}\n\nexport type CurrencyDialogUnit = keyof typeof UNIT_ADORNMENTS\n\ninterface CurrencyDialogProps {\n closeAriaLabel: string\n /** Body copy; a node so callers can emphasise part of it (e.g. a bold account name). */\n content?: ReactNode\n /** Validation or save error, shown under the input and marking it invalid. */\n errorText?: string\n inputLabel?: string\n inputValue?: string\n isOpen: boolean\n /** Disables the primary button on top of the built-in input check (e.g. while saving). */\n isPrimaryDisabled?: boolean\n handleInputChange?: (value: string) => void\n /**\n * Click on the amount input (e.g. analytics). Click, not focus: the input autofocuses on open,\n * so a focus callback would fire per open rather than per user interaction.\n */\n handleInputClick?: () => void\n handleModalClose: () => void\n handlePrimaryAction: () => void\n handleSecondaryAction?: () => void\n primaryColor?: ButtonProps['color']\n primaryText: string\n secondaryColor?: ButtonProps['color']\n secondaryText?: string\n /** A line under the title, e.g. the account a setting applies to. */\n subtitle?: ReactNode\n title: string\n unit?: CurrencyDialogUnit\n}\n\n// Created for V2 of BudgetDetailsDrawer.\n// The previous design will be replaced once the new design is finalized.\n// Also needs to be updated to use the mxui library\n// with the updated Dialog components.\n\nconst CurrencyDialog = ({\n closeAriaLabel,\n content,\n errorText,\n inputLabel,\n inputValue,\n isOpen,\n isPrimaryDisabled = false,\n handleInputChange,\n handleInputClick,\n handleModalClose,\n handlePrimaryAction,\n handleSecondaryAction,\n primaryColor = 'primary',\n primaryText,\n secondaryColor = 'primary',\n secondaryText,\n subtitle,\n title,\n unit = 'currency',\n}: CurrencyDialogProps) => {\n const numericValue = parseFloat(inputValue ?? '0')\n const isValid = inputValue !== '' && inputValue !== '0' && !isNaN(numericValue)\n // One rule for the button and for Enter: the form's submit must not bypass a disabled button.\n const isPrimaryBlocked = isPrimaryDisabled || (inputLabel ? !isValid : false)\n\n const { isSmallMobile } = useScreenSize()\n\n return (\n <Dialog\n aria-label={title}\n aria-labelledby=\"modal-title\"\n maxWidth=\"xs\"\n onClose={handleModalClose}\n open={isOpen}\n role=\"dialog\"\n sx={{\n '& .MuiDialogContent-root': { p: 0 },\n ...(isSmallMobile && { '& .MuiDialog-paper': { minWidth: '100%' } }),\n }}\n >\n <DialogContent>\n <form\n onSubmit={(e) => {\n e.preventDefault()\n if (!isPrimaryBlocked) handlePrimaryAction()\n }}\n >\n <Stack\n sx={{\n alignItems: 'center',\n flexDirection: 'row',\n justifyContent: 'space-between',\n pb: 12,\n pl: 24,\n position: 'relative',\n pr: 16,\n pt: 24,\n }}\n >\n <Stack sx={{ gap: 4 }}>\n <H3 id=\"modal-title\">{title}</H3>\n {subtitle}\n </Stack>\n <IconButton\n aria-label={closeAriaLabel}\n onClick={handleModalClose}\n sx={{ minHeight: 24, position: 'absolute', right: 8, top: 18 }}\n >\n <Icon name=\"close\" sx={{ color: 'action.active' }} />\n </IconButton>\n </Stack>\n <Stack sx={{ gap: 24, px: 24 }}>\n <P variant=\"subtitle1\">{content}</P>\n {inputLabel && (\n <TextField\n autoFocus={true}\n error={!!errorText}\n helperText={errorText}\n inputMode=\"decimal\"\n label={inputLabel}\n onChange={({ target: { value } }) => {\n if (!/^\\d*\\.?\\d*$/.test(value)) return\n\n handleInputChange?.(value)\n }}\n onClick={handleInputClick}\n slotProps={{\n input: UNIT_ADORNMENTS[unit],\n // Announce errors: focus is usually on the primary button when one appears.\n formHelperText: { role: 'alert' },\n htmlInput: {\n 'aria-label': inputLabel,\n noValidate: true,\n pattern: '[0-9]*\\\\.?[0-9]*',\n },\n }}\n type=\"text\"\n value={inputValue}\n />\n )}\n </Stack>\n <DialogActions\n sx={{\n justifyContent: 'flex-end',\n gap: 16,\n p: 24,\n '>:not(style)~:not(style)': { ml: 0 },\n }}\n >\n {secondaryText && (\n <Button\n aria-label={secondaryText}\n color={secondaryColor}\n onClick={handleSecondaryAction}\n >\n {secondaryText}\n </Button>\n )}\n <Button\n aria-label={primaryText}\n color={primaryColor}\n disabled={isPrimaryBlocked}\n onClick={handlePrimaryAction}\n variant=\"contained\"\n >\n {primaryText}\n </Button>\n </DialogActions>\n </form>\n </DialogContent>\n </Dialog>\n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AA,gBACd,YAAY;AAAA,gBACZ,SAAS;AAAA,cACX;AAAA,YACF;AAAA,YACA,MAAK;AAAA,YACL,OAAO;AAAA,UACR,CAAA,CAEE;AAAA;QACP,gBAAA,EAAC,GAAD;AAAA,UACE,IAAI;AAAA,YACF,gBAAgB;AAAA,YAChB,KAAK;AAAA,YACL,GAAG;AAAA,YACH,4BAA4B,EAAE,IAAI,EAAE;AAAA,UACtC;AAAA,UANF,UAAA,CAQG,KACC,gBAAA,EAAC,GAAD;AAAA,YACE,cAAY;AAAA,YACZ,OAAO;AAAA,YACP,SAAS;AAAA,YAER,UAAA;AAAA,UACK,CAAA,GAEV,gBAAA,EAAC,GAAD;AAAA,YACE,cAAY;AAAA,YACZ,OAAO;AAAA,YACP,UAAU;AAAA,YACV,SAAS;AAAA,YACT,SAAQ;AAAA,YAEP,UAAA;AAAA,UACK,CAAA,CACK;AAAA;MACX;AAAA,IACO,CAAA,EAAA,CAAA;AAAA,EACT,CAAA;AAEZ"}
@@ -2,6 +2,7 @@ import { default as React } from 'react';
2
2
  import { GlobalCaptureException } from '../../core';
3
3
  export interface ErrorProps {
4
4
  children?: React.ReactNode;
5
+ fallback?: React.ReactNode;
5
6
  onCaptureException?: GlobalCaptureException;
6
7
  }
7
8
  export interface ErrorState {
@@ -13,7 +13,7 @@ var a = { text: "Oops! Something went wrong." }, i = class extends o.Component {
13
13
  return { hasError: !0 };
14
14
  }
15
15
  render() {
16
- return this.state.hasError ? /* @__PURE__ */ n(e, {
16
+ return this.state.hasError ? this.props.fallback ?? /* @__PURE__ */ n(e, {
17
17
  sx: { pt: 24 },
18
18
  children: a.text
19
19
  }) : this.props.children;
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.es.js","names":[],"sources":["../../../src/common/components/ErrorBoundary.tsx"],"sourcesContent":["import React from 'react'\n\nimport { H3 } from '@mxenabled/mxui'\n\nimport type { GlobalCaptureException } from '../../core'\n\nexport interface ErrorProps {\n children?: React.ReactNode\n onCaptureException?: GlobalCaptureException\n}\n\nexport interface ErrorState {\n hasError: boolean\n}\n\nconst copy = {\n text: 'Oops! Something went wrong.',\n}\n\nclass ErrorBoundary extends React.Component<ErrorProps, ErrorState> {\n state: ErrorState = {\n hasError: false,\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n console.error('Uncaught error:', error, errorInfo)\n this.props.onCaptureException?.(error, {\n component: 'ErrorBoundary',\n componentStack: errorInfo.componentStack ?? '',\n })\n }\n\n static getDerivedStateFromError(): ErrorState {\n return { hasError: true }\n }\n\n render() {\n if (this.state.hasError) return <H3 sx={{ pt: 24 }}>{copy.text}</H3>\n\n return this.props.children\n }\n}\n\nexport default ErrorBoundary\n"],"mappings":";;;AAeA,IAAM,IAAO,EACX,MAAM,8BACR,GAEM,IAAN,cAA4B,EAAM,UAAkC;AAAA,EAClE,QAAoB,EAClB,UAAU,GACZ;AAAA,EAEA,kBAAkB,GAAc,GAA4B;AAC1D,YAAQ,MAAM,mBAAmB,GAAO,CAAS,GACjD,KAAK,MAAM,qBAAqB,GAAO;AAAA,MACrC,WAAW;AAAA,MACX,gBAAgB,EAAU,kBAAkB;AAAA,IAC9C,CAAC;AAAA,EACH;AAAA,EAEA,OAAO,2BAAuC;AAC5C,WAAO,EAAE,UAAU,GAAK;AAAA,EAC1B;AAAA,EAEA,SAAS;AACP,WAAI,KAAK,MAAM,WAAiB,gBAAA,EAAC,GAAD;AAAA,MAAI,IAAI,EAAE,IAAI,GAAG;AAAA,MAAI,UAAA,EAAK;AAAA,IAAS,CAAA,IAE5D,KAAK,MAAM;AAAA,EACpB;AACF"}
1
+ {"version":3,"file":"ErrorBoundary.es.js","names":[],"sources":["../../../src/common/components/ErrorBoundary.tsx"],"sourcesContent":["import React from 'react'\n\nimport { H3 } from '@mxenabled/mxui'\n\nimport type { GlobalCaptureException } from '../../core'\n\nexport interface ErrorProps {\n children?: React.ReactNode\n // Rendered in place of the children after an error; defaults to a generic English message.\n fallback?: React.ReactNode\n onCaptureException?: GlobalCaptureException\n}\n\nexport interface ErrorState {\n hasError: boolean\n}\n\nconst copy = {\n text: 'Oops! Something went wrong.',\n}\n\nclass ErrorBoundary extends React.Component<ErrorProps, ErrorState> {\n state: ErrorState = {\n hasError: false,\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n console.error('Uncaught error:', error, errorInfo)\n this.props.onCaptureException?.(error, {\n component: 'ErrorBoundary',\n componentStack: errorInfo.componentStack ?? '',\n })\n }\n\n static getDerivedStateFromError(): ErrorState {\n return { hasError: true }\n }\n\n render() {\n if (this.state.hasError) return this.props.fallback ?? <H3 sx={{ pt: 24 }}>{copy.text}</H3>\n\n return this.props.children\n }\n}\n\nexport default ErrorBoundary\n"],"mappings":";;;AAiBA,IAAM,IAAO,EACX,MAAM,8BACR,GAEM,IAAN,cAA4B,EAAM,UAAkC;AAAA,EAClE,QAAoB,EAClB,UAAU,GACZ;AAAA,EAEA,kBAAkB,GAAc,GAA4B;AAC1D,YAAQ,MAAM,mBAAmB,GAAO,CAAS,GACjD,KAAK,MAAM,qBAAqB,GAAO;AAAA,MACrC,WAAW;AAAA,MACX,gBAAgB,EAAU,kBAAkB;AAAA,IAC9C,CAAC;AAAA,EACH;AAAA,EAEA,OAAO,2BAAuC;AAC5C,WAAO,EAAE,UAAU,GAAK;AAAA,EAC1B;AAAA,EAEA,SAAS;AACP,WAAI,KAAK,MAAM,WAAiB,KAAK,MAAM,YAAY,gBAAA,EAAC,GAAD;AAAA,MAAI,IAAI,EAAE,IAAI,GAAG;AAAA,MAAI,UAAA,EAAK;AAAA,IAAS,CAAA,IAEnF,KAAK,MAAM;AAAA,EACpB;AACF"}
@@ -11,7 +11,7 @@ export { default as MiniWidgetContainer } from './MiniWidgetContainer';
11
11
  export { WidgetContainer } from './WidgetContainer';
12
12
  export { default as ConnectDrawer } from './ConnectDrawer';
13
13
  export { default as ConnectWidgetPanel, type ConnectWidgetPanelProps } from './ConnectWidgetPanel';
14
- export { default as CurrencyDialog } from './CurrencyDialog';
14
+ export { default as CurrencyDialog, type CurrencyDialogUnit } from './CurrencyDialog';
15
15
  export { default as CurrencyInput } from './CurrencyInput';
16
16
  export { default as Loader } from './Loader';
17
17
  export { default as ResponsiveButton } from './ResponsiveButton';
@@ -177,6 +177,10 @@ export interface TransactionHistoryBlock {
177
177
  }
178
178
  export interface TransactionListBlockCopy {
179
179
  deposit_history_drawer_title?: string;
180
+ /** Credit Card Close to Limit's Spending list (`credit_limit_header`): its title, the limit's label and `_1{percentage}` utilization. */
181
+ credit_limit_header_drawer_title?: string;
182
+ credit_limit_header_credit_limit?: string;
183
+ credit_limit_header_utilization?: string;
180
184
  /** The Subscriptions drawer's title (Monthly Subscription Aggregate V2). */
181
185
  subscriptions_drawer_title?: string;
182
186
  /** `_1{month}`: the count tile's caption, e.g. "Subscriptions in October". */
@@ -351,8 +355,12 @@ export interface AmountInputModalVariantCopy {
351
355
  export interface AmountInputModalCopy {
352
356
  low_balance_threshold: AmountInputModalVariantCopy;
353
357
  safety_net: AmountInputModalVariantCopy;
358
+ /** Credit Card Close to Limit's alert percentage; optional because older host copy lacks it. */
359
+ credit_limit_percentage?: AmountInputModalVariantCopy;
354
360
  /** Validation message for anything but a positive whole-dollar amount. */
355
361
  whole_number_error: string;
362
+ /** Validation message for anything but a whole number from 1 to 100 (credit_limit_percentage). */
363
+ percentage_error?: string;
356
364
  /** Shown in the dialog when the save request fails; the value stays so Save can be retried. */
357
365
  save_error: string;
358
366
  }
@@ -1,4 +1,6 @@
1
+ import { GlobalCopy } from '../../../core';
1
2
  import { ActionBlockProps } from '../../mappings/blocks';
3
+ export declare const selectAccountListCopy: (copy: GlobalCopy) => import('../../../core').AccountListCopy | undefined;
2
4
  /**
3
5
  * Account List drawer: the CTA's calculation, then Accounts and Recurring Expenses tabs.
4
6
  * A tapped expense opens its Expense Details, and a tapped account its Account Details (the shared
@@ -1,72 +1,71 @@
1
- import O from "../../../common/utils/AccountDisplayName.es.js";
2
- import { useAccountStore as $, useAppConfig as j, useCashflowStore as q, useGlobalCopyStore as z, useRecurringTransactionsStore as I } from "../../../common/context/hooks.es.js";
3
- import { getFrequencyLabel as M } from "../../../core/utils/RecurringTransactionsUtil.es.js";
4
- import _ from "../../../common/components/drawer/Drawer.es.js";
5
- import H from "../../../common/components/Loader.es.js";
6
- import { BlockErrorMessage as J } from "../BlockErrorMessage.es.js";
1
+ import N from "../../../common/utils/AccountDisplayName.es.js";
2
+ import { useAccountStore as O, useAppConfig as $, useCashflowStore as j, useGlobalCopyStore as z, useRecurringTransactionsStore as I } from "../../../common/context/hooks.es.js";
3
+ import { getFrequencyLabel as H } from "../../../core/utils/RecurringTransactionsUtil.es.js";
4
+ import h from "../../../common/components/drawer/Drawer.es.js";
5
+ import J from "../../../common/components/Loader.es.js";
7
6
  import K from "../../components/CategoryTile.es.js";
8
- import { useOpenedCta as P } from "../useOpenedCta.es.js";
7
+ import { useOpenedCta as M } from "../useOpenedCta.es.js";
8
+ import { useRequiredCopy as P } from "../useRequiredCopy.es.js";
9
9
  import { useRecurringExpensesLoadState as Q } from "../RecurringTransactionBlock/useRecurringTransactionPrepare.es.js";
10
10
  import { RecurringTransactionBlock as U } from "../RecurringTransactionBlock/RecurringTransactionBlock.es.js";
11
11
  import { AccountDetailsBlock as V } from "../AccountDetailsBlock/AccountDetailsBlock.es.js";
12
12
  import W from "./AccountListContent.es.js";
13
- import { buildSummary as X, isCheckingAccount as h, resolveBeatAccounts as Y, toAccountSection as k } from "./layout.es.js";
14
- import { useState as G } from "react";
13
+ import { buildSummary as X, isCheckingAccount as v, resolveBeatAccounts as Y, toAccountSection as G } from "./layout.es.js";
14
+ import { useState as T } from "react";
15
15
  import { observer as Z } from "mobx-react-lite";
16
16
  import { Fragment as tt, jsx as o, jsxs as ot } from "react/jsx-runtime";
17
- var _t = Z(function({ beat: n }) {
18
- const [i, l] = G(null), [s, m] = G(null), { accounts: p, insights_feed: T, recurring: r } = z(), { accountsLoaded: v, cashAccounts: L, visibleAccounts: d } = $(), S = P(n), { uiStore: b } = q(), { detailedRepeatingTransactions: x } = I(), { config: D } = j(), { failed: g, ready: f, retry: R } = Q(), e = T?.account_list;
19
- if (!e) return /* @__PURE__ */ o(J, {});
20
- if (!v) return /* @__PURE__ */ o(H, {});
21
- const y = Y(n, d, L), B = y.filter(h), E = y.filter((t) => !h(t)), a = D.display_available_balance_in_accounts, w = [k("checking", e.checking, B, a), k("savings", e.savings, E, a)].filter((t) => t.rows.length > 0), F = f ? [...b.expensesTilNextIncome].sort((t, c) => c.amount - t.amount).map((t) => {
22
- const c = d.find(({ guid: u }) => u === t.accountGuid), C = x.find(({ guid: u }) => u === t.repeatingTransactionGuid);
17
+ var et = (l) => l.insights_feed?.account_list, _t = Z(function({ beat: e }) {
18
+ const [n, m] = T(null), [s, p] = T(null), { accounts: d, recurring: r } = z(), { accountsLoaded: k, cashAccounts: L, visibleAccounts: g } = O(), S = M(e), { uiStore: b } = j(), { detailedRepeatingTransactions: R } = I(), { config: x } = $(), { failed: f, ready: y, retry: D } = Q(), c = P(et);
19
+ if (!k) return /* @__PURE__ */ o(J, {});
20
+ const A = Y(e, g, L), w = A.filter(v), B = A.filter((t) => !v(t)), a = x.display_available_balance_in_accounts, E = [G("checking", c.checking, w, a), G("savings", c.savings, B, a)].filter((t) => t.rows.length > 0), F = y ? [...b.expensesTilNextIncome].sort((t, i) => i.amount - t.amount).map((t) => {
21
+ const i = g.find(({ guid: u }) => u === t.accountGuid), _ = R.find(({ guid: u }) => u === t.repeatingTransactionGuid);
23
22
  return {
24
23
  account: {
25
24
  institutionGuid: t.institutionGuid,
26
- name: c ? O(c) : t.institutionName
25
+ name: i ? N(i) : t.institutionName
27
26
  },
28
27
  amount: t.amount,
29
- frequency: C && M(r, C, !1),
28
+ frequency: _ && H(r, _, !1),
30
29
  key: `${t.repeatingTransactionGuid}-${t.expectedDate.getTime()}`,
31
30
  leading: /* @__PURE__ */ o(K, {
32
31
  categoryGuid: t.categoryGuid,
33
32
  size: 32
34
33
  }),
35
34
  name: t.name,
36
- onClick: () => l(t)
35
+ onClick: () => m(t)
37
36
  };
38
- }) : [], A = () => l(null), N = () => m(null);
37
+ }) : [], C = () => m(null), q = () => p(null);
39
38
  return /* @__PURE__ */ ot(tt, { children: [
40
39
  /* @__PURE__ */ o(W, {
41
- copy: e,
40
+ copy: c,
42
41
  expenses: F,
43
- expensesLoading: !f && !g,
44
- onAccountClick: m,
45
- onRetryExpenses: g ? R : void 0,
46
- sections: w,
42
+ expensesLoading: !y && !f,
43
+ onAccountClick: p,
44
+ onRetryExpenses: f ? D : void 0,
45
+ sections: E,
47
46
  showAvailable: a,
48
- summary: X(S, e)
47
+ summary: X(S, c)
49
48
  }),
50
- /* @__PURE__ */ o(_, {
49
+ /* @__PURE__ */ o(h, {
51
50
  ariaLabelClose: r.close_drawer_aria,
52
- isOpen: i !== null,
53
- onClose: A,
51
+ isOpen: n !== null,
52
+ onClose: C,
54
53
  title: r.expense_details,
55
- children: i && /* @__PURE__ */ o(U, {
56
- beat: n,
54
+ children: n && /* @__PURE__ */ o(U, {
55
+ beat: e,
57
56
  layout: "insights",
58
- onDeleted: A,
59
- repeatingTransactionGuid: i.repeatingTransactionGuid,
60
- selectedRecurrence: i
57
+ onDeleted: C,
58
+ repeatingTransactionGuid: n.repeatingTransactionGuid,
59
+ selectedRecurrence: n
61
60
  })
62
61
  }),
63
- /* @__PURE__ */ o(_, {
64
- ariaLabelClose: p?.close_account_details_aria,
62
+ /* @__PURE__ */ o(h, {
63
+ ariaLabelClose: d?.close_account_details_aria,
65
64
  isOpen: s !== null,
66
- onClose: N,
67
- title: p?.account_details,
65
+ onClose: q,
66
+ title: d?.account_details,
68
67
  children: s && /* @__PURE__ */ o(V, { beat: {
69
- ...n,
68
+ ...e,
70
69
  primary_account: void 0,
71
70
  primary_account_guid: s
72
71
  } })
@@ -74,7 +73,8 @@ var _t = Z(function({ beat: n }) {
74
73
  ] });
75
74
  });
76
75
  export {
77
- _t as AccountListBlock
76
+ _t as AccountListBlock,
77
+ et as selectAccountListCopy
78
78
  };
79
79
 
80
80
  //# sourceMappingURL=AccountListBlock.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccountListBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.tsx"],"sourcesContent":["import { useState } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport {\n Drawer,\n Loader,\n useAccountStore,\n useAppConfig,\n useCashflowStore,\n useGlobalCopyStore,\n useRecurringTransactionsStore,\n} from '../../../common'\nimport getAccountDisplayName from '../../../common/utils/AccountDisplayName'\nimport type { Recurrence } from '../../../core'\nimport { getFrequencyLabel } from '../../../core/utils/RecurringTransactionsUtil'\nimport CategoryTile from '../../components/CategoryTile'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { AccountDetailsBlock } from '../AccountDetailsBlock'\nimport { BlockErrorMessage } from '../BlockErrorMessage'\nimport {\n RecurringTransactionBlock,\n useRecurringExpensesLoadState,\n} from '../RecurringTransactionBlock'\nimport { useOpenedCta } from '../useOpenedCta'\n\nimport AccountListContent, { type ExpenseRow } from './AccountListContent'\nimport { buildSummary, isCheckingAccount, resolveBeatAccounts, toAccountSection } from './layout'\n\n/**\n * Account List drawer: the CTA's calculation, then Accounts and Recurring Expenses tabs.\n * A tapped expense opens its Expense Details, and a tapped account its Account Details (the shared\n * AccountDetailsBlock), each in a nested drawer.\n */\nexport const AccountListBlock = observer(function AccountListBlock({ beat }: ActionBlockProps) {\n const [tappedExpense, setTappedExpense] = useState<Recurrence | null>(null)\n const [tappedAccountGuid, setTappedAccountGuid] = useState<string | null>(null)\n const {\n accounts: accountsCopy,\n insights_feed: insightsFeedCopy,\n recurring: recurringCopy,\n } = useGlobalCopyStore()\n const { accountsLoaded, cashAccounts, visibleAccounts } = useAccountStore()\n const cta = useOpenedCta(beat)\n const { uiStore } = useCashflowStore()\n const { detailedRepeatingTransactions } = useRecurringTransactionsStore()\n const { config } = useAppConfig()\n const { failed: expensesFailed, ready: expensesReady, retry } = useRecurringExpensesLoadState()\n const copy = insightsFeedCopy?.account_list\n\n if (!copy) {\n return <BlockErrorMessage />\n }\n\n if (!accountsLoaded) return <Loader />\n\n const listed = resolveBeatAccounts(beat, visibleAccounts, cashAccounts)\n const checking = listed.filter(isCheckingAccount)\n const savings = listed.filter((account) => !isCheckingAccount(account))\n const showAvailable = config.display_available_balance_in_accounts\n const sections = [\n toAccountSection('checking', copy.checking, checking, showAvailable),\n toAccountSection('savings', copy.savings, savings, showAvailable),\n ].filter((section) => section.rows.length > 0)\n\n // Every upcoming expense as its own row, largest first (Figma); no \"Other\" fold, so each opens its details.\n const expenses: ExpenseRow[] = expensesReady\n ? [...uiStore.expensesTilNextIncome]\n .sort((a, b) => b.amount - a.amount)\n .map((expense) => {\n const account = visibleAccounts.find(({ guid }) => guid === expense.accountGuid)\n const repeating = detailedRepeatingTransactions.find(\n ({ guid }) => guid === expense.repeatingTransactionGuid,\n )\n\n return {\n account: {\n institutionGuid: expense.institutionGuid,\n name: account ? getAccountDisplayName(account) : expense.institutionName,\n },\n amount: expense.amount,\n frequency: repeating && getFrequencyLabel(recurringCopy, repeating, false),\n key: `${expense.repeatingTransactionGuid}-${expense.expectedDate.getTime()}`,\n leading: <CategoryTile categoryGuid={expense.categoryGuid} size={32} />,\n name: expense.name,\n onClick: () => setTappedExpense(expense),\n }\n })\n : []\n\n const closeExpenseDetails = () => setTappedExpense(null)\n const closeAccountDetails = () => setTappedAccountGuid(null)\n\n return (\n <>\n <AccountListContent\n copy={copy}\n expenses={expenses}\n expensesLoading={!expensesReady && !expensesFailed}\n onAccountClick={setTappedAccountGuid}\n onRetryExpenses={expensesFailed ? retry : undefined}\n sections={sections}\n showAvailable={showAvailable}\n summary={buildSummary(cta, copy)}\n />\n <Drawer\n ariaLabelClose={recurringCopy.close_drawer_aria}\n isOpen={tappedExpense !== null}\n onClose={closeExpenseDetails}\n title={recurringCopy.expense_details}\n >\n {tappedExpense && (\n <RecurringTransactionBlock\n beat={beat}\n layout=\"insights\"\n onDeleted={closeExpenseDetails}\n repeatingTransactionGuid={tappedExpense.repeatingTransactionGuid}\n selectedRecurrence={tappedExpense}\n />\n )}\n </Drawer>\n <Drawer\n ariaLabelClose={accountsCopy?.close_account_details_aria}\n isOpen={tappedAccountGuid !== null}\n onClose={closeAccountDetails}\n title={accountsCopy?.account_details}\n >\n {tappedAccountGuid && (\n // The shared block shows the beat's account, so hand it the tapped one instead.\n <AccountDetailsBlock\n beat={{ ...beat, primary_account: undefined, primary_account_guid: tappedAccountGuid }}\n />\n )}\n </Drawer>\n </>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;AAkCA,IAAa,KAAmB,EAAS,SAA0B,EAAE,MAAA,EAAA,GAA0B;AAC7F,QAAM,CAAC,GAAe,CAAA,IAAoB,EAA4B,IAAI,GACpE,CAAC,GAAmB,CAAA,IAAwB,EAAwB,IAAI,GACxE,EACJ,UAAU,GACV,eAAe,GACf,WAAW,EAAA,IACT,EAAmB,GACjB,EAAE,gBAAA,GAAgB,cAAA,GAAc,iBAAA,EAAA,IAAoB,EAAgB,GACpE,IAAM,EAAa,CAAI,GACvB,EAAE,SAAA,EAAA,IAAY,EAAiB,GAC/B,EAAE,+BAAA,EAAA,IAAkC,EAA8B,GAClE,EAAE,QAAA,EAAA,IAAW,EAAa,GAC1B,EAAE,QAAQ,GAAgB,OAAO,GAAe,OAAA,EAAA,IAAU,EAA8B,GACxF,IAAO,GAAkB;AAE/B,MAAI,CAAC,EACH,QAAO,gBAAA,EAAC,GAAD,CAAoB,CAAA;AAG7B,MAAI,CAAC,EAAgB,QAAO,gBAAA,EAAC,GAAD,CAAS,CAAA;AAErC,QAAM,IAAS,EAAoB,GAAM,GAAiB,CAAY,GAChE,IAAW,EAAO,OAAO,CAAiB,GAC1C,IAAU,EAAO,OAAA,CAAQ,MAAY,CAAC,EAAkB,CAAO,CAAC,GAChE,IAAgB,EAAO,uCACvB,IAAW,CACf,EAAiB,YAAY,EAA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,IACD,gBAAA,EAAC,GAAD;AAAA,MACE,gBAAgB,EAAc;AAAA,MAC9B,QAAQ,MAAkB;AAAA,MAC1B,SAAS;AAAA,MACT,OAAO,EAAc;AAAA,MAEpB,UAAA,KACC,gBAAA,EAAC,GAAD;AAAA,QACQ,MAAA;AAAA,QACN,QAAO;AAAA,QACP,WAAW;AAAA,QACX,0BAA0B,EAAc;AAAA,QACxC,oBAAoB;AAAA,MACrB,CAAA;AAAA,IAEG,CAAA;AAAA,IACR,gBAAA,EAAC,GAAD;AAAA,MACE,gBAAgB,GAAc;AAAA,MAC9B,QAAQ,MAAsB;AAAA,MAC9B,SAAS;AAAA,MACT,OAAO,GAAc;AAAA,MAEpB,UAAA,KAEC,gBAAA,EAAC,GAAD,EACE,MAAM;AAAA,QAAE,GAAG;AAAA,QAAM,iBAAiB;AAAA,QAAW,sBAAsB;AAAA,MAAkB,EACtF,CAAA;AAAA,IAEG,CAAA;AAAA,EACR,EAAA,CAAA;AAEN,CAAC"}
1
+ {"version":3,"file":"AccountListBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.tsx"],"sourcesContent":["import { useState } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport {\n Drawer,\n Loader,\n useAccountStore,\n useAppConfig,\n useCashflowStore,\n useGlobalCopyStore,\n useRecurringTransactionsStore,\n} from '../../../common'\nimport getAccountDisplayName from '../../../common/utils/AccountDisplayName'\nimport type { GlobalCopy, Recurrence } from '../../../core'\nimport { getFrequencyLabel } from '../../../core/utils/RecurringTransactionsUtil'\nimport CategoryTile from '../../components/CategoryTile'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { AccountDetailsBlock } from '../AccountDetailsBlock'\nimport {\n RecurringTransactionBlock,\n useRecurringExpensesLoadState,\n} from '../RecurringTransactionBlock'\nimport { useOpenedCta } from '../useOpenedCta'\nimport { useRequiredCopy } from '../useRequiredCopy'\n\nimport AccountListContent, { type ExpenseRow } from './AccountListContent'\nimport { buildSummary, isCheckingAccount, resolveBeatAccounts, toAccountSection } from './layout'\n\nexport const selectAccountListCopy = (copy: GlobalCopy) => copy.insights_feed?.account_list\n\n/**\n * Account List drawer: the CTA's calculation, then Accounts and Recurring Expenses tabs.\n * A tapped expense opens its Expense Details, and a tapped account its Account Details (the shared\n * AccountDetailsBlock), each in a nested drawer.\n */\nexport const AccountListBlock = observer(function AccountListBlock({ beat }: ActionBlockProps) {\n const [tappedExpense, setTappedExpense] = useState<Recurrence | null>(null)\n const [tappedAccountGuid, setTappedAccountGuid] = useState<string | null>(null)\n const { accounts: accountsCopy, recurring: recurringCopy } = useGlobalCopyStore()\n const { accountsLoaded, cashAccounts, visibleAccounts } = useAccountStore()\n const cta = useOpenedCta(beat)\n const { uiStore } = useCashflowStore()\n const { detailedRepeatingTransactions } = useRecurringTransactionsStore()\n const { config } = useAppConfig()\n const { failed: expensesFailed, ready: expensesReady, retry } = useRecurringExpensesLoadState()\n const copy = useRequiredCopy(selectAccountListCopy)\n\n if (!accountsLoaded) return <Loader />\n\n const listed = resolveBeatAccounts(beat, visibleAccounts, cashAccounts)\n const checking = listed.filter(isCheckingAccount)\n const savings = listed.filter((account) => !isCheckingAccount(account))\n const showAvailable = config.display_available_balance_in_accounts\n const sections = [\n toAccountSection('checking', copy.checking, checking, showAvailable),\n toAccountSection('savings', copy.savings, savings, showAvailable),\n ].filter((section) => section.rows.length > 0)\n\n // Every upcoming expense as its own row, largest first (Figma); no \"Other\" fold, so each opens its details.\n const expenses: ExpenseRow[] = expensesReady\n ? [...uiStore.expensesTilNextIncome]\n .sort((a, b) => b.amount - a.amount)\n .map((expense) => {\n const account = visibleAccounts.find(({ guid }) => guid === expense.accountGuid)\n const repeating = detailedRepeatingTransactions.find(\n ({ guid }) => guid === expense.repeatingTransactionGuid,\n )\n\n return {\n account: {\n institutionGuid: expense.institutionGuid,\n name: account ? getAccountDisplayName(account) : expense.institutionName,\n },\n amount: expense.amount,\n frequency: repeating && getFrequencyLabel(recurringCopy, repeating, false),\n key: `${expense.repeatingTransactionGuid}-${expense.expectedDate.getTime()}`,\n leading: <CategoryTile categoryGuid={expense.categoryGuid} size={32} />,\n name: expense.name,\n onClick: () => setTappedExpense(expense),\n }\n })\n : []\n\n const closeExpenseDetails = () => setTappedExpense(null)\n const closeAccountDetails = () => setTappedAccountGuid(null)\n\n return (\n <>\n <AccountListContent\n copy={copy}\n expenses={expenses}\n expensesLoading={!expensesReady && !expensesFailed}\n onAccountClick={setTappedAccountGuid}\n onRetryExpenses={expensesFailed ? retry : undefined}\n sections={sections}\n showAvailable={showAvailable}\n summary={buildSummary(cta, copy)}\n />\n <Drawer\n ariaLabelClose={recurringCopy.close_drawer_aria}\n isOpen={tappedExpense !== null}\n onClose={closeExpenseDetails}\n title={recurringCopy.expense_details}\n >\n {tappedExpense && (\n <RecurringTransactionBlock\n beat={beat}\n layout=\"insights\"\n onDeleted={closeExpenseDetails}\n repeatingTransactionGuid={tappedExpense.repeatingTransactionGuid}\n selectedRecurrence={tappedExpense}\n />\n )}\n </Drawer>\n <Drawer\n ariaLabelClose={accountsCopy?.close_account_details_aria}\n isOpen={tappedAccountGuid !== null}\n onClose={closeAccountDetails}\n title={accountsCopy?.account_details}\n >\n {tappedAccountGuid && (\n // The shared block shows the beat's account, so hand it the tapped one instead.\n <AccountDetailsBlock\n beat={{ ...beat, primary_account: undefined, primary_account_guid: tappedAccountGuid }}\n />\n )}\n </Drawer>\n </>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;AA6BA,IAAa,KAAA,CAAyB,MAAqB,EAAK,eAAe,cAOlE,KAAmB,EAAS,SAA0B,EAAE,MAAA,EAAA,GAA0B;AAC7F,QAAM,CAAC,GAAe,CAAA,IAAoB,EAA4B,IAAI,GACpE,CAAC,GAAmB,CAAA,IAAwB,EAAwB,IAAI,GACxE,EAAE,UAAU,GAAc,WAAW,EAAA,IAAkB,EAAmB,GAC1E,EAAE,gBAAA,GAAgB,cAAA,GAAc,iBAAA,E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,EAAQ;AAAA,QAAc,MAAM;AAAA,MAAK,CAAA;AAAA,MACtE,MAAM,EAAQ;AAAA,MACd,SAAA,MAAe,EAAiB,CAAO;AAAA,IACzC;AAAA,EACF,CAAC,IACH,CAAC,GAEC,IAAA,MAA4B,EAAiB,IAAI,GACjD,IAAA,MAA4B,EAAqB,IAAI;AAE3D,SACE,gBAAA,GAAA,IAAA,EAAA,UAAA;AAAA,IACE,gBAAA,EAAC,GAAD;AAAA,MACQ,MAAA;AAAA,MACI,UAAA;AAAA,MACV,iBAAiB,CAAC,KAAiB,CAAC;AAAA,MACpC,gBAAgB;AAAA,MAChB,iBAAiB,IAAiB,IAAQ;AAAA,MAChC,UAAA;AAAA,MACK,eAAA;AAAA,MACf,SAAS,EAAa,GAAK,CAAI;AAAA,IAChC,CAAA;AAAA,IACD,gBAAA,EAAC,GAAD;AAAA,MACE,gBAAgB,EAAc;AAAA,MAC9B,QAAQ,MAAkB;AAAA,MAC1B,SAAS;AAAA,MACT,OAAO,EAAc;AAAA,MAEpB,UAAA,KACC,gBAAA,EAAC,GAAD;AAAA,QACQ,MAAA;AAAA,QACN,QAAO;AAAA,QACP,WAAW;AAAA,QACX,0BAA0B,EAAc;AAAA,QACxC,oBAAoB;AAAA,MACrB,CAAA;AAAA,IAEG,CAAA;AAAA,IACR,gBAAA,EAAC,GAAD;AAAA,MACE,gBAAgB,GAAc;AAAA,MAC9B,QAAQ,MAAsB;AAAA,MAC9B,SAAS;AAAA,MACT,OAAO,GAAc;AAAA,MAEpB,UAAA,KAEC,gBAAA,EAAC,GAAD,EACE,MAAM;AAAA,QAAE,GAAG;AAAA,QAAM,iBAAiB;AAAA,QAAW,sBAAsB;AAAA,MAAkB,EACtF,CAAA;AAAA,IAEG,CAAA;AAAA,EACR,EAAA,CAAA;AAEN,CAAC"}
@@ -1,2 +1,2 @@
1
- export { AccountListBlock } from './AccountListBlock';
1
+ export { AccountListBlock, selectAccountListCopy } from './AccountListBlock';
2
2
  export { useAccountListPrepare } from './useAccountListPrepare';
@@ -1,50 +1,55 @@
1
- import { useGlobalCopyStore as B, useGlobalUiStore as S, useInsightsV2Store as b } from "../../common/context/hooks.es.js";
2
- import w from "../../common/components/drawer/Drawer.es.js";
3
- import L from "../../common/components/Loader.es.js";
4
- import { BlockErrorMessage as D } from "./BlockErrorMessage.es.js";
5
- import { hasDrawerBlock as O } from "../mappings/hasDrawerBlock.es.js";
6
- import x from "../components/shared/StatusSnackbar.es.js";
7
- import { useOpenedCta as _ } from "./useOpenedCta.es.js";
8
- import { actionBlocks as j } from "../mappings/blocks.es.js";
9
- import { useRef as F } from "react";
10
- import { observer as G } from "mobx-react-lite";
11
- import { Fragment as d, jsx as t, jsxs as f } from "react/jsx-runtime";
12
- var N = (i, o) => {
13
- const r = F(void 0);
1
+ import { useGlobalCopyStore as w, useGlobalStore as L, useGlobalUiStore as x, useInsightsV2Store as D } from "../../common/context/hooks.es.js";
2
+ import O from "../../common/components/drawer/Drawer.es.js";
3
+ import E from "../../common/components/ErrorBoundary.es.js";
4
+ import G from "../../common/components/Loader.es.js";
5
+ import { BlockErrorMessage as k } from "./BlockErrorMessage.es.js";
6
+ import { hasDrawerBlock as _ } from "../mappings/hasDrawerBlock.es.js";
7
+ import j from "../components/shared/StatusSnackbar.es.js";
8
+ import { useOpenedCta as F } from "./useOpenedCta.es.js";
9
+ import { actionBlocks as M } from "../mappings/blocks.es.js";
10
+ import { useRef as N } from "react";
11
+ import { observer as R } from "mobx-react-lite";
12
+ import { Fragment as C, jsx as e, jsxs as g } from "react/jsx-runtime";
13
+ var T = (i, o) => {
14
+ const r = N(void 0);
14
15
  return i ? (r.current ??= o, r.current) : (r.current = void 0, o);
15
- }, k = ({ actionBlock: i, ...o }) => {
16
- const { Component: r, usePrepare: c } = i;
17
- return c(o), /* @__PURE__ */ t(r, { ...o });
18
- }, J = G(function({ beat: o }) {
19
- const r = B(), c = r.common, m = c?.close_aria ?? "Close", { isCopyLoaded: g } = S(), { actionDrawer: u, actionNotice: C, closeActionDrawer: v, setActionNotice: h } = b(), s = u.isDrawerOpen && u.guid === o.guid, e = N(s, _(o));
16
+ }, v = ({ actionBlock: i, ...o }) => {
17
+ const { Component: r, usePrepare: s } = i;
18
+ return s(o), /* @__PURE__ */ e(r, { ...o });
19
+ }, X = R(function({ beat: o }) {
20
+ const r = w(), { captureException: s } = L(), u = r.common, m = u?.close_aria ?? "Close", { isCopyLoaded: y } = x(), { actionDrawer: p, actionNotice: h, closeActionDrawer: B, setActionNotice: A } = D(), c = p.isDrawerOpen && p.guid === o.guid, t = T(c, F(o));
20
21
  if (!o.insights_payload) return null;
21
- if (!g) return s ? /* @__PURE__ */ t(L, {}) : null;
22
- const a = C[o.guid], p = /* @__PURE__ */ t(x, {
22
+ if (!y) return c ? /* @__PURE__ */ e(G, {}) : null;
23
+ const a = h[o.guid], d = /* @__PURE__ */ e(j, {
23
24
  closeAriaLabel: m,
24
25
  message: a?.message ?? "",
25
- onClose: () => h(o.guid, void 0),
26
+ onClose: () => A(o.guid, void 0),
26
27
  open: !!a,
27
28
  severity: a?.severity
28
- }), l = O(e?.block), n = l ? j[e?.block] : void 0;
29
- if (n?.presentation === "modal") return /* @__PURE__ */ f(d, { children: [s && /* @__PURE__ */ t(k, {
29
+ }), l = _(t?.block), n = l ? M[t?.block] : void 0;
30
+ if (n?.presentation === "modal") return /* @__PURE__ */ g(C, { children: [c && /* @__PURE__ */ e(v, {
30
31
  actionBlock: n,
31
32
  beat: o
32
- }, e?.block), p] });
33
- const y = n?.title?.(e?.variant, r, o), A = n ? y || e?.label || "" : l ? c?.error_heading ?? "Oops" : e?.label ?? "";
34
- return /* @__PURE__ */ f(d, { children: [/* @__PURE__ */ t(w, {
33
+ }, t?.block), d] });
34
+ const f = n && (n.copy === void 0 || n.copy(r) != null), b = n?.title?.(t?.variant, r, o), S = f ? b || t?.label || "" : l ? u?.error_heading ?? "Oops" : t?.label ?? "";
35
+ return /* @__PURE__ */ g(C, { children: [/* @__PURE__ */ e(O, {
35
36
  ariaLabelClose: m,
36
37
  headerAction: n?.headerAction,
37
- isOpen: s,
38
- onClose: v,
39
- title: A,
40
- children: n ? /* @__PURE__ */ t(k, {
41
- actionBlock: n,
42
- beat: o
43
- }, e?.block) : l ? /* @__PURE__ */ t(D, {}) : null
44
- }), p] });
38
+ isOpen: c,
39
+ onClose: B,
40
+ title: S,
41
+ children: f ? /* @__PURE__ */ e(E, {
42
+ fallback: /* @__PURE__ */ e(k, {}),
43
+ onCaptureException: s,
44
+ children: /* @__PURE__ */ e(v, {
45
+ actionBlock: n,
46
+ beat: o
47
+ })
48
+ }, t?.block) : l ? /* @__PURE__ */ e(k, {}) : null
49
+ }), d] });
45
50
  });
46
51
  export {
47
- J as ActionBlockLayer
52
+ X as ActionBlockLayer
48
53
  };
49
54
 
50
55
  //# sourceMappingURL=ActionBlockLayer.es.js.map