@mx-cartographer/experiences 9.7.42 → 9.7.43

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 (36) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/core/types/InsightsInstanceSlotData.d.ts +3 -0
  3. package/dist/core/types/InsightsInstanceSlotData.es.js.map +1 -1
  4. package/dist/core/types/localization/InsightsFeedCopy.d.ts +3 -0
  5. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.d.ts +3 -1
  6. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +85 -75
  7. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
  8. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +115 -93
  9. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
  10. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +3 -1
  11. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +66 -44
  12. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
  13. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.d.ts +1 -1
  14. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js +49 -44
  15. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
  16. package/dist/insights-v2/analytics/analyticsEventsConfig.d.ts +4 -0
  17. package/dist/insights-v2/analytics/analyticsEventsConfig.es.js +4 -0
  18. package/dist/insights-v2/analytics/analyticsEventsConfig.es.js.map +1 -1
  19. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.d.ts +1 -1
  20. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js +19 -19
  21. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js.map +1 -1
  22. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils.d.ts +8 -1
  23. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils.es.js +47 -31
  24. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils.es.js.map +1 -1
  25. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.d.ts +1 -5
  26. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js +10 -6
  27. package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js.map +1 -1
  28. package/dist/insights-v2/components/SubTabs.d.ts +22 -0
  29. package/dist/insights-v2/components/SubTabs.es.js +38 -0
  30. package/dist/insights-v2/components/SubTabs.es.js.map +1 -0
  31. package/dist/insights-v2/components/chartblocks/ChartLegend.es.js +14 -18
  32. package/dist/insights-v2/components/chartblocks/ChartLegend.es.js.map +1 -1
  33. package/dist/insights-v2/components/chartblocks/DoubleBarChart.d.ts +5 -3
  34. package/dist/insights-v2/components/chartblocks/DoubleBarChart.es.js +108 -104
  35. package/dist/insights-v2/components/chartblocks/DoubleBarChart.es.js.map +1 -1
  36. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [9.7.43] - 10-26-2026
2
+
3
+ - **ADDED** - Monthly Spend to Income Comparison on Insights 2.0 (WEC-2101, Figma 1941:137446). `DoubleBarChartBlock` reads ditto's `instance_slot.data` slots only, as `BarchartBlock` does — `series` (the stored data_series, a Spend and an Income row per month) and `additional_data` (the legend, `{ label, value, value_type }`); a legend item with no `value` shows its label alone, never $0.00. The `DoubleBarChart` stories now feed `instance_slot.data`. `layout.ts` gains ditto's `spend_to_income` variant (the existing spend-to-income palette, now matched with `Object.hasOwn`). The drawer's double-bar view is built: `TransactionHistoryBlock` `monthly_spend_to_income` entry (`top: 'doubleBar'`) with one tab per month (`getDefaultSelection` counts the comparison columns), Spend / Income sub-tabs between the chart and the list (`TransactionDrillDown` `subTabs`), the selected month's totals in the legend, and `comparisonGuidsStrategy` — the selected month's spend or income transactions by the bar's stored guids, failing closed when the bar names none. `buildComparisonSeries` carries each bar's `mainGuids` / `comparisonGuids` and `DoubleBarChart` takes a `selectedIndex` and a `legendPosition` (as `BarChartV2`: below the chart on the card, above it in the drawer). `DoubleBarChart` stories per state from tupac's envelopes.
4
+ - **CHANGED** - `DoubleBarChart` shows its legend on mini too (the Figma mini card carries it), and the shared chart `Legend` reads "Label: $X" without the stray space before the colon (also CreditUtilization's legend).
5
+ - **CHANGED** - Spend vs. Income drawer parity with pulse: the Spend / Income tabs fire pulse's `Transactions Filter` / "<Template> - Transactions Filtered By Type" event (not "Month Tab Selected") and are named "Spend transactions" / "Income transactions"; the double-bar bars (card and drawer) are labelled from `insights_feed.general.in_month_you_had_a_category_of_amount` ("In March, you had a spend of $1,500.00") instead of the unlocalized month-and-amount label.
6
+ - **ADDED** - `SubTabs` (`insights-v2/components`): the drill-down drawers' second tab row (e.g. Spend / Income) as one shared component — controlled, per-tab screen-reader names, and it fires pulse's `Transactions Filter` / "Transactions Filtered By Type" event itself. `TransactionDrillDown` takes it as a single `subTabs` prop (replacing `subTabs` / `selectedSubIndex` / `onSubSelectionChange`), ready for the remaining double-bar and deposit-summary drawers.
7
+ - **CHANGED** - `SubTabs` wires each tab to the content it controls: tab `id` + `aria-controls`, and `subTabPanelProps(id, selectedIndex)` gives the panel `role="tabpanel"` / `aria-labelledby` the selected tab. `SubTabs` takes a required `id`; `TransactionDrillDown` owns it and makes the transaction list (tip, header and rows) the Spend / Income tabs' panel, as its month tabs already do.
8
+
1
9
  ## [9.7.42] - 10-26-2026
2
10
 
3
11
  - **CHANGED** - `AccountSwitchBlock` reads only the Insights 2.0 envelope's `instance_slot.data` (`from_logo`, `to_logo`, each `{ guid, alt }`) and renders the same `TransferLogoCard`, each logo through `LogoFromGuid`, which draws nothing for a missing slot or a guid that fails `isLogoGuid`. The flat `instance_slot_data` fallback is removed: tupac never sends it on an Insights 2.0 envelope, and the V1 Discovered Accounts and Switch Direct Deposit cards render through the legacy `insights` components, not this block. The block's stories move to the `data` shape (WEC-1980)
@@ -37,10 +37,13 @@ export interface DataSet extends DataSeries {
37
37
  ariaLabelComparison: string;
38
38
  ariaLabelMain: string;
39
39
  comparison: number;
40
+ comparisonGuids?: string[];
41
+ date?: string;
40
42
  formattedComparison: string;
41
43
  formattedMain: string;
42
44
  label: string;
43
45
  main: number;
46
+ mainGuids?: string[];
44
47
  }
45
48
  export interface ImageBlockData {
46
49
  image: string;
@@ -1 +1 @@
1
- {"version":3,"file":"InsightsInstanceSlotData.es.js","names":[],"sources":["../../../src/core/types/InsightsInstanceSlotData.ts"],"sourcesContent":["import type { DataSeries, Legends, LogoRef } from '../../core'\n\nexport interface InsightsInstanceSlotData\n extends\n Partial<BudgetBlockData>,\n Partial<DonutChartBlockData>,\n Partial<ImageBlockData>,\n Partial<AccountBlockData>,\n Partial<SaveExtraBlockData>,\n Partial<StepChartBlockData>,\n Partial<SVGImageBlockData>,\n Partial<AccountSwitchBlockData>,\n Partial<TransactionDetailsBlockData>,\n Partial<CreditUtilizationBlockData>,\n Partial<CommonProps> {}\n\n//when any of the type is used more than one times, we can use the common props\ninterface CommonProps {\n amount?: number\n ariaLabel?: string\n date?: string\n legends?: Legends[]\n category_guid?: string\n data_series?: DataSeries | DataSet[]\n transaction_guids?: string[]\n account_guids?: string[]\n primary_transaction_guid?: string\n}\n\n//BarChart Block: `instance_slot.data` (Insights 2.0)\nexport interface BarChartBlockData {\n series?: DataSeries\n category_guid?: string\n average_amount?: number\n /** [0] monthly amount, [1] trend. */\n additional_data?: Legends[]\n}\n\n//DonutChart Block\ninterface Main {\n value: string\n value_type: string\n label: string\n}\nexport interface DonutChartBlockData {\n main: Main\n}\n\n//DoubleBarChart Block\n// TODO : This has to be revisited again to update the below types based on API response once we have the final shape of the data_series for double bar chart from BE\nexport interface LegendProps extends Legends {\n amount: number\n formattedAmount: string\n label: string\n color?: string\n}\n\nexport interface DataSet extends DataSeries {\n ariaLabelComparison: string\n ariaLabelMain: string\n comparison: number\n formattedComparison: string\n formattedMain: string\n label: string\n main: number\n}\n\n//DoubleProgressBar Block\n\n//Image Block\nexport interface ImageBlockData {\n image: string\n}\n\n//Account Block\nexport interface AccountBlockData {\n sub_text: string\n institution_guid?: string\n institution_name?: string\n icon_name?: string\n /** Header bar text (standard card), or the colored category strip label (deposit cards). */\n header_text?: string\n // Deposit variants (Unified Deposit, Unified Deposit Emergency Fund, Savings Account Deposit)\n /** Merchant guid — renders a real merchant logo in the deposit card when present. */\n merchant_guid?: string\n /** Merchant display name — logo alt text and the payer line under the amount. */\n merchant_name?: string\n /** Secondary label beside the amount, e.g. `On {date}, you saved` or `Balance as of MM/DD/YY`. */\n label?: string\n}\n\nexport interface SaveExtraBlockData {\n /** Styled segments `[lead-in, amount digits, trailing copy]`, e.g. `['Save an extra', '100', 'to help your funds grow']`. */\n primary_text?: string[]\n /** Styled segments `[projected balance, caption]`, e.g. `['$8,313.87', 'After payday & projected expenses']`. */\n secondary_text?: string[]\n /** MakeTransfer drilldown: available balance (both variants). */\n available_balance?: number\n /** SAVE_ENOUGH_TO_LIVE_ON: average monthly spend. */\n avg_monthly_spend?: number\n /** SAVE_ENOUGH_TO_LIVE_ON: how long the balance lasts, overlaid on the timeline SVG (e.g. \"2 months, 11 days\"). */\n time_period?: string\n /** SAVE_AN_EXTRA_100: upcoming expenses (the \"Expenses\" figure). */\n upcoming_expenses?: number\n /** SAVE_AN_EXTRA_100: total remaining after expenses. */\n total_remaining?: number\n /** SAVE_ENOUGH_TO_LIVE_ON: date for the \"Your available balances as of {date}\" line. */\n date?: string\n}\n\n// AccountSwitch Block. State comes from `instance_slot.variant`, not a data flag.\nexport interface AccountSwitchBlockData {\n discovered_institution_guid: string\n discovered_institution_name: string\n held_institution_guid: string\n held_institution_name: string\n}\n\n// AccountSwitch Block: `instance_slot.data` (Insights 2.0, Discovered Accounts V2). Each slot is\n// optional: tupac omits `to_logo` when the user holds no FI-managed account. `logo` is the compact\n// card's (micro, notification) discovered institution.\nexport interface AccountSwitchBlockV2Data {\n from_logo?: LogoRef\n to_logo?: LogoRef\n logo?: LogoRef\n}\n\n// StepChart Block\nexport interface StepChartBlockData {\n completed_steps: number\n label_1: string\n label_2?: string\n}\n\n//Budgets Blocks\nexport enum BudgetTierType {\n LOW_BUDGET_TIER = 'LOW',\n MEDIUM_BUDGET_TIER = 'MEDIUM',\n OFF_TRACK_BUDGET_TIER = 'OFF_TRACK',\n}\n\nexport type BudgetTierValue = `${BudgetTierType}`\n\nexport interface BudgetLocalizedPayload {\n primary_text?: string\n amount_left_label?: string\n spent_label?: string\n budgeted_label?: string\n}\n\nexport interface BudgetBlockData {\n budget_percent: number\n budget_tier: BudgetTierValue\n category_guid?: string\n merchant_guid?: string\n spent_amount: number\n budgeted_amount: number\n localized_payload: BudgetLocalizedPayload\n}\n\nexport interface SVGImageBlockData {\n isCIBC?: boolean\n}\n\n// TransactionDetails Action Block\n// The drawer's subject is `InsightsPayload.primary_transaction_guid`; only action configuration\n// lives here.\nexport interface TransactionDetailsBlockData {\n /** `TopActions` member names, e.g. `['Category', 'Date', 'Memo']`. Omit for the defaults. */\n top_actions?: string[]\n /** `BottomActions` member names, e.g. `['MerchantBudget', 'HideTransaction']`. Omit for defaults. */\n bottom_actions?: string[]\n}\n\n// Credit Utilization action block. The per-card rows are the beat's `data_series` table\n// (`guid`, `label`, `amount`, `total_amount`, `percentage`), carried on `CommonProps.data_series`.\nexport interface CreditUtilizationBlockData {\n accounts_balance_sum?: number\n accounts_credit_limit_sum?: number\n credit_utilization_percentage?: number\n}\n"],"mappings":"AAuIA,IAAY,IAAL,0BAAA,GAAA;AACL,SAAA,EAAA,kBAAA,OACA,EAAA,qBAAA,UACA,EAAA,wBAAA;AACF,GAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"InsightsInstanceSlotData.es.js","names":[],"sources":["../../../src/core/types/InsightsInstanceSlotData.ts"],"sourcesContent":["import type { DataSeries, Legends, LogoRef } from '../../core'\n\nexport interface InsightsInstanceSlotData\n extends\n Partial<BudgetBlockData>,\n Partial<DonutChartBlockData>,\n Partial<ImageBlockData>,\n Partial<AccountBlockData>,\n Partial<SaveExtraBlockData>,\n Partial<StepChartBlockData>,\n Partial<SVGImageBlockData>,\n Partial<AccountSwitchBlockData>,\n Partial<TransactionDetailsBlockData>,\n Partial<CreditUtilizationBlockData>,\n Partial<CommonProps> {}\n\n//when any of the type is used more than one times, we can use the common props\ninterface CommonProps {\n amount?: number\n ariaLabel?: string\n date?: string\n legends?: Legends[]\n category_guid?: string\n data_series?: DataSeries | DataSet[]\n transaction_guids?: string[]\n account_guids?: string[]\n primary_transaction_guid?: string\n}\n\n//BarChart Block: `instance_slot.data` (Insights 2.0)\nexport interface BarChartBlockData {\n series?: DataSeries\n category_guid?: string\n average_amount?: number\n /** [0] monthly amount, [1] trend. */\n additional_data?: Legends[]\n}\n\n//DonutChart Block\ninterface Main {\n value: string\n value_type: string\n label: string\n}\nexport interface DonutChartBlockData {\n main: Main\n}\n\n//DoubleBarChart Block\n// TODO : This has to be revisited again to update the below types based on API response once we have the final shape of the data_series for double bar chart from BE\nexport interface LegendProps extends Legends {\n amount: number\n formattedAmount: string\n label: string\n color?: string\n}\n\nexport interface DataSet extends DataSeries {\n ariaLabelComparison: string\n ariaLabelMain: string\n comparison: number\n // The comparison bar's transaction guids (data_series aggregated_guids), for the drawer filter.\n comparisonGuids?: string[]\n // The month's 'yyyy-MM-dd' date (the main row's).\n date?: string\n formattedComparison: string\n formattedMain: string\n label: string\n main: number\n // The main bar's transaction guids (data_series aggregated_guids), for the drawer filter.\n mainGuids?: string[]\n}\n\n//DoubleProgressBar Block\n\n//Image Block\nexport interface ImageBlockData {\n image: string\n}\n\n//Account Block\nexport interface AccountBlockData {\n sub_text: string\n institution_guid?: string\n institution_name?: string\n icon_name?: string\n /** Header bar text (standard card), or the colored category strip label (deposit cards). */\n header_text?: string\n // Deposit variants (Unified Deposit, Unified Deposit Emergency Fund, Savings Account Deposit)\n /** Merchant guid — renders a real merchant logo in the deposit card when present. */\n merchant_guid?: string\n /** Merchant display name — logo alt text and the payer line under the amount. */\n merchant_name?: string\n /** Secondary label beside the amount, e.g. `On {date}, you saved` or `Balance as of MM/DD/YY`. */\n label?: string\n}\n\nexport interface SaveExtraBlockData {\n /** Styled segments `[lead-in, amount digits, trailing copy]`, e.g. `['Save an extra', '100', 'to help your funds grow']`. */\n primary_text?: string[]\n /** Styled segments `[projected balance, caption]`, e.g. `['$8,313.87', 'After payday & projected expenses']`. */\n secondary_text?: string[]\n /** MakeTransfer drilldown: available balance (both variants). */\n available_balance?: number\n /** SAVE_ENOUGH_TO_LIVE_ON: average monthly spend. */\n avg_monthly_spend?: number\n /** SAVE_ENOUGH_TO_LIVE_ON: how long the balance lasts, overlaid on the timeline SVG (e.g. \"2 months, 11 days\"). */\n time_period?: string\n /** SAVE_AN_EXTRA_100: upcoming expenses (the \"Expenses\" figure). */\n upcoming_expenses?: number\n /** SAVE_AN_EXTRA_100: total remaining after expenses. */\n total_remaining?: number\n /** SAVE_ENOUGH_TO_LIVE_ON: date for the \"Your available balances as of {date}\" line. */\n date?: string\n}\n\n// AccountSwitch Block. State comes from `instance_slot.variant`, not a data flag.\nexport interface AccountSwitchBlockData {\n discovered_institution_guid: string\n discovered_institution_name: string\n held_institution_guid: string\n held_institution_name: string\n}\n\n// AccountSwitch Block: `instance_slot.data` (Insights 2.0, Discovered Accounts V2). Each slot is\n// optional: tupac omits `to_logo` when the user holds no FI-managed account. `logo` is the compact\n// card's (micro, notification) discovered institution.\nexport interface AccountSwitchBlockV2Data {\n from_logo?: LogoRef\n to_logo?: LogoRef\n logo?: LogoRef\n}\n\n// StepChart Block\nexport interface StepChartBlockData {\n completed_steps: number\n label_1: string\n label_2?: string\n}\n\n//Budgets Blocks\nexport enum BudgetTierType {\n LOW_BUDGET_TIER = 'LOW',\n MEDIUM_BUDGET_TIER = 'MEDIUM',\n OFF_TRACK_BUDGET_TIER = 'OFF_TRACK',\n}\n\nexport type BudgetTierValue = `${BudgetTierType}`\n\nexport interface BudgetLocalizedPayload {\n primary_text?: string\n amount_left_label?: string\n spent_label?: string\n budgeted_label?: string\n}\n\nexport interface BudgetBlockData {\n budget_percent: number\n budget_tier: BudgetTierValue\n category_guid?: string\n merchant_guid?: string\n spent_amount: number\n budgeted_amount: number\n localized_payload: BudgetLocalizedPayload\n}\n\nexport interface SVGImageBlockData {\n isCIBC?: boolean\n}\n\n// TransactionDetails Action Block\n// The drawer's subject is `InsightsPayload.primary_transaction_guid`; only action configuration\n// lives here.\nexport interface TransactionDetailsBlockData {\n /** `TopActions` member names, e.g. `['Category', 'Date', 'Memo']`. Omit for the defaults. */\n top_actions?: string[]\n /** `BottomActions` member names, e.g. `['MerchantBudget', 'HideTransaction']`. Omit for defaults. */\n bottom_actions?: string[]\n}\n\n// Credit Utilization action block. The per-card rows are the beat's `data_series` table\n// (`guid`, `label`, `amount`, `total_amount`, `percentage`), carried on `CommonProps.data_series`.\nexport interface CreditUtilizationBlockData {\n accounts_balance_sum?: number\n accounts_credit_limit_sum?: number\n credit_utilization_percentage?: number\n}\n"],"mappings":"AA6IA,IAAY,IAAL,0BAAA,GAAA;AACL,SAAA,EAAA,kBAAA,OACA,EAAA,qBAAA,UACA,EAAA,wBAAA;AACF,GAAA,CAAA,CAAA"}
@@ -26,6 +26,9 @@ interface GeneralInsightsFeedCopy {
26
26
  /** `_1{institution}` — the alt text of an institution's logo, e.g. "Chase Institution Logo". */
27
27
  institution_Logo?: string;
28
28
  weekly_no_spending_component_alt_text?: DynamicKeyValue;
29
+ in_month_you_had_a_category_of_amount?: string;
30
+ income_transactions?: string;
31
+ spend_transactions?: string;
29
32
  }
30
33
  interface SettingsMenuCopy {
31
34
  close: string;
@@ -1,6 +1,7 @@
1
1
  import { default as React } from 'react';
2
2
  import { TipSectionProps } from '../../../insights/components/shared/ChartDrawerTemplate/TipSection';
3
3
  import { Transaction } from '../../../core';
4
+ import { SubTabsProps } from '../../components/SubTabs';
4
5
  interface TabItem {
5
6
  label: string;
6
7
  ariaLabel?: string;
@@ -18,8 +19,9 @@ interface TransactionDrillDownProps {
18
19
  onEachRowClick?: (guid: string) => void;
19
20
  transactionFilter?: (selectedIndex: number) => (transaction: Transaction) => boolean;
20
21
  baseTransactions?: Transaction[];
22
+ subTabs?: Omit<SubTabsProps, 'id'>;
21
23
  }
22
- export declare const TransactionDrillDown: (({ ariaLabel, heading, subHeadingText, icon, tabs, selectedIndex, top, onSelectionChange, transactionFilter, tipSection, onEachRowClick, baseTransactions, }: TransactionDrillDownProps) => import("react/jsx-runtime").JSX.Element) & {
24
+ export declare const TransactionDrillDown: (({ ariaLabel, heading, subHeadingText, icon, tabs, selectedIndex, top, onSelectionChange, transactionFilter, tipSection, onEachRowClick, baseTransactions, subTabs, }: TransactionDrillDownProps) => import("react/jsx-runtime").JSX.Element) & {
23
25
  displayName: string;
24
26
  };
25
27
  export default TransactionDrillDown;
@@ -1,113 +1,123 @@
1
- import { useGlobalCopyStore as $, useGlobalUiStore as j, useTransactionStore as G } from "../../../common/context/hooks.es.js";
2
- import { exportTransactionsToCSV as P } from "../../../core/utils/TransactionUtils.es.js";
3
- import A from "../../../common/components/Loader.es.js";
4
- import E from "../../../transactions/components/shared/TransactionList.es.js";
5
- import { TipSection as N } from "../../../insights/components/shared/ChartDrawerTemplate/TipSection.es.js";
1
+ import { useGlobalCopyStore as A, useGlobalUiStore as G, useTransactionStore as U } from "../../../common/context/hooks.es.js";
2
+ import { exportTransactionsToCSV as E } from "../../../core/utils/TransactionUtils.es.js";
3
+ import N from "../../../common/components/Loader.es.js";
4
+ import R from "../../../transactions/components/shared/TransactionList.es.js";
5
+ import { TipSection as V } from "../../../insights/components/shared/ChartDrawerTemplate/TipSection.es.js";
6
+ import { SubTabs as q, subTabPanelProps as z } from "../../components/SubTabs.es.js";
6
7
  import "react";
7
- import { observer as R } from "mobx-react-lite";
8
- import c from "@mui/material/Stack";
9
- import { H3 as U, Text as m } from "@mxenabled/mxui";
10
- import V from "@mui/material/Button";
11
- import { Icon as q } from "@mxenabled/mx-icons";
12
- import { jsx as o, jsxs as r } from "react/jsx-runtime";
13
- import p from "@mui/material/Box";
14
- import z from "@mui/material/Tab";
15
- import J from "@mui/material/Tabs";
16
- var v = "transaction-drill-down-panel", T = (d) => `transaction-details-tab-${d}`, lo = R(function({ ariaLabel: y, heading: i, subHeadingText: n, icon: C, tabs: b, selectedIndex: e, top: g, onSelectionChange: _, transactionFilter: f, tipSection: h, onEachRowClick: w, baseTransactions: D }) {
17
- const { transactions: l } = $(), { isCopyLoaded: S } = j(), { sortedTransactionsWithSplits: L, tags: B, detailedTransactions: I } = G();
18
- if (!S) return /* @__PURE__ */ o(A, {});
19
- const s = !!b?.length, k = y ?? l.transactions_title, W = (t, a) => {
20
- _?.(a);
21
- }, x = f ? (D ?? I).filter(f(e)) : void 0, u = x ?? L;
22
- return /* @__PURE__ */ r(p, {
8
+ import { observer as J } from "mobx-react-lite";
9
+ import m from "@mui/material/Stack";
10
+ import { H3 as K, Text as p } from "@mxenabled/mxui";
11
+ import M from "@mui/material/Button";
12
+ import { Icon as O } from "@mxenabled/mx-icons";
13
+ import { jsx as r, jsxs as o } from "react/jsx-runtime";
14
+ import n from "@mui/material/Box";
15
+ import Q from "@mui/material/Tab";
16
+ import X from "@mui/material/Tabs";
17
+ var y = "transaction-drill-down-panel", C = (b) => `transaction-details-tab-${b}`, S = "transaction-drill-down-series", br = J(function({ ariaLabel: _, heading: e, subHeadingText: s, icon: g, tabs: f, selectedIndex: l, top: w, onSelectionChange: D, transactionFilter: h, tipSection: v, onEachRowClick: B, baseTransactions: I, subTabs: x }) {
18
+ const { transactions: c } = A(), { isCopyLoaded: L } = G(), { sortedTransactionsWithSplits: k, tags: P, detailedTransactions: W } = U();
19
+ if (!L) return /* @__PURE__ */ r(N, {});
20
+ const d = !!f?.length, t = x?.tabs.length ? x : void 0, $ = _ ?? c.transactions_title, j = (a, i) => {
21
+ D?.(i);
22
+ }, T = h ? (I ?? W).filter(h(l)) : void 0, u = T ?? k;
23
+ return /* @__PURE__ */ o(n, {
23
24
  sx: {
24
25
  bgcolor: "background.paper",
25
26
  width: "100%"
26
27
  },
27
- children: [s && /* @__PURE__ */ o(J, {
28
- "aria-label": k,
29
- onChange: W,
30
- value: e,
28
+ children: [d && /* @__PURE__ */ r(X, {
29
+ "aria-label": $,
30
+ onChange: j,
31
+ value: l,
31
32
  variant: "fullWidth",
32
- children: b.map((t, a) => /* @__PURE__ */ o(z, {
33
- "aria-controls": v,
34
- "aria-label": t.ariaLabel,
35
- id: T(a),
36
- label: t.label,
33
+ children: f.map((a, i) => /* @__PURE__ */ r(Q, {
34
+ "aria-controls": y,
35
+ "aria-label": a.ariaLabel,
36
+ id: C(i),
37
+ label: a.label,
37
38
  sx: {
38
39
  minWidth: "auto",
39
40
  px: 0
40
41
  }
41
- }, `${t.label}-${a}`))
42
- }), /* @__PURE__ */ r(p, {
43
- "aria-labelledby": s ? T(e) : void 0,
44
- id: v,
45
- role: s ? "tabpanel" : void 0,
42
+ }, `${a.label}-${i}`))
43
+ }), /* @__PURE__ */ o(n, {
44
+ "aria-labelledby": d ? C(l) : void 0,
45
+ id: y,
46
+ role: d ? "tabpanel" : void 0,
46
47
  children: [
47
- (i || n) && /* @__PURE__ */ r(c, {
48
+ (e || s) && /* @__PURE__ */ o(m, {
48
49
  sx: {
49
50
  gap: 4,
50
51
  pt: 16,
51
52
  px: 24
52
53
  },
53
- children: [i && /* @__PURE__ */ o(U, { children: i }), n && /* @__PURE__ */ r(c, {
54
+ children: [e && /* @__PURE__ */ r(K, { children: e }), s && /* @__PURE__ */ o(m, {
54
55
  sx: {
55
56
  alignItems: "center",
56
57
  flexDirection: "row",
57
58
  gap: 8
58
59
  },
59
- children: [C, /* @__PURE__ */ o(m, {
60
+ children: [g, /* @__PURE__ */ r(p, {
60
61
  textTransform: "uppercase",
61
62
  variant: "body2",
62
- children: n
63
+ children: s
63
64
  })]
64
65
  })]
65
66
  }),
66
- /* @__PURE__ */ o(p, {
67
+ /* @__PURE__ */ r(n, {
67
68
  sx: { pt: 16 },
68
- children: g
69
+ children: w
69
70
  }),
70
- h && /* @__PURE__ */ o(N, { ...h }),
71
- /* @__PURE__ */ r(c, {
72
- sx: {
73
- alignItems: "center",
74
- borderBottomColor: "divider",
75
- borderBottomStyle: "solid",
76
- borderBottomWidth: 1,
77
- flexDirection: "row",
78
- justifyContent: "space-between",
79
- pb: 4,
80
- pt: 16,
81
- px: 24
82
- },
83
- children: [/* @__PURE__ */ o(m, {
84
- bold: !0,
85
- variant: "body1",
86
- children: l.transactions_title
87
- }), u.length > 0 && /* @__PURE__ */ o(V, {
88
- onClick: () => {
89
- P(u, B);
90
- },
91
- startIcon: /* @__PURE__ */ o(q, { name: "ios_share" }),
92
- sx: { height: 28 },
93
- children: /* @__PURE__ */ o(m, {
94
- bold: !0,
95
- variant: "body2",
96
- children: l.export_csv_btn
97
- })
98
- })]
71
+ t && /* @__PURE__ */ r(q, {
72
+ ...t,
73
+ id: S
99
74
  }),
100
- /* @__PURE__ */ o(E, {
101
- transaction: x,
102
- onClick: w
75
+ /* @__PURE__ */ o(n, {
76
+ ...t && z(S, t.selectedIndex),
77
+ children: [
78
+ v && /* @__PURE__ */ r(V, { ...v }),
79
+ /* @__PURE__ */ o(m, {
80
+ sx: {
81
+ alignItems: "center",
82
+ borderBottomColor: "divider",
83
+ borderBottomStyle: "solid",
84
+ borderBottomWidth: 1,
85
+ flexDirection: "row",
86
+ justifyContent: "space-between",
87
+ pb: 4,
88
+ pt: 16,
89
+ px: 24
90
+ },
91
+ children: [/* @__PURE__ */ r(p, {
92
+ bold: !0,
93
+ variant: "body1",
94
+ children: c.transactions_title
95
+ }), u.length > 0 && /* @__PURE__ */ r(M, {
96
+ onClick: () => {
97
+ E(u, P);
98
+ },
99
+ startIcon: /* @__PURE__ */ r(O, { name: "ios_share" }),
100
+ sx: { height: 28 },
101
+ children: /* @__PURE__ */ r(p, {
102
+ bold: !0,
103
+ variant: "body2",
104
+ children: c.export_csv_btn
105
+ })
106
+ })]
107
+ }),
108
+ /* @__PURE__ */ r(R, {
109
+ transaction: T,
110
+ onClick: B
111
+ })
112
+ ]
103
113
  })
104
114
  ]
105
115
  })]
106
116
  });
107
117
  });
108
118
  export {
109
- lo as TransactionDrillDown,
110
- lo as default
119
+ br as TransactionDrillDown,
120
+ br as default
111
121
  };
112
122
 
113
123
  //# sourceMappingURL=TransactionDrillDown.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TransactionDrillDown.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\nimport Tab from '@mui/material/Tab'\nimport Tabs from '@mui/material/Tabs'\nimport { observer } from 'mobx-react-lite'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { H3, Text } from '@mxenabled/mxui'\n\nimport {\n TipSection,\n type TipSectionProps,\n} from '../../../insights/components/shared/ChartDrawerTemplate/TipSection'\nimport { Loader, useGlobalCopyStore, useGlobalUiStore, useTransactionStore } from '../../../common'\nimport type { Transaction } from '../../../core'\nimport { exportTransactionsToCSV } from '../../../core/utils/TransactionUtils'\nimport { TransactionList } from '../../../transactions'\n\ninterface TabItem {\n label: string\n ariaLabel?: string\n}\n\nconst PANEL_ID = 'transaction-drill-down-panel'\nconst tabId = (index: number) => `transaction-details-tab-${index}`\n\ninterface TransactionDrillDownProps {\n ariaLabel?: string\n heading?: string\n subHeadingText?: string\n icon?: React.ReactNode\n tabs?: TabItem[]\n selectedIndex: number\n top: React.ReactNode\n tipSection?: TipSectionProps | false\n onSelectionChange?: (selectedIndex: number) => void\n onEachRowClick?: (guid: string) => void\n transactionFilter?: (selectedIndex: number) => (transaction: Transaction) => boolean\n baseTransactions?: Transaction[]\n}\n\nexport const TransactionDrillDown = observer(function TransactionDrillDown({\n ariaLabel,\n heading,\n subHeadingText,\n icon,\n tabs,\n selectedIndex,\n top,\n onSelectionChange,\n transactionFilter,\n tipSection,\n onEachRowClick,\n baseTransactions,\n}: TransactionDrillDownProps) {\n const { transactions: transactionsCopy } = useGlobalCopyStore()\n const { isCopyLoaded } = useGlobalUiStore()\n const { sortedTransactionsWithSplits, tags, detailedTransactions } = useTransactionStore()\n\n if (!isCopyLoaded) return <Loader />\n\n const hasTabs = !!tabs?.length\n const tablistLabel = ariaLabel ?? transactionsCopy.transactions_title\n\n const handlePrimaryChange = (_event: React.SyntheticEvent, newValue: number) => {\n onSelectionChange?.(newValue)\n }\n\n const filteredTransactions = transactionFilter\n ? (baseTransactions ?? detailedTransactions).filter(transactionFilter(selectedIndex))\n : undefined\n\n const exportTransactions = filteredTransactions ?? sortedTransactionsWithSplits\n\n return (\n <Box sx={{ bgcolor: 'background.paper', width: '100%' }}>\n {hasTabs && (\n <Tabs\n aria-label={tablistLabel}\n onChange={handlePrimaryChange}\n value={selectedIndex}\n variant=\"fullWidth\"\n >\n {tabs!.map((tab, index) => (\n <Tab\n aria-controls={PANEL_ID}\n aria-label={tab.ariaLabel}\n id={tabId(index)}\n key={`${tab.label}-${index}`}\n label={tab.label}\n sx={{ minWidth: 'auto', px: 0 }}\n />\n ))}\n </Tabs>\n )}\n\n <Box\n aria-labelledby={hasTabs ? tabId(selectedIndex) : undefined}\n id={PANEL_ID}\n role={hasTabs ? 'tabpanel' : undefined}\n >\n {(heading || subHeadingText) && (\n <Stack sx={{ gap: 4, pt: 16, px: 24 }}>\n {heading && <H3>{heading}</H3>}\n {subHeadingText && (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 8 }}>\n {icon}\n <Text textTransform=\"uppercase\" variant=\"body2\">\n {subHeadingText}\n </Text>\n </Stack>\n )}\n </Stack>\n )}\n\n <Box sx={{ pt: 16 }}>{top}</Box>\n\n {/* TODO: need to use a nseperate compnent from insight-v2, for now using insights-shared component which will be shifted under insights-v2 in future */}\n {tipSection && <TipSection {...tipSection} />}\n\n <Stack\n sx={{\n alignItems: 'center',\n borderBottomColor: 'divider',\n borderBottomStyle: 'solid',\n borderBottomWidth: 1,\n flexDirection: 'row',\n justifyContent: 'space-between',\n pb: 4,\n pt: 16,\n px: 24,\n }}\n >\n <Text bold={true} variant=\"body1\">\n {transactionsCopy.transactions_title}\n </Text>\n {exportTransactions.length > 0 && (\n <Button\n onClick={() => {\n exportTransactionsToCSV(exportTransactions, tags)\n }}\n startIcon={<Icon name=\"ios_share\" />}\n sx={{ height: 28 }}\n >\n <Text bold={true} variant=\"body2\">\n {transactionsCopy.export_csv_btn}\n </Text>\n </Button>\n )}\n </Stack>\n\n <TransactionList transaction={filteredTransactions} onClick={onEachRowClick} />\n </Box>\n </Box>\n )\n})\n\nexport default TransactionDrillDown\n"],"mappings":"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"}
1
+ {"version":3,"file":"TransactionDrillDown.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\nimport Tab from '@mui/material/Tab'\nimport Tabs from '@mui/material/Tabs'\nimport { observer } from 'mobx-react-lite'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { H3, Text } from '@mxenabled/mxui'\n\nimport {\n TipSection,\n type TipSectionProps,\n} from '../../../insights/components/shared/ChartDrawerTemplate/TipSection'\nimport { Loader, useGlobalCopyStore, useGlobalUiStore, useTransactionStore } from '../../../common'\nimport type { Transaction } from '../../../core'\nimport { exportTransactionsToCSV } from '../../../core/utils/TransactionUtils'\nimport { TransactionList } from '../../../transactions'\nimport { SubTabs, subTabPanelProps, type SubTabsProps } from '../../components/SubTabs'\n\ninterface TabItem {\n label: string\n ariaLabel?: string\n}\n\nconst PANEL_ID = 'transaction-drill-down-panel'\nconst tabId = (index: number) => `transaction-details-tab-${index}`\nconst SUB_TABS_ID = 'transaction-drill-down-series'\n\ninterface TransactionDrillDownProps {\n ariaLabel?: string\n heading?: string\n subHeadingText?: string\n icon?: React.ReactNode\n tabs?: TabItem[]\n selectedIndex: number\n top: React.ReactNode\n tipSection?: TipSectionProps | false\n onSelectionChange?: (selectedIndex: number) => void\n onEachRowClick?: (guid: string) => void\n transactionFilter?: (selectedIndex: number) => (transaction: Transaction) => boolean\n baseTransactions?: Transaction[]\n // A second row of tabs between the chart and the list (the double-bar drawer's main / comparison\n // series, e.g. Spend / Income). Omitted for every single-series drawer.\n subTabs?: Omit<SubTabsProps, 'id'>\n}\n\nexport const TransactionDrillDown = observer(function TransactionDrillDown({\n ariaLabel,\n heading,\n subHeadingText,\n icon,\n tabs,\n selectedIndex,\n top,\n onSelectionChange,\n transactionFilter,\n tipSection,\n onEachRowClick,\n baseTransactions,\n subTabs,\n}: TransactionDrillDownProps) {\n const { transactions: transactionsCopy } = useGlobalCopyStore()\n const { isCopyLoaded } = useGlobalUiStore()\n const { sortedTransactionsWithSplits, tags, detailedTransactions } = useTransactionStore()\n\n if (!isCopyLoaded) return <Loader />\n\n const hasTabs = !!tabs?.length\n // Only a non-empty row gets the tabs and their panel.\n const seriesTabs = subTabs?.tabs.length ? subTabs : undefined\n const tablistLabel = ariaLabel ?? transactionsCopy.transactions_title\n\n const handlePrimaryChange = (_event: React.SyntheticEvent, newValue: number) => {\n onSelectionChange?.(newValue)\n }\n\n const filteredTransactions = transactionFilter\n ? (baseTransactions ?? detailedTransactions).filter(transactionFilter(selectedIndex))\n : undefined\n\n const exportTransactions = filteredTransactions ?? sortedTransactionsWithSplits\n\n return (\n <Box sx={{ bgcolor: 'background.paper', width: '100%' }}>\n {hasTabs && (\n <Tabs\n aria-label={tablistLabel}\n onChange={handlePrimaryChange}\n value={selectedIndex}\n variant=\"fullWidth\"\n >\n {tabs!.map((tab, index) => (\n <Tab\n aria-controls={PANEL_ID}\n aria-label={tab.ariaLabel}\n id={tabId(index)}\n key={`${tab.label}-${index}`}\n label={tab.label}\n sx={{ minWidth: 'auto', px: 0 }}\n />\n ))}\n </Tabs>\n )}\n\n <Box\n aria-labelledby={hasTabs ? tabId(selectedIndex) : undefined}\n id={PANEL_ID}\n role={hasTabs ? 'tabpanel' : undefined}\n >\n {(heading || subHeadingText) && (\n <Stack sx={{ gap: 4, pt: 16, px: 24 }}>\n {heading && <H3>{heading}</H3>}\n {subHeadingText && (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 8 }}>\n {icon}\n <Text textTransform=\"uppercase\" variant=\"body2\">\n {subHeadingText}\n </Text>\n </Stack>\n )}\n </Stack>\n )}\n\n <Box sx={{ pt: 16 }}>{top}</Box>\n\n {seriesTabs && <SubTabs {...seriesTabs} id={SUB_TABS_ID} />}\n\n {/* The content the sub-tabs control, as the month tabs' panel above. */}\n <Box {...(seriesTabs && subTabPanelProps(SUB_TABS_ID, seriesTabs.selectedIndex))}>\n {/* TODO: need to use a nseperate compnent from insight-v2, for now using insights-shared component which will be shifted under insights-v2 in future */}\n {tipSection && <TipSection {...tipSection} />}\n\n <Stack\n sx={{\n alignItems: 'center',\n borderBottomColor: 'divider',\n borderBottomStyle: 'solid',\n borderBottomWidth: 1,\n flexDirection: 'row',\n justifyContent: 'space-between',\n pb: 4,\n pt: 16,\n px: 24,\n }}\n >\n <Text bold={true} variant=\"body1\">\n {transactionsCopy.transactions_title}\n </Text>\n {exportTransactions.length > 0 && (\n <Button\n onClick={() => {\n exportTransactionsToCSV(exportTransactions, tags)\n }}\n startIcon={<Icon name=\"ios_share\" />}\n sx={{ height: 28 }}\n >\n <Text bold={true} variant=\"body2\">\n {transactionsCopy.export_csv_btn}\n </Text>\n </Button>\n )}\n </Stack>\n\n <TransactionList transaction={filteredTransactions} onClick={onEachRowClick} />\n </Box>\n </Box>\n </Box>\n )\n})\n\nexport default TransactionDrillDown\n"],"mappings":"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"}
@@ -1,77 +1,98 @@
1
- import { useGlobalCopyStore as Z, useGlobalUiStore as tt, useInsightsV2Store as et } from "../../../common/context/hooks.es.js";
2
- import { formatCurrency as ot } from "../../../core/utils/NumberFormatting.es.js";
3
- import at from "../../../common/components/drawer/Drawer.es.js";
4
- import nt from "../../../common/components/Loader.es.js";
5
- import { BAR_ARIA_LABEL as rt } from "../../blocks/ChartBlocks/BarchartBlock/utils.es.js";
6
- import { BarChartV2 as it } from "../../components/chartblocks/BarchartV2.es.js";
7
- import { EmptyBarChart as st } from "../../components/chartblocks/EmptyBarChart.es.js";
8
- import { ANALYTICS_EVENTS_CONFIG as B } from "../../analytics/analyticsEventsConfig.es.js";
9
- import { useAnalyticsEvent as lt } from "../../analytics/useAnalyticsEvent.es.js";
10
- import { TransactionDrillDown as ct } from "./TransactionDrillDown.es.js";
11
- import { getDefaultSelection as mt, getDrillDownConfig as dt, getFlattenedDataSeries as pt, resolveDrillDownSubHeader as gt, toStoreFilter as ut } from "./utils.es.js";
12
- import { useTransactionHistory as ft } from "./useTransactionHistory.es.js";
13
- import { getDynamicCtaBasedOnTriggers as ht } from "../util.es.js";
14
- import { TransactionDetailsBlock as yt } from "../TransactionDetailsBlock/TransactionDetailsBlock.es.js";
15
- import { useLayoutEffect as Ct, useState as u } from "react";
16
- import { observer as bt } from "mobx-react-lite";
17
- import { Fragment as Tt, jsx as a, jsxs as _t } from "react/jsx-runtime";
18
- import { useTheme as St } from "@mui/material/styles";
19
- var Vt = bt(({ beat: o }) => {
20
- const f = St(), { instanceSlotData: e, beatTransactions: l, spendCategoryGuids: h, allAccountGuids: y, categoryName: x, displayedDateRange: p, transactionStore: E } = ft(o), { actionDrawer: C, setActionContext: b } = et(), { common: I, insights_feed: c } = Z(), { isCopyLoaded: F } = tt(), [G, T] = u(!1), [R, H] = u(!1), _ = lt(), { insights_payload: n } = o, w = ht(C, n?.primary_cta, n?.secondary_cta, n?.in_description_cta)?.variant, { top: r, filterMode: m, header: O, colors: j, filterStrategy: k, tipSection: S } = dt(w ?? ""), { dataSeries: d, chartData: i, comparisonBars: K } = pt({
1
+ import { useGlobalCopyStore as lt, useGlobalUiStore as ct, useInsightsV2Store as mt } from "../../../common/context/hooks.es.js";
2
+ import { formatCurrency as dt } from "../../../core/utils/NumberFormatting.es.js";
3
+ import ut from "../../../common/components/drawer/Drawer.es.js";
4
+ import gt from "../../../common/components/Loader.es.js";
5
+ import { BAR_ARIA_LABEL as pt } from "../../blocks/ChartBlocks/BarchartBlock/utils.es.js";
6
+ import { BarChartV2 as bt } from "../../components/chartblocks/BarchartV2.es.js";
7
+ import { EmptyBarChart as ft } from "../../components/chartblocks/EmptyBarChart.es.js";
8
+ import { ANALYTICS_EVENTS_CONFIG as k } from "../../analytics/analyticsEventsConfig.es.js";
9
+ import { useAnalyticsEvent as ht } from "../../analytics/useAnalyticsEvent.es.js";
10
+ import { DoubleBarChart as _t } from "../../components/chartblocks/DoubleBarChart.es.js";
11
+ import { toLegendItems as Ct } from "../../blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils.es.js";
12
+ import { TransactionDrillDown as yt } from "./TransactionDrillDown.es.js";
13
+ import { getDefaultSelection as Tt, getDrillDownConfig as At, getFlattenedDataSeries as St, resolveDrillDownSubHeader as Bt, toStoreFilter as Dt } from "./utils.es.js";
14
+ import { useTransactionHistory as Lt } from "./useTransactionHistory.es.js";
15
+ import { getDynamicCtaBasedOnTriggers as vt } from "../util.es.js";
16
+ import { TransactionDetailsBlock as It } from "../TransactionDetailsBlock/TransactionDetailsBlock.es.js";
17
+ import { useLayoutEffect as xt, useState as p } from "react";
18
+ import { observer as Et } from "mobx-react-lite";
19
+ import { Fragment as Rt, jsx as n, jsxs as Ft } from "react/jsx-runtime";
20
+ import { useTheme as Gt } from "@mui/material/styles";
21
+ var oe = Et(({ beat: r }) => {
22
+ const y = Gt(), { instanceSlotData: e, beatTransactions: m, spendCategoryGuids: T, allAccountGuids: A, categoryName: N, displayedDateRange: b, transactionStore: K } = Lt(r), { actionDrawer: S, setActionContext: B } = mt(), { common: V, insights_feed: i } = lt(), { isCopyLoaded: M } = ct(), [P, D] = p(!1), [U, W] = p(!1), L = ht(), { insights_payload: l } = r, Y = vt(S, l?.primary_cta, l?.secondary_cta, l?.in_description_cta)?.variant, { top: a, filterMode: d, header: $, colors: q, filterStrategy: z, tipSection: v, subTabAriaLabels: J } = At(Y ?? ""), { dataSeries: f, chartData: u, comparisonBars: s } = St({
21
23
  data: e?.data_series,
22
- ariaLabel: rt,
23
- top: r,
24
- beatTransactions: l,
24
+ ariaLabel: a === "doubleBar" ? i?.general?.in_month_you_had_a_category_of_amount ?? "_1{month}, _2{category}: _3{amount}" : pt,
25
+ top: a,
26
+ beatTransactions: m,
25
27
  payload: e
26
- }), { chartBarIndex: N, subTabIndex: V } = mt({
27
- chartTabCount: i.length,
28
- comparisonTabCount: K.length,
29
- actionDrawer: C,
30
- beatGuid: o.guid
31
- }), [s, D] = u(N), A = (t) => k({
32
- beat: o,
33
- beatTransactions: l,
34
- dataSeries: d,
28
+ }), c = a === "doubleBar", h = c ? s : u, { chartBarIndex: Q, subTabIndex: X } = Tt({
29
+ chartTabCount: u.length,
30
+ comparisonTabCount: s.length,
31
+ actionDrawer: S,
32
+ beatGuid: r.guid
33
+ }), [o, I] = p(Q), [_, x] = p(X), E = (t) => z({
34
+ beat: r,
35
+ beatTransactions: m,
36
+ dataSeries: f,
37
+ comparisonBars: s,
35
38
  selectedIndex: t,
36
- subIndex: V,
37
- isLastTab: t === d.length - 1,
39
+ subIndex: _,
40
+ isLastTab: t === h.length - 1,
38
41
  instanceSlotData: e,
39
- spendCategoryGuids: h,
40
- displayedDateRange: p
41
- }), M = l.map((t) => t.guid).join(","), P = h.join(","), U = y.join(","), W = r === "list" || d.length > 0, v = () => {
42
- m !== "store" || !W || E.setFilter(ut(A(s), {
43
- allAccountGuids: y,
44
- displayedDateRange: p
42
+ spendCategoryGuids: T,
43
+ displayedDateRange: b
44
+ }), Z = m.map((t) => t.guid).join(","), tt = T.join(","), et = A.join(","), ot = a === "list" || f.length > 0, R = () => {
45
+ d !== "store" || !ot || K.setFilter(Dt(E(o), {
46
+ allAccountGuids: A,
47
+ displayedDateRange: b
45
48
  }));
46
49
  };
47
- Ct(() => {
48
- v();
50
+ xt(() => {
51
+ R();
49
52
  }, [
50
- o.guid,
51
- s,
52
- m,
53
- d.length,
53
+ r.guid,
54
+ o,
55
+ _,
56
+ d,
57
+ f.length,
54
58
  e,
55
- p,
56
- P,
57
- U,
58
- M,
59
- r
59
+ b,
60
+ tt,
61
+ et,
62
+ Z,
63
+ a
60
64
  ]);
61
- const L = gt(n), g = O?.({
62
- title: n?.title,
63
- subHeader: L,
64
- categoryName: x,
65
- selectedDate: i[s]?.date ?? void 0
66
- }), Y = j(f, e?.category_guid);
67
- if (!F) return /* @__PURE__ */ a(nt, {});
68
- const $ = [c.general.monthly_amount, c.general.trend], [q, z] = e?.legends?.length ? e.legends.map((t) => t.label) : $, J = m === "local" ? (t) => A(t).custom ?? (() => !0) : void 0, Q = m === "local" ? l : void 0, X = r === "singleBar" || r === "upcomingBill" ? i.length ? /* @__PURE__ */ a(it, {
65
+ const F = Bt(l), C = $?.({
66
+ title: l?.title,
67
+ subHeader: F,
68
+ categoryName: N,
69
+ selectedDate: u[o]?.date ?? void 0
70
+ }), G = q(y, e?.category_guid);
71
+ if (!M) return /* @__PURE__ */ n(gt, {});
72
+ const [O, H] = e?.legends ?? [], at = d === "local" ? (t) => E(t).custom ?? (() => !0) : void 0, nt = d === "local" ? m : void 0, w = (t, g) => {
73
+ L(k.DRAWER_CHART_BAR_CLICKED), I(t), g !== void 0 && x(g);
74
+ }, rt = (t) => {
75
+ L(k.TAB_SELECTED), I(t);
76
+ }, j = c ? Ct([{
77
+ ...O,
78
+ value: s[o]?.main
79
+ }, {
80
+ ...H,
81
+ value: s[o]?.comparison
82
+ }]) : void 0, it = J?.(i) ?? [], st = c || a === "singleBar" || a === "upcomingBill" ? h.length ? c ? /* @__PURE__ */ n(_t, {
83
+ bars: s,
84
+ colors: G,
85
+ legendPosition: "top",
86
+ legends: j,
87
+ onBarClick: w,
88
+ selectedIndex: o
89
+ }) : /* @__PURE__ */ n(bt, {
69
90
  amounts: {
70
91
  average: e?.average_amount,
71
- formattedAverage: ot(e?.average_amount ?? 0, "0,0.00")
92
+ formattedAverage: dt(e?.average_amount ?? 0, "0,0.00")
72
93
  },
73
- color: Y[0] ?? f.palette.primary.main,
74
- data: i,
94
+ color: G[0] ?? y.palette.primary.main,
95
+ data: u,
75
96
  legendPosition: "top",
76
97
  heightOverride: 142,
77
98
  margin: {
@@ -80,44 +101,45 @@ var Vt = bt(({ beat: o }) => {
80
101
  left: 24,
81
102
  right: 24
82
103
  },
83
- monthlyAmountLabel: q,
84
- onBarClick: (t) => {
85
- _(B.DRAWER_CHART_BAR_CLICKED), D(t);
86
- },
87
- selectedTabIndex: s,
88
- trendAmountLabel: z
89
- }) : /* @__PURE__ */ a(st, {}) : null;
90
- return /* @__PURE__ */ _t(Tt, { children: [/* @__PURE__ */ a(ct, {
91
- baseTransactions: Q,
92
- heading: g?.heading,
93
- icon: g?.icon,
94
- onSelectionChange: (t) => {
95
- _(B.TAB_SELECTED), D(t);
96
- },
97
- selectedIndex: s,
98
- subHeadingText: g?.subHeadingText,
99
- tabs: i.map((t) => ({
100
- ariaLabel: t.ariaLabel,
101
- label: t.label
102
- })),
103
- top: X,
104
- ...S && { tipSection: !R && S(H, c, L?.text) },
105
- transactionFilter: J,
104
+ monthlyAmountLabel: O?.label ?? i.general.monthly_amount,
105
+ onBarClick: w,
106
+ selectedTabIndex: o,
107
+ trendAmountLabel: H?.label ?? i.general.trend
108
+ }) : /* @__PURE__ */ n(ft, {}) : null;
109
+ return /* @__PURE__ */ Ft(Rt, { children: [/* @__PURE__ */ n(yt, {
110
+ baseTransactions: nt,
111
+ heading: C?.heading,
112
+ icon: C?.icon,
113
+ onSelectionChange: rt,
114
+ selectedIndex: o,
115
+ subHeadingText: C?.subHeadingText,
116
+ tabs: h,
117
+ top: st,
118
+ ...c && { subTabs: {
119
+ tabs: (j ?? []).map((t, g) => ({
120
+ label: t.label,
121
+ ariaLabel: it[g]
122
+ })),
123
+ selectedIndex: _,
124
+ onChange: x
125
+ } },
126
+ ...v && { tipSection: !U && v(W, i, F?.text) },
127
+ transactionFilter: at,
106
128
  onEachRowClick: (t) => {
107
- b({ transaction_guid: t }), T(!0);
129
+ B({ transaction_guid: t }), D(!0);
108
130
  }
109
- }), /* @__PURE__ */ a(at, {
110
- ariaLabelClose: I.close_aria,
111
- isOpen: G,
131
+ }), /* @__PURE__ */ n(ut, {
132
+ ariaLabelClose: V.close_aria,
133
+ isOpen: P,
112
134
  onClose: () => {
113
- T(!1), b({ transaction_guid: void 0 }), v();
135
+ D(!1), B({ transaction_guid: void 0 }), R();
114
136
  },
115
- title: c.general.transaction_details_title,
116
- children: /* @__PURE__ */ a(yt, { beat: o })
137
+ title: i.general.transaction_details_title,
138
+ children: /* @__PURE__ */ n(It, { beat: r })
117
139
  })] });
118
140
  });
119
141
  export {
120
- Vt as TransactionHistoryBlock
142
+ oe as TransactionHistoryBlock
121
143
  };
122
144
 
123
145
  //# sourceMappingURL=TransactionHistoryBlock.es.js.map