@mx-cartographer/experiences 9.7.128 → 9.7.130

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 (92) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/core/types/localization/InsightsFeedCopy.d.ts +11 -15
  3. package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.d.ts +5 -1
  4. package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js +78 -30
  5. package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js.map +1 -1
  6. package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListContent.d.ts +26 -13
  7. package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListContent.es.js +107 -136
  8. package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListContent.es.js.map +1 -1
  9. package/dist/insights-v2/actionBlocks/AccountListBlock/layout.d.ts +21 -7
  10. package/dist/insights-v2/actionBlocks/AccountListBlock/layout.es.js +34 -17
  11. package/dist/insights-v2/actionBlocks/AccountListBlock/layout.es.js.map +1 -1
  12. package/dist/insights-v2/actionBlocks/AccountListBlock/useAccountListPrepare.d.ts +3 -1
  13. package/dist/insights-v2/actionBlocks/AccountListBlock/useAccountListPrepare.es.js +10 -8
  14. package/dist/insights-v2/actionBlocks/AccountListBlock/useAccountListPrepare.es.js.map +1 -1
  15. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/layout.es.js +46 -45
  16. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/layout.es.js.map +1 -1
  17. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/layout.es.js +23 -22
  18. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/layout.es.js.map +1 -1
  19. package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js +26 -25
  20. package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js.map +1 -1
  21. package/dist/insights-v2/actionBlocks/HelpBlock/layout.d.ts +0 -1
  22. package/dist/insights-v2/actionBlocks/HelpBlock/layout.es.js +6 -6
  23. package/dist/insights-v2/actionBlocks/HelpBlock/layout.es.js.map +1 -1
  24. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/layout.es.js +8 -7
  25. package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/layout.es.js.map +1 -1
  26. package/dist/insights-v2/actionBlocks/OverdraftBlock/layout.es.js +11 -13
  27. package/dist/insights-v2/actionBlocks/OverdraftBlock/layout.es.js.map +1 -1
  28. package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/RecurringTransactionBlock.d.ts +10 -12
  29. package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/RecurringTransactionBlock.es.js +20 -19
  30. package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/RecurringTransactionBlock.es.js.map +1 -1
  31. package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/index.d.ts +1 -1
  32. package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/useRecurringTransactionBlock.d.ts +3 -12
  33. package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/useRecurringTransactionBlock.es.js +8 -8
  34. package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/useRecurringTransactionBlock.es.js.map +1 -1
  35. package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/useRecurringTransactionPrepare.d.ts +9 -0
  36. package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/useRecurringTransactionPrepare.es.js +27 -10
  37. package/dist/insights-v2/actionBlocks/RecurringTransactionBlock/useRecurringTransactionPrepare.es.js.map +1 -1
  38. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.d.ts +1 -7
  39. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js +49 -59
  40. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js.map +1 -1
  41. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashContent.es.js +29 -75
  42. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashContent.es.js.map +1 -1
  43. package/dist/insights-v2/actionBlocks/RemainingCashBlock/layout.d.ts +12 -0
  44. package/dist/insights-v2/actionBlocks/RemainingCashBlock/layout.es.js +18 -9
  45. package/dist/insights-v2/actionBlocks/RemainingCashBlock/layout.es.js.map +1 -1
  46. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +14 -13
  47. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
  48. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js +10 -9
  49. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js.map +1 -1
  50. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.d.ts +0 -3
  51. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js +30 -33
  52. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
  53. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js +31 -30
  54. package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js.map +1 -1
  55. package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js +14 -14
  56. package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js +4 -4
  57. package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js +4 -4
  58. package/dist/insights-v2/blocks/ComponentBlocks/RepeatingTransactionBlock/RepeatingTransactionBlock.es.js +4 -4
  59. package/dist/insights-v2/blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.es.js +11 -10
  60. package/dist/insights-v2/blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.es.js.map +1 -1
  61. package/dist/insights-v2/blocks/ComponentBlocks/UpcomingSubscriptionBlock/UpcomingSubscriptionBlock.es.js +5 -5
  62. package/dist/insights-v2/blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.es.js +4 -4
  63. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/EmergencySavingsAccountPicker.es.js +1 -1
  64. package/dist/insights-v2/blocks/slotReaders.d.ts +5 -0
  65. package/dist/insights-v2/blocks/slotReaders.es.js +7 -5
  66. package/dist/insights-v2/blocks/slotReaders.es.js.map +1 -1
  67. package/dist/insights-v2/components/AmountBreakdownCard.es.js +9 -8
  68. package/dist/insights-v2/components/AmountBreakdownCard.es.js.map +1 -1
  69. package/dist/insights-v2/components/InsightListRow.d.ts +31 -0
  70. package/dist/insights-v2/components/InsightListRow.es.js +111 -0
  71. package/dist/insights-v2/components/InsightListRow.es.js.map +1 -0
  72. package/dist/insights-v2/components/SubTabs.d.ts +2 -1
  73. package/dist/insights-v2/components/SubTabs.es.js +10 -10
  74. package/dist/insights-v2/components/SubTabs.es.js.map +1 -1
  75. package/dist/insights-v2/index.es.js +12 -12
  76. package/dist/insights-v2/mappings/blocks.es.js +21 -21
  77. package/dist/recurringtransactions/components/RecurringTransactionDetails.d.ts +3 -1
  78. package/dist/recurringtransactions/components/RecurringTransactionDetails.es.js +169 -120
  79. package/dist/recurringtransactions/components/RecurringTransactionDetails.es.js.map +1 -1
  80. package/dist/recurringtransactions/components/RecurringTransactionList.d.ts +3 -1
  81. package/dist/recurringtransactions/components/RecurringTransactionList.es.js +151 -118
  82. package/dist/recurringtransactions/components/RecurringTransactionList.es.js.map +1 -1
  83. package/dist/transactions/components/shared/TransactionDetails.d.ts +1 -6
  84. package/dist/transactions/components/shared/TransactionDetails.es.js +149 -199
  85. package/dist/transactions/components/shared/TransactionDetails.es.js.map +1 -1
  86. package/dist/transactions/components/shared/transactiondetails/Description.d.ts +2 -0
  87. package/dist/transactions/components/shared/transactiondetails/Description.es.js +59 -50
  88. package/dist/transactions/components/shared/transactiondetails/Description.es.js.map +1 -1
  89. package/dist/transactions/components/shared/transactiondetails/TransactionHeaderParts.d.ts +10 -0
  90. package/dist/transactions/components/shared/transactiondetails/TransactionHeaderParts.es.js +68 -0
  91. package/dist/transactions/components/shared/transactiondetails/TransactionHeaderParts.es.js.map +1 -0
  92. package/package.json +1 -1
@@ -1,13 +1,14 @@
1
+ import { asNonEmptyText as n, asNumber as _ } from "../../blocks/slotReaders.es.js";
1
2
  var t = {
2
3
  SAVE_ENOUGH_TO_LIVE_ON: "SaveEnoughToLiveOn",
3
4
  SAVE_AN_EXTRA_100: "SaveAnExtra100"
4
- }, o = {
5
+ }, i = {
5
6
  save_enough: t.SAVE_ENOUGH_TO_LIVE_ON,
6
7
  save_extra: t.SAVE_AN_EXTRA_100
7
- }, s = (e) => o[e ?? ""] ?? t.SAVE_AN_EXTRA_100, v = (e, a) => {
8
+ }, s = (e) => i[e ?? ""] ?? t.SAVE_AN_EXTRA_100, E = (e, a) => {
8
9
  const r = a.insights_feed?.make_transfer;
9
10
  return r ? s(e) === t.SAVE_ENOUGH_TO_LIVE_ON ? r.save_enough_title : r.save_extra_title : "";
10
- }, d = (e) => e == null || e === "" ? void 0 : Number(e), _ = (e) => typeof e == "number" && Number.isFinite(e) ? e : void 0, n = (e) => typeof e == "string" && e !== "" ? e : void 0, E = (e) => {
11
+ }, l = (e) => e == null || e === "" ? void 0 : Number(e), m = (e) => {
11
12
  const a = e?.drilldown_data;
12
13
  if (!a) return;
13
14
  const r = {
@@ -18,13 +19,13 @@ var t = {
18
19
  time_period: n(a.time_period),
19
20
  date: n(a.date)
20
21
  };
21
- return Object.values(r).some((i) => i !== void 0) ? r : void 0;
22
+ return Object.values(r).some((o) => o !== void 0) ? r : void 0;
22
23
  };
23
24
  export {
24
- v as getMakeTransferDrawerTitle,
25
- E as resolveMakeTransferSlotData,
25
+ E as getMakeTransferDrawerTitle,
26
+ m as resolveMakeTransferSlotData,
26
27
  s as resolveMakeTransferVariant,
27
- d as toNumber,
28
+ l as toNumber,
28
29
  t as variants
29
30
  };
30
31
 
@@ -1 +1 @@
1
- {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/MakeTransferActionBlock/layout.ts"],"sourcesContent":["import type { GlobalCopy, InsightsPayload, MakeTransferCopy } from '../../../core'\nimport type { SaveExtraBlockData } from '../../../core/types/InsightsInstanceSlotData'\n\n/**\n * MakeTransfer drilldown variants. The block uses the VALUE (e.g. \"SaveAnExtra100\"),\n * which is also the key each variant registers under (see ./index).\n */\nexport const variants = {\n SAVE_ENOUGH_TO_LIVE_ON: 'SaveEnoughToLiveOn',\n SAVE_AN_EXTRA_100: 'SaveAnExtra100',\n} as const\n\nexport type MakeTransferVariant = (typeof variants)[keyof typeof variants]\n\n// The beat payload sends the variant as a snake_case key; map it to the value. The keys are\n// behavior-named (aligning with the `save_enough_title` / `save_extra_title` copy), not beat-named.\nconst VARIANT_BY_KEY: Record<string, MakeTransferVariant> = {\n save_enough: variants.SAVE_ENOUGH_TO_LIVE_ON,\n save_extra: variants.SAVE_AN_EXTRA_100,\n}\n\n/** Props shared by every MakeTransfer variant. Each variant reads the fields it\n * needs directly off `slotData` — no per-variant key indirection. */\nexport interface MakeTransferVariantProps {\n slotData?: SaveExtraBlockData\n copy: MakeTransferCopy\n}\n\n/** Maps the payload variant key to the block's variant VALUE (defaults to save-extra). */\nexport const resolveMakeTransferVariant = (variant?: string | null): MakeTransferVariant =>\n VARIANT_BY_KEY[variant ?? ''] ?? variants.SAVE_AN_EXTRA_100\n\n/** Variant-specific, localized drawer title from `insights_feed.make_transfer`. */\nexport const getMakeTransferDrawerTitle = (\n variant: string | null | undefined,\n copy: GlobalCopy,\n): string => {\n const makeTransfer = copy.insights_feed?.make_transfer\n if (!makeTransfer) return ''\n return resolveMakeTransferVariant(variant) === variants.SAVE_ENOUGH_TO_LIVE_ON\n ? makeTransfer.save_enough_title\n : makeTransfer.save_extra_title\n}\n\n/** Coerce a payload figure (number or numeric string) to a number, else undefined. */\nexport const toNumber = (value?: string | number): number | undefined =>\n value === undefined || value === null || value === '' ? undefined : Number(value)\n\nconst numberOf = (value: unknown): number | undefined =>\n typeof value === 'number' && Number.isFinite(value) ? value : undefined\n\nconst stringOf = (value: unknown): string | undefined =>\n typeof value === 'string' && value !== '' ? value : undefined\n\n/**\n * The drawer's facts from a V2 envelope's `drilldown_data`. `DrilldownData` values are untyped\n * scalars, so each field is narrowed: a null or mistyped value is dropped rather than formatted.\n * undefined when the envelope carries none of them.\n */\nexport const resolveMakeTransferSlotData = (\n payload?: InsightsPayload,\n): SaveExtraBlockData | undefined => {\n const data = payload?.drilldown_data\n if (!data) return undefined\n\n const facts: SaveExtraBlockData = {\n available_balance: numberOf(data.available_balance),\n avg_monthly_spend: numberOf(data.avg_monthly_spend),\n upcoming_expenses: numberOf(data.upcoming_expenses),\n total_remaining: numberOf(data.total_remaining),\n time_period: stringOf(data.time_period),\n date: stringOf(data.date),\n }\n\n return Object.values(facts).some((value) => value !== undefined) ? facts : undefined\n}\n"],"mappings":"AAOA,IAAa,IAAW;AAAA,EACtB,wBAAwB;AAAA,EACxB,mBAAmB;AACrB,GAMM,IAAsD;AAAA,EAC1D,aAAa,EAAS;AAAA,EACtB,YAAY,EAAS;AACvB,GAUa,IAAA,CAA8B,MACzC,EAAe,KAAW,EAAA,KAAO,EAAS,mBAG/B,IAAA,CACX,GACA,MACW;AACX,QAAM,IAAe,EAAK,eAAe;AACzC,SAAK,IACE,EAA2B,CAAO,MAAM,EAAS,yBACpD,EAAa,oBACb,EAAa,mBAHS;AAI5B,GAGa,IAAA,CAAY,MACA,KAAU,QAAQ,MAAU,KAAK,SAAY,OAAO,CAAK,GAE5E,IAAA,CAAY,MAChB,OAAO,KAAU,YAAY,OAAO,SAAS,CAAK,IAAI,IAAQ,QAE1D,IAAA,CAAY,MAChB,OAAO,KAAU,YAAY,MAAU,KAAK,IAAQ,QAOzC,IAAA,CACX,MACmC;AACnC,QAAM,IAAO,GAAS;AACtB,MAAI,CAAC,EAAM;AAEX,QAAM,IAA4B;AAAA,IAChC,mBAAmB,EAAS,EAAK,iBAAiB;AAAA,IAClD,mBAAmB,EAAS,EAAK,iBAAiB;AAAA,IAClD,mBAAmB,EAAS,EAAK,iBAAiB;AAAA,IAClD,iBAAiB,EAAS,EAAK,eAAe;AAAA,IAC9C,aAAa,EAAS,EAAK,WAAW;AAAA,IACtC,MAAM,EAAS,EAAK,IAAI;AAAA,EAC1B;AAEA,SAAO,OAAO,OAAO,CAAK,EAAE,KAAA,CAAM,MAAU,MAAU,MAAS,IAAI,IAAQ;AAC7E"}
1
+ {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/MakeTransferActionBlock/layout.ts"],"sourcesContent":["import type { GlobalCopy, InsightsPayload, MakeTransferCopy } from '../../../core'\nimport type { SaveExtraBlockData } from '../../../core/types/InsightsInstanceSlotData'\nimport { asNonEmptyText, asNumber } from '../../blocks/slotReaders'\n\n/**\n * MakeTransfer drilldown variants. The block uses the VALUE (e.g. \"SaveAnExtra100\"),\n * which is also the key each variant registers under (see ./index).\n */\nexport const variants = {\n SAVE_ENOUGH_TO_LIVE_ON: 'SaveEnoughToLiveOn',\n SAVE_AN_EXTRA_100: 'SaveAnExtra100',\n} as const\n\nexport type MakeTransferVariant = (typeof variants)[keyof typeof variants]\n\n// The beat payload sends the variant as a snake_case key; map it to the value. The keys are\n// behavior-named (aligning with the `save_enough_title` / `save_extra_title` copy), not beat-named.\nconst VARIANT_BY_KEY: Record<string, MakeTransferVariant> = {\n save_enough: variants.SAVE_ENOUGH_TO_LIVE_ON,\n save_extra: variants.SAVE_AN_EXTRA_100,\n}\n\n/** Props shared by every MakeTransfer variant. Each variant reads the fields it\n * needs directly off `slotData` — no per-variant key indirection. */\nexport interface MakeTransferVariantProps {\n slotData?: SaveExtraBlockData\n copy: MakeTransferCopy\n}\n\n/** Maps the payload variant key to the block's variant VALUE (defaults to save-extra). */\nexport const resolveMakeTransferVariant = (variant?: string | null): MakeTransferVariant =>\n VARIANT_BY_KEY[variant ?? ''] ?? variants.SAVE_AN_EXTRA_100\n\n/** Variant-specific, localized drawer title from `insights_feed.make_transfer`. */\nexport const getMakeTransferDrawerTitle = (\n variant: string | null | undefined,\n copy: GlobalCopy,\n): string => {\n const makeTransfer = copy.insights_feed?.make_transfer\n if (!makeTransfer) return ''\n return resolveMakeTransferVariant(variant) === variants.SAVE_ENOUGH_TO_LIVE_ON\n ? makeTransfer.save_enough_title\n : makeTransfer.save_extra_title\n}\n\n/** Coerce a payload figure (number or numeric string) to a number, else undefined. */\nexport const toNumber = (value?: string | number): number | undefined =>\n value === undefined || value === null || value === '' ? undefined : Number(value)\n\n/**\n * The drawer's facts from a V2 envelope's `drilldown_data`. `DrilldownData` values are untyped\n * scalars, so each field is narrowed: a null or mistyped value is dropped rather than formatted.\n * undefined when the envelope carries none of them.\n */\nexport const resolveMakeTransferSlotData = (\n payload?: InsightsPayload,\n): SaveExtraBlockData | undefined => {\n const data = payload?.drilldown_data\n if (!data) return undefined\n\n const facts: SaveExtraBlockData = {\n available_balance: asNumber(data.available_balance),\n avg_monthly_spend: asNumber(data.avg_monthly_spend),\n upcoming_expenses: asNumber(data.upcoming_expenses),\n total_remaining: asNumber(data.total_remaining),\n time_period: asNonEmptyText(data.time_period),\n date: asNonEmptyText(data.date),\n }\n\n return Object.values(facts).some((value) => value !== undefined) ? facts : undefined\n}\n"],"mappings":";AAQA,IAAa,IAAW;AAAA,EACtB,wBAAwB;AAAA,EACxB,mBAAmB;AACrB,GAMM,IAAsD;AAAA,EAC1D,aAAa,EAAS;AAAA,EACtB,YAAY,EAAS;AACvB,GAUa,IAAA,CAA8B,MACzC,EAAe,KAAW,EAAA,KAAO,EAAS,mBAG/B,IAAA,CACX,GACA,MACW;AACX,QAAM,IAAe,EAAK,eAAe;AACzC,SAAK,IACE,EAA2B,CAAO,MAAM,EAAS,yBACpD,EAAa,oBACb,EAAa,mBAHS;AAI5B,GAGa,IAAA,CAAY,MACA,KAAU,QAAQ,MAAU,KAAK,SAAY,OAAO,CAAK,GAOrE,IAAA,CACX,MACmC;AACnC,QAAM,IAAO,GAAS;AACtB,MAAI,CAAC,EAAM;AAEX,QAAM,IAA4B;AAAA,IAChC,mBAAmB,EAAS,EAAK,iBAAiB;AAAA,IAClD,mBAAmB,EAAS,EAAK,iBAAiB;AAAA,IAClD,mBAAmB,EAAS,EAAK,iBAAiB;AAAA,IAClD,iBAAiB,EAAS,EAAK,eAAe;AAAA,IAC9C,aAAa,EAAe,EAAK,WAAW;AAAA,IAC5C,MAAM,EAAe,EAAK,IAAI;AAAA,EAChC;AAEA,SAAO,OAAO,OAAO,CAAK,EAAE,KAAA,CAAM,MAAU,MAAU,MAAS,IAAI,IAAQ;AAC7E"}
@@ -1,4 +1,5 @@
1
- var u = [
1
+ import { asNumber as e } from "../../blocks/slotReaders.es.js";
2
+ var t = [
2
3
  {
3
4
  key: "low",
4
5
  color: "success.main"
@@ -15,21 +16,18 @@ var u = [
15
16
  key: "very_high",
16
17
  color: "error.dark"
17
18
  }
18
- ], i = 25, c = 50, t = 75, d = (r) => r > t ? "very_high" : r > c ? "high" : r > i ? "medium" : "low", s = (r) => {
19
- const n = r.insights_payload?.drilldown_data, e = (a) => {
20
- const o = n?.[a];
21
- return typeof o == "number" && Number.isFinite(o) ? o : void 0;
22
- };
19
+ ], i = 25, n = 50, c = 75, u = (r) => r > c ? "very_high" : r > n ? "high" : r > i ? "medium" : "low", m = (r) => {
20
+ const a = r.insights_payload?.drilldown_data;
23
21
  return {
24
- amount: e("projected_overdraft_amount"),
25
- confidence: e("confidence_level")
22
+ amount: e(a?.projected_overdraft_amount),
23
+ confidence: e(a?.confidence_level)
26
24
  };
27
- }, m = (r, n) => r.primary_account ?? n.find((e) => e.guid === r.primary_account_guid);
25
+ }, s = (r, a) => r.primary_account ?? a.find((o) => o.guid === r.primary_account_guid);
28
26
  export {
29
- u as BANDS,
30
- d as confidenceBand,
31
- s as resolveOverdraftFacts,
32
- m as resolvePrimaryAccount
27
+ t as BANDS,
28
+ u as confidenceBand,
29
+ m as resolveOverdraftFacts,
30
+ s as resolvePrimaryAccount
33
31
  };
34
32
 
35
33
  //# sourceMappingURL=layout.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/OverdraftBlock/layout.ts"],"sourcesContent":["import type { Account, Beat } from '../../../core'\n\n/** The meter's bands, low to very high, each with its theme colour. */\nexport const BANDS = [\n { key: 'low', color: 'success.main' },\n { key: 'medium', color: 'success.dark' },\n { key: 'high', color: 'warning.main' },\n { key: 'very_high', color: 'error.dark' },\n] as const\n\nexport type ConfidenceBand = (typeof BANDS)[number]['key']\n\n/** Upper bound (inclusive) of each band but the last, as the pulse drawer drew them. */\nconst LOW_MAX = 25\nconst MEDIUM_MAX = 50\nconst HIGH_MAX = 75\n\nexport const confidenceBand = (level: number): ConfidenceBand => {\n if (level > HIGH_MAX) return 'very_high'\n if (level > MEDIUM_MAX) return 'high'\n if (level > LOW_MAX) return 'medium'\n\n return 'low'\n}\n\nexport interface OverdraftFacts {\n /** The projected overdraft, positive, as the drawer prints it. */\n amount?: number\n /** The backend's percent confidence that the overdraft will occur. */\n confidence?: number\n}\n\n/** The drawer's two figures from the V2 envelope's `drilldown_data`; undefined unless a finite number. */\nexport const resolveOverdraftFacts = (beat: Beat): OverdraftFacts => {\n const data = beat.insights_payload?.drilldown_data\n const numberAt = (key: string) => {\n const value = data?.[key]\n\n return typeof value === 'number' && Number.isFinite(value) ? value : undefined\n }\n\n return {\n amount: numberAt('projected_overdraft_amount'),\n confidence: numberAt('confidence_level'),\n }\n}\n\n/** The beat's primary account: from the beat when the host attached it, else the loaded accounts. */\nexport const resolvePrimaryAccount = (beat: Beat, accounts: Account[]): Account | undefined =>\n beat.primary_account ?? accounts.find((account) => account.guid === beat.primary_account_guid)\n"],"mappings":"AAGA,IAAa,IAAQ;AAAA,EACnB;AAAA,IAAE,KAAK;AAAA,IAAO,OAAO;AAAA,EAAe;AAAA,EACpC;AAAA,IAAE,KAAK;AAAA,IAAU,OAAO;AAAA,EAAe;AAAA,EACvC;AAAA,IAAE,KAAK;AAAA,IAAQ,OAAO;AAAA,EAAe;AAAA,EACrC;AAAA,IAAE,KAAK;AAAA,IAAa,OAAO;AAAA,EAAa;AAC1C,GAKM,IAAU,IACV,IAAa,IACb,IAAW,IAEJ,IAAA,CAAkB,MACzB,IAAQ,IAAiB,cACzB,IAAQ,IAAmB,SAC3B,IAAQ,IAAgB,WAErB,OAWI,IAAA,CAAyB,MAA+B;AACnE,QAAM,IAAO,EAAK,kBAAkB,gBAC9B,IAAA,CAAY,MAAgB;AAChC,UAAM,IAAQ,IAAO,CAAA;AAErB,WAAO,OAAO,KAAU,YAAY,OAAO,SAAS,CAAK,IAAI,IAAQ;AAAA,EACvE;AAEA,SAAO;AAAA,IACL,QAAQ,EAAS,4BAA4B;AAAA,IAC7C,YAAY,EAAS,kBAAkB;AAAA,EACzC;AACF,GAGa,IAAA,CAAyB,GAAY,MAChD,EAAK,mBAAmB,EAAS,KAAA,CAAM,MAAY,EAAQ,SAAS,EAAK,oBAAoB"}
1
+ {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/OverdraftBlock/layout.ts"],"sourcesContent":["import type { Account, Beat } from '../../../core'\nimport { asNumber } from '../../blocks/slotReaders'\n\n/** The meter's bands, low to very high, each with its theme colour. */\nexport const BANDS = [\n { key: 'low', color: 'success.main' },\n { key: 'medium', color: 'success.dark' },\n { key: 'high', color: 'warning.main' },\n { key: 'very_high', color: 'error.dark' },\n] as const\n\nexport type ConfidenceBand = (typeof BANDS)[number]['key']\n\n/** Upper bound (inclusive) of each band but the last, as the pulse drawer drew them. */\nconst LOW_MAX = 25\nconst MEDIUM_MAX = 50\nconst HIGH_MAX = 75\n\nexport const confidenceBand = (level: number): ConfidenceBand => {\n if (level > HIGH_MAX) return 'very_high'\n if (level > MEDIUM_MAX) return 'high'\n if (level > LOW_MAX) return 'medium'\n\n return 'low'\n}\n\nexport interface OverdraftFacts {\n /** The projected overdraft, positive, as the drawer prints it. */\n amount?: number\n /** The backend's percent confidence that the overdraft will occur. */\n confidence?: number\n}\n\n/** The drawer's two figures from the V2 envelope's `drilldown_data`; undefined unless a finite number. */\nexport const resolveOverdraftFacts = (beat: Beat): OverdraftFacts => {\n const data = beat.insights_payload?.drilldown_data\n\n return {\n amount: asNumber(data?.projected_overdraft_amount),\n confidence: asNumber(data?.confidence_level),\n }\n}\n\n/** The beat's primary account: from the beat when the host attached it, else the loaded accounts. */\nexport const resolvePrimaryAccount = (beat: Beat, accounts: Account[]): Account | undefined =>\n beat.primary_account ?? accounts.find((account) => account.guid === beat.primary_account_guid)\n"],"mappings":";AAIA,IAAa,IAAQ;AAAA,EACnB;AAAA,IAAE,KAAK;AAAA,IAAO,OAAO;AAAA,EAAe;AAAA,EACpC;AAAA,IAAE,KAAK;AAAA,IAAU,OAAO;AAAA,EAAe;AAAA,EACvC;AAAA,IAAE,KAAK;AAAA,IAAQ,OAAO;AAAA,EAAe;AAAA,EACrC;AAAA,IAAE,KAAK;AAAA,IAAa,OAAO;AAAA,EAAa;AAC1C,GAKM,IAAU,IACV,IAAa,IACb,IAAW,IAEJ,IAAA,CAAkB,MACzB,IAAQ,IAAiB,cACzB,IAAQ,IAAmB,SAC3B,IAAQ,IAAgB,WAErB,OAWI,IAAA,CAAyB,MAA+B;AACnE,QAAM,IAAO,EAAK,kBAAkB;AAEpC,SAAO;AAAA,IACL,QAAQ,EAAS,GAAM,0BAA0B;AAAA,IACjD,YAAY,EAAS,GAAM,gBAAgB;AAAA,EAC7C;AACF,GAGa,IAAA,CAAyB,GAAY,MAChD,EAAK,mBAAmB,EAAS,KAAA,CAAM,MAAY,EAAQ,SAAS,EAAK,oBAAoB"}
@@ -1,17 +1,15 @@
1
+ import { Recurrence } from '../../../core';
1
2
  import { ActionBlockProps } from '../../mappings/blocks';
2
3
  /**
3
- * Expense Details drawer content for one recurring subscription (WEC-1428), shared by the Upcoming
4
- * Subscription (WEC-1469) and Subscription Price Increase (WEC-1470) beats.
5
- *
6
- * The detail rendering (merchant header, next-due card, account/category/schedule rows, past
7
- * activity, mark-as-paid/unpaid, delete) all lives in the recurring module's
8
- * `RecurringTransactionDetails`, the same component behind the recurring widget's Expense Details
9
- * drawer. This block's job is only to resolve *which* subscription (`subscriptionBeats.ts`) and hand
10
- * off, exactly as `TransactionDetailsBlock` does with `TransactionDetails`.
11
- *
12
- * `observer` is required: the resolved subscription comes from RecurringTransactionsStore, and
13
- * `usePrepare` may still be loading it when this first renders.
4
+ * Expense Details drawer: resolves which recurring transaction, then renders `RecurringTransactionDetails`.
5
+ * A nested opener (a tapped row) passes the guid, occurrence and its own close; a CTA passes none.
14
6
  */
15
- export declare const RecurringTransactionBlock: (({ beat, }: ActionBlockProps) => import("react/jsx-runtime").JSX.Element) & {
7
+ export declare const RecurringTransactionBlock: (({ beat, layout, onDeleted, repeatingTransactionGuid, selectedRecurrence, }: ActionBlockProps & {
8
+ /** `insights` is the Monthly Obligations Expense Details layout; other beats keep `default`. */
9
+ layout?: "default" | "insights";
10
+ onDeleted?: () => void;
11
+ repeatingTransactionGuid?: string;
12
+ selectedRecurrence?: Recurrence | null;
13
+ }) => import("react/jsx-runtime").JSX.Element) & {
16
14
  displayName: string;
17
15
  };
@@ -1,39 +1,40 @@
1
- import { useGlobalCopyStore as R, useInsightsV2Store as g, useTransactionStore as T } from "../../../common/context/hooks.es.js";
2
- import v from "../../../common/components/Loader.es.js";
3
- import { RecurringTransactionDetails as x } from "../../../recurringtransactions/components/RecurringTransactionDetails.es.js";
4
- import { ErrorCard as y } from "../../components/ErrorCard.es.js";
5
- import { useRecurringTransactionBlock as D } from "./useRecurringTransactionBlock.es.js";
6
- import { useRecurringTransactionLoad as L } from "./useRecurringTransactionPrepare.es.js";
1
+ import { useGlobalCopyStore as x, useInsightsV2Store as y, useTransactionStore as D } from "../../../common/context/hooks.es.js";
2
+ import L from "../../../common/components/Loader.es.js";
3
+ import { RecurringTransactionDetails as B } from "../../../recurringtransactions/components/RecurringTransactionDetails.es.js";
4
+ import { ErrorCard as E } from "../../components/ErrorCard.es.js";
5
+ import { useRecurringTransactionBlock as b } from "./useRecurringTransactionBlock.es.js";
6
+ import { useRecurringTransactionLoad as h } from "./useRecurringTransactionPrepare.es.js";
7
7
  import r from "react";
8
- import { observer as B } from "mobx-react-lite";
9
- import { Text as E } from "@mxenabled/mxui";
8
+ import { observer as k } from "mobx-react-lite";
9
+ import { Text as S } from "@mxenabled/mxui";
10
10
  import { jsx as t } from "react/jsx-runtime";
11
- var O = B(function({ beat: f }) {
12
- const { closeActionDrawer: l } = g(), { recurring: m } = R(), { filter: d, setFilter: n } = T(), { hasLoadError: i, isLoading: c, repeatingTransaction: o } = D(f), p = L(), e = r.useRef(null);
13
- e.current === null && (e.current = { ...d });
11
+ var z = k(function({ beat: f, layout: l = "default", onDeleted: m, repeatingTransactionGuid: d, selectedRecurrence: p = null }) {
12
+ const { closeActionDrawer: R } = y(), { recurring: g } = x(), { filter: T, setFilter: n } = D(), { hasLoadError: i, isLoading: c, repeatingTransaction: o } = b(f, d), v = h(), e = r.useRef(null);
13
+ e.current === null && (e.current = { ...T });
14
14
  const s = r.useRef(n), a = r.useRef(!1), u = !c && !i && o !== void 0;
15
15
  return s.current = n, r.useEffect(() => {
16
16
  u && (a.current = !0);
17
17
  }, [u]), r.useEffect(() => () => {
18
18
  a.current && e.current && s.current(e.current);
19
- }, []), c ? /* @__PURE__ */ t(v, {}) : i ? /* @__PURE__ */ t(y, { onRetry: () => {
20
- p();
21
- } }) : o ? /* @__PURE__ */ t(x, {
22
- onDeleted: l,
19
+ }, []), c ? /* @__PURE__ */ t(L, {}) : i ? /* @__PURE__ */ t(E, { onRetry: () => {
20
+ v();
21
+ } }) : o ? /* @__PURE__ */ t(B, {
22
+ layout: l,
23
+ onDeleted: m ?? R,
23
24
  recurringTransaction: o,
24
- selectedRecurrence: null
25
- }) : /* @__PURE__ */ t(E, {
25
+ selectedRecurrence: p
26
+ }) : /* @__PURE__ */ t(S, {
26
27
  color: "text.secondary",
27
28
  sx: {
28
29
  m: 24,
29
30
  textAlign: "center"
30
31
  },
31
32
  variant: "body1",
32
- children: m.no_activities
33
+ children: g.no_activities
33
34
  });
34
35
  });
35
36
  export {
36
- O as RecurringTransactionBlock
37
+ z as RecurringTransactionBlock
37
38
  };
38
39
 
39
40
  //# sourceMappingURL=RecurringTransactionBlock.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RecurringTransactionBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/RecurringTransactionBlock/RecurringTransactionBlock.tsx"],"sourcesContent":["import React from 'react'\n\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport {\n Loader,\n useGlobalCopyStore,\n useInsightsV2Store,\n useTransactionStore,\n} from '../../../common'\nimport type { TransactionFilter } from '../../../core/stores/TransactionStore'\nimport { RecurringTransactionDetails } from '../../../recurringtransactions/components/RecurringTransactionDetails'\nimport { ErrorCard } from '../../components/ErrorCard'\nimport type { ActionBlockProps } from '../../mappings/blocks'\n\nimport { useRecurringTransactionBlock } from './useRecurringTransactionBlock'\nimport { useRecurringTransactionLoad } from './useRecurringTransactionPrepare'\n\n/**\n * Expense Details drawer content for one recurring subscription (WEC-1428), shared by the Upcoming\n * Subscription (WEC-1469) and Subscription Price Increase (WEC-1470) beats.\n *\n * The detail rendering (merchant header, next-due card, account/category/schedule rows, past\n * activity, mark-as-paid/unpaid, delete) all lives in the recurring module's\n * `RecurringTransactionDetails`, the same component behind the recurring widget's Expense Details\n * drawer. This block's job is only to resolve *which* subscription (`subscriptionBeats.ts`) and hand\n * off, exactly as `TransactionDetailsBlock` does with `TransactionDetails`.\n *\n * `observer` is required: the resolved subscription comes from RecurringTransactionsStore, and\n * `usePrepare` may still be loading it when this first renders.\n */\nexport const RecurringTransactionBlock = observer(function RecurringTransactionBlock({\n beat,\n}: ActionBlockProps) {\n const { closeActionDrawer } = useInsightsV2Store()\n const { recurring: copy } = useGlobalCopyStore()\n const { filter, setFilter } = useTransactionStore()\n const { hasLoadError, isLoading, repeatingTransaction } = useRecurringTransactionBlock(beat)\n const retryLoad = useRecurringTransactionLoad()\n\n // `RecurringTransactionDetails` narrows the shared `TransactionStore.filter` to this one\n // subscription (90-day window + guid predicate) and never restores it. Inside the recurring widget\n // that is fine, but a Transactions widget on the same page would be left showing only this\n // subscription's charges after the drawer closes. The runner mounts this block on open and\n // unmounts it on close, so the filter is put back on unmount, with two guards:\n // - the snapshot is taken BY VALUE on the first render (the store's `filter` is a live observable\n // object, so holding the reference would hold whatever it was later changed to);\n // - the restore only runs if the details view actually mounted. While loading, on a failed load\n // or when nothing resolved, this block changed nothing and must not overwrite a filter some\n // other widget may have set in the meantime.\n const filterBeforeOpen = React.useRef<TransactionFilter | null>(null)\n\n if (filterBeforeOpen.current === null) filterBeforeOpen.current = { ...filter }\n\n const setFilterRef = React.useRef(setFilter)\n const didRenderDetails = React.useRef(false)\n const isDetailsRendered = !isLoading && !hasLoadError && repeatingTransaction !== undefined\n\n setFilterRef.current = setFilter\n\n React.useEffect(() => {\n if (isDetailsRendered) didRenderDetails.current = true\n }, [isDetailsRendered])\n\n React.useEffect(\n () => () => {\n if (didRenderDetails.current && filterBeforeOpen.current) {\n setFilterRef.current(filterBeforeOpen.current)\n }\n },\n [],\n )\n\n if (isLoading) return <Loader />\n\n // The open-time load finished without data (API failure, reported through the store). Offer the\n // feed's standard error card with a retry rather than leaving the loader up forever.\n if (hasLoadError) return <ErrorCard onRetry={() => void retryLoad()} />\n\n // Loading finished and the beat still resolves to nothing (deleted, never detected, or a beat that\n // names none). Say so in the recurring module's own words rather than the generic error drawer.\n if (!repeatingTransaction) {\n return (\n <Text color=\"text.secondary\" sx={{ m: 24, textAlign: 'center' }} variant=\"body1\">\n {copy.no_activities}\n </Text>\n )\n }\n\n return (\n <RecurringTransactionDetails\n // Deleting the subscription from inside the drawer leaves nothing to show; close it, as the\n // recurring widget's own drawer does.\n onDeleted={closeActionDrawer}\n recurringTransaction={repeatingTransaction}\n // No specific occurrence was tapped (the CTA opens the subscription itself), so the next-due\n // card falls back to the subscription's next upcoming date.\n selectedRecurrence={null}\n />\n )\n})\n"],"mappings":";;;;;;;;;;AAgCA,IAAa,IAA4B,EAAS,SAAmC,EACnF,MAAA,EAAA,GACmB;AACnB,QAAM,EAAE,mBAAA,EAAA,IAAsB,EAAmB,GAC3C,EAAE,WAAW,EAAA,IAAS,EAAmB,GACzC,EAAE,QAAA,GAAQ,WAAA,EAAA,IAAc,EAAoB,GAC5C,EAAE,cAAA,GAAc,WAAA,GAAW,sBAAA,EAAA,IAAyB,EAA6B,CAAI,GACrF,IAAY,EAA4B,GAYxC,IAAmB,EAAM,OAAiC,IAAI;AAEpE,EAAI,EAAiB,YAAY,SAAM,EAAiB,UAAU,EAAE,GAAG,EAAO;AAE9E,QAAM,IAAe,EAAM,OAAO,CAAS,GACrC,IAAmB,EAAM,OAAO,EAAK,GACrC,IAAoB,CAAC,KAAa,CAAC,KAAgB,MAAyB;AAiBlF,SAfA,EAAa,UAAU,GAEvB,EAAM,UAAA,MAAgB;AACpB,IAAI,MAAmB,EAAiB,UAAU;AAAA,EACpD,GAAG,CAAC,CAAiB,CAAC,GAEtB,EAAM,UAAA,MAAA,MACQ;AACV,IAAI,EAAiB,WAAW,EAAiB,WAC/C,EAAa,QAAQ,EAAiB,OAAO;AAAA,EAEjD,GACA,CAAC,CACH,GAEI,IAAkB,gBAAA,EAAC,GAAD,CAAS,CAAA,IAI3B,IAAqB,gBAAA,EAAC,GAAD,EAAW,SAAA,MAAA;AAAe,IAAK,EAAU;AAAA,IAAI,CAAA,IAIjE,IASH,gBAAA,EAAC,GAAD;AAAA,IAGE,WAAW;AAAA,IACX,sBAAsB;AAAA,IAGtB,oBAAoB;AAAA,EACrB,CAAA,IAfC,gBAAA,EAAC,GAAD;AAAA,IAAM,OAAM;AAAA,IAAiB,IAAI;AAAA,MAAE,GAAG;AAAA,MAAI,WAAW;AAAA,IAAS;AAAA,IAAG,SAAQ;AAAA,IACtE,UAAA,EAAK;AAAA,EACF,CAAA;AAeZ,CAAC"}
1
+ {"version":3,"file":"RecurringTransactionBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/RecurringTransactionBlock/RecurringTransactionBlock.tsx"],"sourcesContent":["import React from 'react'\n\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport {\n Loader,\n useGlobalCopyStore,\n useInsightsV2Store,\n useTransactionStore,\n} from '../../../common'\nimport type { Recurrence } from '../../../core'\nimport type { TransactionFilter } from '../../../core/stores/TransactionStore'\nimport { RecurringTransactionDetails } from '../../../recurringtransactions/components/RecurringTransactionDetails'\nimport { ErrorCard } from '../../components/ErrorCard'\nimport type { ActionBlockProps } from '../../mappings/blocks'\n\nimport { useRecurringTransactionBlock } from './useRecurringTransactionBlock'\nimport { useRecurringTransactionLoad } from './useRecurringTransactionPrepare'\n\n/**\n * Expense Details drawer: resolves which recurring transaction, then renders `RecurringTransactionDetails`.\n * A nested opener (a tapped row) passes the guid, occurrence and its own close; a CTA passes none.\n */\nexport const RecurringTransactionBlock = observer(function RecurringTransactionBlock({\n beat,\n layout = 'default',\n onDeleted,\n repeatingTransactionGuid,\n selectedRecurrence = null,\n}: ActionBlockProps & {\n /** `insights` is the Monthly Obligations Expense Details layout; other beats keep `default`. */\n layout?: 'default' | 'insights'\n onDeleted?: () => void\n repeatingTransactionGuid?: string\n selectedRecurrence?: Recurrence | null\n}) {\n const { closeActionDrawer } = useInsightsV2Store()\n const { recurring: copy } = useGlobalCopyStore()\n const { filter, setFilter } = useTransactionStore()\n const { hasLoadError, isLoading, repeatingTransaction } = useRecurringTransactionBlock(\n beat,\n repeatingTransactionGuid,\n )\n const retryLoad = useRecurringTransactionLoad()\n\n // The details view narrows the shared TransactionStore filter and never restores it: snapshot it by\n // value now, and put it back on unmount only if the details actually rendered.\n const filterBeforeOpen = React.useRef<TransactionFilter | null>(null)\n\n if (filterBeforeOpen.current === null) filterBeforeOpen.current = { ...filter }\n\n const setFilterRef = React.useRef(setFilter)\n const didRenderDetails = React.useRef(false)\n const isDetailsRendered = !isLoading && !hasLoadError && repeatingTransaction !== undefined\n\n setFilterRef.current = setFilter\n\n React.useEffect(() => {\n if (isDetailsRendered) didRenderDetails.current = true\n }, [isDetailsRendered])\n\n React.useEffect(\n () => () => {\n if (didRenderDetails.current && filterBeforeOpen.current) {\n setFilterRef.current(filterBeforeOpen.current)\n }\n },\n [],\n )\n\n if (isLoading) return <Loader />\n\n if (hasLoadError) return <ErrorCard onRetry={() => void retryLoad()} />\n\n // Deleted, never detected, or the beat names none.\n if (!repeatingTransaction) {\n return (\n <Text color=\"text.secondary\" sx={{ m: 24, textAlign: 'center' }} variant=\"body1\">\n {copy.no_activities}\n </Text>\n )\n }\n\n return (\n <RecurringTransactionDetails\n layout={layout}\n onDeleted={onDeleted ?? closeActionDrawer}\n recurringTransaction={repeatingTransaction}\n selectedRecurrence={selectedRecurrence}\n />\n )\n})\n"],"mappings":";;;;;;;;;;AAwBA,IAAa,IAA4B,EAAS,SAAmC,EACnF,MAAA,GACA,QAAA,IAAS,WACT,WAAA,GACA,0BAAA,GACA,oBAAA,IAAqB,KAAA,GAOpB;AACD,QAAM,EAAE,mBAAA,EAAA,IAAsB,EAAmB,GAC3C,EAAE,WAAW,EAAA,IAAS,EAAmB,GACzC,EAAE,QAAA,GAAQ,WAAA,EAAA,IAAc,EAAoB,GAC5C,EAAE,cAAA,GAAc,WAAA,GAAW,sBAAA,EAAA,IAAyB,EACxD,GACA,CACF,GACM,IAAY,EAA4B,GAIxC,IAAmB,EAAM,OAAiC,IAAI;AAEpE,EAAI,EAAiB,YAAY,SAAM,EAAiB,UAAU,EAAE,GAAG,EAAO;AAE9E,QAAM,IAAe,EAAM,OAAO,CAAS,GACrC,IAAmB,EAAM,OAAO,EAAK,GACrC,IAAoB,CAAC,KAAa,CAAC,KAAgB,MAAyB;AAiBlF,SAfA,EAAa,UAAU,GAEvB,EAAM,UAAA,MAAgB;AACpB,IAAI,MAAmB,EAAiB,UAAU;AAAA,EACpD,GAAG,CAAC,CAAiB,CAAC,GAEtB,EAAM,UAAA,MAAA,MACQ;AACV,IAAI,EAAiB,WAAW,EAAiB,WAC/C,EAAa,QAAQ,EAAiB,OAAO;AAAA,EAEjD,GACA,CAAC,CACH,GAEI,IAAkB,gBAAA,EAAC,GAAD,CAAS,CAAA,IAE3B,IAAqB,gBAAA,EAAC,GAAD,EAAW,SAAA,MAAA;AAAe,IAAK,EAAU;AAAA,IAAI,CAAA,IAGjE,IASH,gBAAA,EAAC,GAAD;AAAA,IACU,QAAA;AAAA,IACR,WAAW,KAAa;AAAA,IACxB,sBAAsB;AAAA,IACF,oBAAA;AAAA,EACrB,CAAA,IAZC,gBAAA,EAAC,GAAD;AAAA,IAAM,OAAM;AAAA,IAAiB,IAAI;AAAA,MAAE,GAAG;AAAA,MAAI,WAAW;AAAA,IAAS;AAAA,IAAG,SAAQ;AAAA,IACtE,UAAA,EAAK;AAAA,EACF,CAAA;AAYZ,CAAC"}
@@ -1,2 +1,2 @@
1
1
  export { RecurringTransactionBlock } from './RecurringTransactionBlock';
2
- export { type RecurringTransactionActionContext, useRecurringTransactionLoad, useRecurringTransactionPrepare, } from './useRecurringTransactionPrepare';
2
+ export { type RecurringTransactionActionContext, useRecurringExpensesLoadState, useRecurringTransactionLoad, useRecurringTransactionPrepare, } from './useRecurringTransactionPrepare';
@@ -8,16 +8,7 @@ export interface RecurringTransactionBlockState {
8
8
  repeatingTransaction?: RepeatingTransaction;
9
9
  }
10
10
  /**
11
- * Resolves which repeating transaction this drawer is about.
12
- *
13
- * The guid comes from the beat (`resolveSubscriptionGuid`), then is looked up in
14
- * `RecurringTransactionsStore` rather than rebuilt from the beat, because the Expense Details view
15
- * edits (payment schedule, mark as paid, delete) must write through to the same store object the
16
- * recurring widget renders.
17
- *
18
- * `detailedRepeatingTransactions` joins the account and linked transactions in, but it is empty until
19
- * the transaction store has loaded (see `augmentRepeatingTransactions`). The raw record is the
20
- * fallback so a subscription the store has is never reported missing just because transactions are
21
- * still on their way.
11
+ * Resolves the drawer's repeating transaction from the store (so edits write through), falling back to the
12
+ * raw record until transactions load. `guidOverride` (a nested opener's tapped row) wins over the beat.
22
13
  */
23
- export declare const useRecurringTransactionBlock: (beat: Beat) => RecurringTransactionBlockState;
14
+ export declare const useRecurringTransactionBlock: (beat: Beat, guidOverride?: string) => RecurringTransactionBlockState;
@@ -1,21 +1,21 @@
1
- import { useActionContext as p, useRecurringTransactionsStore as T, useTransactionStore as f } from "../../../common/context/hooks.es.js";
2
- import { resolveSubscriptionGuid as l } from "./subscriptionBeats.es.js";
3
- var L = (s) => {
4
- const { detailedRepeatingTransactions: e, isDataLoaded: o, repeatingTransactions: r } = T(), { transactions: c } = f(), t = p()?.recurringLoadFailed === !0 && !o, i = l(s, {
1
+ import { useActionContext as T, useRecurringTransactionsStore as f, useTransactionStore as l } from "../../../common/context/hooks.es.js";
2
+ import { resolveSubscriptionGuid as m } from "./subscriptionBeats.es.js";
3
+ var R = (s, e) => {
4
+ const { detailedRepeatingTransactions: c, isDataLoaded: o, repeatingTransactions: r } = f(), { transactions: d } = l(), t = T()?.recurringLoadFailed === !0 && !o, i = e ?? m(s, {
5
5
  repeatingTransactions: r,
6
- transactions: c
7
- }), a = (u) => u.find((g) => g.guid === i), n = i ? a(r) : void 0, d = n ? a(e) ?? {
6
+ transactions: d
7
+ }), a = (g) => g.find((p) => p.guid === i), n = i ? a(r) : void 0, u = n ? a(c) ?? {
8
8
  ...n,
9
9
  transactions: n.transactions ?? []
10
10
  } : void 0;
11
11
  return {
12
12
  hasLoadError: t,
13
13
  isLoading: !o && !t,
14
- repeatingTransaction: d
14
+ repeatingTransaction: u
15
15
  };
16
16
  };
17
17
  export {
18
- L as useRecurringTransactionBlock
18
+ R as useRecurringTransactionBlock
19
19
  };
20
20
 
21
21
  //# sourceMappingURL=useRecurringTransactionBlock.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRecurringTransactionBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/RecurringTransactionBlock/useRecurringTransactionBlock.ts"],"sourcesContent":["import {\n useActionContext,\n useRecurringTransactionsStore,\n useTransactionStore,\n} from '../../../common'\nimport type { Beat, RepeatingTransaction } from '../../../core'\n\nimport { resolveSubscriptionGuid } from './subscriptionBeats'\nimport type { RecurringTransactionActionContext } from './useRecurringTransactionPrepare'\n\nexport interface RecurringTransactionBlockState {\n /** True when the open-time load finished without leaving the store loaded; the block offers a retry. */\n hasLoadError: boolean\n /** True until the recurring store has loaded; the block shows a loader instead of an empty state. */\n isLoading: boolean\n /** `undefined` once loading finishes means the subscription could not be resolved. */\n repeatingTransaction?: RepeatingTransaction\n}\n\n/**\n * Resolves which repeating transaction this drawer is about.\n *\n * The guid comes from the beat (`resolveSubscriptionGuid`), then is looked up in\n * `RecurringTransactionsStore` rather than rebuilt from the beat, because the Expense Details view\n * edits (payment schedule, mark as paid, delete) must write through to the same store object the\n * recurring widget renders.\n *\n * `detailedRepeatingTransactions` joins the account and linked transactions in, but it is empty until\n * the transaction store has loaded (see `augmentRepeatingTransactions`). The raw record is the\n * fallback so a subscription the store has is never reported missing just because transactions are\n * still on their way.\n */\nexport const useRecurringTransactionBlock = (beat: Beat): RecurringTransactionBlockState => {\n const { detailedRepeatingTransactions, isDataLoaded, repeatingTransactions } =\n useRecurringTransactionsStore()\n const { transactions } = useTransactionStore()\n // The failure flag is per drawer session and only cleared by an explicit retry, but the store is\n // shared: another widget on the page (e.g. Recurring Transactions on a dashboard) may load it\n // successfully while this drawer is still open. Data that has since arrived wins over the flag.\n const loadFailed =\n useActionContext<RecurringTransactionActionContext>()?.recurringLoadFailed === true\n const hasLoadError = loadFailed && !isDataLoaded\n\n const guid = resolveSubscriptionGuid(beat, { repeatingTransactions, transactions })\n\n const findByGuid = (list: RepeatingTransaction[]) =>\n list.find((repeating) => repeating.guid === guid)\n\n const raw = guid ? findByGuid(repeatingTransactions) : undefined\n const repeatingTransaction = raw\n ? (findByGuid(detailedRepeatingTransactions) ?? {\n ...raw,\n transactions: raw.transactions ?? [],\n })\n : undefined\n\n return { hasLoadError, isLoading: !isDataLoaded && !hasLoadError, repeatingTransaction }\n}\n"],"mappings":";;AAgCA,IAAa,IAAA,CAAgC,MAA+C;AAC1F,QAAM,EAAE,+BAAA,GAA+B,cAAA,GAAc,uBAAA,EAAA,IACnD,EAA8B,GAC1B,EAAE,cAAA,EAAA,IAAiB,EAAoB,GAMvC,IADJ,EAAoD,GAAG,wBAAwB,MAC9C,CAAC,GAE9B,IAAO,EAAwB,GAAM;AAAA,IAAE,uBAAA;AAAA,IAAuB,cAAA;AAAA,EAAa,CAAC,GAE5E,IAAA,CAAc,MAClB,EAAK,KAAA,CAAM,MAAc,EAAU,SAAS,CAAI,GAE5C,IAAM,IAAO,EAAW,CAAqB,IAAI,QACjD,IAAuB,IACxB,EAAW,CAA6B,KAAK;AAAA,IAC5C,GAAG;AAAA,IACH,cAAc,EAAI,gBAAgB,CAAC;AAAA,EACrC,IACA;AAEJ,SAAO;AAAA,IAAE,cAAA;AAAA,IAAc,WAAW,CAAC,KAAgB,CAAC;AAAA,IAAc,sBAAA;AAAA,EAAqB;AACzF"}
1
+ {"version":3,"file":"useRecurringTransactionBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/RecurringTransactionBlock/useRecurringTransactionBlock.ts"],"sourcesContent":["import {\n useActionContext,\n useRecurringTransactionsStore,\n useTransactionStore,\n} from '../../../common'\nimport type { Beat, RepeatingTransaction } from '../../../core'\n\nimport { resolveSubscriptionGuid } from './subscriptionBeats'\nimport type { RecurringTransactionActionContext } from './useRecurringTransactionPrepare'\n\nexport interface RecurringTransactionBlockState {\n /** True when the open-time load finished without leaving the store loaded; the block offers a retry. */\n hasLoadError: boolean\n /** True until the recurring store has loaded; the block shows a loader instead of an empty state. */\n isLoading: boolean\n /** `undefined` once loading finishes means the subscription could not be resolved. */\n repeatingTransaction?: RepeatingTransaction\n}\n\n/**\n * Resolves the drawer's repeating transaction from the store (so edits write through), falling back to the\n * raw record until transactions load. `guidOverride` (a nested opener's tapped row) wins over the beat.\n */\nexport const useRecurringTransactionBlock = (\n beat: Beat,\n guidOverride?: string,\n): RecurringTransactionBlockState => {\n const { detailedRepeatingTransactions, isDataLoaded, repeatingTransactions } =\n useRecurringTransactionsStore()\n const { transactions } = useTransactionStore()\n // The store is shared: data another widget loaded since wins over this drawer's failure flag.\n const loadFailed =\n useActionContext<RecurringTransactionActionContext>()?.recurringLoadFailed === true\n const hasLoadError = loadFailed && !isDataLoaded\n\n const guid =\n guidOverride ?? resolveSubscriptionGuid(beat, { repeatingTransactions, transactions })\n\n const findByGuid = (list: RepeatingTransaction[]) =>\n list.find((repeating) => repeating.guid === guid)\n\n const raw = guid ? findByGuid(repeatingTransactions) : undefined\n const repeatingTransaction = raw\n ? (findByGuid(detailedRepeatingTransactions) ?? {\n ...raw,\n transactions: raw.transactions ?? [],\n })\n : undefined\n\n return { hasLoadError, isLoading: !isDataLoaded && !hasLoadError, repeatingTransaction }\n}\n"],"mappings":";;AAuBA,IAAa,IAAA,CACX,GACA,MACmC;AACnC,QAAM,EAAE,+BAAA,GAA+B,cAAA,GAAc,uBAAA,EAAA,IACnD,EAA8B,GAC1B,EAAE,cAAA,EAAA,IAAiB,EAAoB,GAIvC,IADJ,EAAoD,GAAG,wBAAwB,MAC9C,CAAC,GAE9B,IACJ,KAAgB,EAAwB,GAAM;AAAA,IAAE,uBAAA;AAAA,IAAuB,cAAA;AAAA,EAAa,CAAC,GAEjF,IAAA,CAAc,MAClB,EAAK,KAAA,CAAM,MAAc,EAAU,SAAS,CAAI,GAE5C,IAAM,IAAO,EAAW,CAAqB,IAAI,QACjD,IAAuB,IACxB,EAAW,CAA6B,KAAK;AAAA,IAC5C,GAAG;AAAA,IACH,cAAc,EAAI,gBAAgB,CAAC;AAAA,EACrC,IACA;AAEJ,SAAO;AAAA,IAAE,cAAA;AAAA,IAAc,WAAW,CAAC,KAAgB,CAAC;AAAA,IAAc,sBAAA;AAAA,EAAqB;AACzF"}
@@ -23,3 +23,12 @@ export declare const useRecurringTransactionLoad: () => () => Promise<void>;
23
23
  * not refetch, and on a ref so a failed load does not refire on every render (retry is explicit).
24
24
  */
25
25
  export declare const useRecurringTransactionPrepare: (_props: ActionBlockProps) => void;
26
+ /**
27
+ * The recurring expenses' load state for a drawer: `failed` also covers TransactionStore swallowing a
28
+ * failed request (`transactionsLoading` excludes another widget's request in flight).
29
+ */
30
+ export declare const useRecurringExpensesLoadState: () => {
31
+ failed: boolean;
32
+ ready: boolean;
33
+ retry: () => undefined;
34
+ };
@@ -1,8 +1,8 @@
1
- import { useInsightsV2Store as o, useRecurringTransactionsStore as s } from "../../../common/context/hooks.es.js";
2
- import e from "react";
1
+ import { useActionContext as u, useInsightsV2Store as l, useRecurringTransactionsStore as i, useTransactionStore as g } from "../../../common/context/hooks.es.js";
2
+ import s from "react";
3
3
  var c = () => {
4
- const a = s(), { setActionContext: r } = o();
5
- return e.useCallback(async () => {
4
+ const a = i(), { setActionContext: r } = l();
5
+ return s.useCallback(async () => {
6
6
  r({ recurringLoadFailed: !1 });
7
7
  try {
8
8
  await a.loadRepeatingTransactionData();
@@ -10,15 +10,32 @@ var c = () => {
10
10
  }
11
11
  a.isDataLoaded || r({ recurringLoadFailed: !0 });
12
12
  }, [a, r]);
13
- }, d = (a) => {
14
- const { isDataLoaded: r } = s(), t = c(), n = e.useRef(!1);
15
- e.useEffect(() => {
16
- n.current || r || (n.current = !0, t());
17
- }, [r, t]);
13
+ }, d = () => {
14
+ const { isDataLoaded: a } = i(), { transactionsLoaded: r, transactionsLoading: e } = g();
15
+ return {
16
+ isDataLoaded: a,
17
+ ready: a && r,
18
+ transactionsFailed: a && !r && !e
19
+ };
20
+ }, p = (a) => {
21
+ const { isDataLoaded: r, transactionsFailed: e } = d(), t = c(), n = s.useRef(!1), o = r && !e;
22
+ s.useEffect(() => {
23
+ n.current || o || (n.current = !0, t());
24
+ }, [o, t]);
25
+ }, F = () => {
26
+ const { isDataLoaded: a, ready: r, transactionsFailed: e } = d(), t = u()?.recurringLoadFailed === !0, n = c();
27
+ return {
28
+ failed: t && !a || e,
29
+ ready: r,
30
+ retry: () => {
31
+ n();
32
+ }
33
+ };
18
34
  };
19
35
  export {
36
+ F as useRecurringExpensesLoadState,
20
37
  c as useRecurringTransactionLoad,
21
- d as useRecurringTransactionPrepare
38
+ p as useRecurringTransactionPrepare
22
39
  };
23
40
 
24
41
  //# sourceMappingURL=useRecurringTransactionPrepare.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRecurringTransactionPrepare.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/RecurringTransactionBlock/useRecurringTransactionPrepare.ts"],"sourcesContent":["import React from 'react'\n\nimport { useInsightsV2Store, useRecurringTransactionsStore } from '../../../common'\nimport type { ActionBlockProps } from '../../mappings/blocks'\n\n/** The key this block layers onto the drawer's action context when its open-time load fails. */\nexport interface RecurringTransactionActionContext {\n recurringLoadFailed?: boolean\n}\n\n/**\n * Runs the recurring widget's loader and records whether it left the store loaded.\n *\n * `RecurringTransactionsStore` swallows API failures into `captureError`, so on a failed request\n * `isDataLoaded` simply stays false and nothing else changes. Left alone, that would keep the block\n * on its loader forever. This is the one place that turns the outcome into a flag the block can\n * render an error state (with retry) from. The flag lives on the drawer's action context, which is\n * per drawer session: a new open starts clean.\n */\nexport const useRecurringTransactionLoad = () => {\n const recurringTransactionsStore = useRecurringTransactionsStore()\n const { setActionContext } = useInsightsV2Store()\n\n return React.useCallback(async () => {\n setActionContext({ recurringLoadFailed: false })\n\n try {\n await recurringTransactionsStore.loadRepeatingTransactionData()\n } catch {\n // Already reported through the store's captureError; the flag below is the UI signal.\n }\n\n if (!recurringTransactionsStore.isDataLoaded) setActionContext({ recurringLoadFailed: true })\n }, [recurringTransactionsStore, setActionContext])\n}\n\n/**\n * Open-time data guarantee for the Expense Details drawer. Wired as the block's `usePrepare`, so\n * `ActionBlockLayer` runs it once each time a CTA opens the drawer.\n *\n * A beat is rendered in the feed long before the recurring module has loaded, so the store is\n * usually cold at open time. The loader is the recurring widget's own (accounts, categories and\n * transactions first, then repeating transactions). Guarded on `isDataLoaded` so re-opening does\n * not refetch, and on a ref so a failed load does not refire on every render (retry is explicit).\n */\nexport const useRecurringTransactionPrepare = (_props: ActionBlockProps) => {\n const { isDataLoaded } = useRecurringTransactionsStore()\n const load = useRecurringTransactionLoad()\n const hasStarted = React.useRef(false)\n\n React.useEffect(() => {\n if (hasStarted.current || isDataLoaded) return\n\n hasStarted.current = true\n void load()\n }, [isDataLoaded, load])\n}\n"],"mappings":";;AAmBA,IAAa,IAAA,MAAoC;AAC/C,QAAM,IAA6B,EAA8B,GAC3D,EAAE,kBAAA,EAAA,IAAqB,EAAmB;AAEhD,SAAO,EAAM,YAAY,YAAY;AACnC,IAAA,EAAiB,EAAE,qBAAqB,GAAM,CAAC;AAE/C,QAAI;AACF,YAAM,EAA2B,6BAA6B;AAAA,IAChE,QAAQ;AAAA,IAER;AAEA,IAAK,EAA2B,gBAAc,EAAiB,EAAE,qBAAqB,GAAK,CAAC;AAAA,EAC9F,GAAG,CAAC,GAA4B,CAAgB,CAAC;AACnD,GAWa,IAAA,CAAkC,MAA6B;AAC1E,QAAM,EAAE,cAAA,EAAA,IAAiB,EAA8B,GACjD,IAAO,EAA4B,GACnC,IAAa,EAAM,OAAO,EAAK;AAErC,EAAA,EAAM,UAAA,MAAgB;AACpB,IAAI,EAAW,WAAW,MAE1B,EAAW,UAAU,IACrB,EAAU;AAAA,EACZ,GAAG,CAAC,GAAc,CAAI,CAAC;AACzB"}
1
+ {"version":3,"file":"useRecurringTransactionPrepare.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/RecurringTransactionBlock/useRecurringTransactionPrepare.ts"],"sourcesContent":["import React from 'react'\n\nimport {\n useActionContext,\n useInsightsV2Store,\n useRecurringTransactionsStore,\n useTransactionStore,\n} from '../../../common'\nimport type { ActionBlockProps } from '../../mappings/blocks'\n\n/** The key this block layers onto the drawer's action context when its open-time load fails. */\nexport interface RecurringTransactionActionContext {\n recurringLoadFailed?: boolean\n}\n\n/**\n * Runs the recurring widget's loader and records whether it left the store loaded.\n *\n * `RecurringTransactionsStore` swallows API failures into `captureError`, so on a failed request\n * `isDataLoaded` simply stays false and nothing else changes. Left alone, that would keep the block\n * on its loader forever. This is the one place that turns the outcome into a flag the block can\n * render an error state (with retry) from. The flag lives on the drawer's action context, which is\n * per drawer session: a new open starts clean.\n */\nexport const useRecurringTransactionLoad = () => {\n const recurringTransactionsStore = useRecurringTransactionsStore()\n const { setActionContext } = useInsightsV2Store()\n\n return React.useCallback(async () => {\n setActionContext({ recurringLoadFailed: false })\n\n try {\n await recurringTransactionsStore.loadRepeatingTransactionData()\n } catch {\n // Already reported through the store's captureError; the flag below is the UI signal.\n }\n\n if (!recurringTransactionsStore.isDataLoaded) setActionContext({ recurringLoadFailed: true })\n }, [recurringTransactionsStore, setActionContext])\n}\n\n/**\n * The flags both hooks below read, derived once so they cannot drift: `transactionsFailed` is\n * TransactionStore swallowing a failed request (`transactionsLoading` excludes another widget's\n * request in flight).\n */\nconst useRecurringLoadFlags = () => {\n const { isDataLoaded } = useRecurringTransactionsStore()\n const { transactionsLoaded, transactionsLoading } = useTransactionStore()\n const transactionsFailed = isDataLoaded && !transactionsLoaded && !transactionsLoading\n\n return { isDataLoaded, ready: isDataLoaded && transactionsLoaded, transactionsFailed }\n}\n\n/**\n * Open-time data guarantee for the Expense Details drawer. Wired as the block's `usePrepare`, so\n * `ActionBlockLayer` runs it once each time a CTA opens the drawer.\n *\n * A beat is rendered in the feed long before the recurring module has loaded, so the store is\n * usually cold at open time. The loader is the recurring widget's own (accounts, categories and\n * transactions first, then repeating transactions). Guarded on `isDataLoaded` so re-opening does\n * not refetch, and on a ref so a failed load does not refire on every render (retry is explicit).\n */\nexport const useRecurringTransactionPrepare = (_props: ActionBlockProps) => {\n const { isDataLoaded, transactionsFailed } = useRecurringLoadFlags()\n const load = useRecurringTransactionLoad()\n const hasStarted = React.useRef(false)\n // A card can load the repeating transactions alone; the drawer still needs the transactions.\n const isComplete = isDataLoaded && !transactionsFailed\n\n React.useEffect(() => {\n if (hasStarted.current || isComplete) return\n\n hasStarted.current = true\n void load()\n }, [isComplete, load])\n}\n\n/**\n * The recurring expenses' load state for a drawer: `failed` also covers TransactionStore swallowing a\n * failed request (`transactionsLoading` excludes another widget's request in flight).\n */\nexport const useRecurringExpensesLoadState = () => {\n const { isDataLoaded, ready, transactionsFailed } = useRecurringLoadFlags()\n const loadFailed =\n useActionContext<RecurringTransactionActionContext>()?.recurringLoadFailed === true\n const retry = useRecurringTransactionLoad()\n\n return {\n failed: (loadFailed && !isDataLoaded) || transactionsFailed,\n ready,\n retry: () => void retry(),\n }\n}\n"],"mappings":";;AAwBA,IAAa,IAAA,MAAoC;AAC/C,QAAM,IAA6B,EAA8B,GAC3D,EAAE,kBAAA,EAAA,IAAqB,EAAmB;AAEhD,SAAO,EAAM,YAAY,YAAY;AACnC,IAAA,EAAiB,EAAE,qBAAqB,GAAM,CAAC;AAE/C,QAAI;AACF,YAAM,EAA2B,6BAA6B;AAAA,IAChE,QAAQ;AAAA,IAER;AAEA,IAAK,EAA2B,gBAAc,EAAiB,EAAE,qBAAqB,GAAK,CAAC;AAAA,EAC9F,GAAG,CAAC,GAA4B,CAAgB,CAAC;AACnD,GAOM,IAAA,MAA8B;AAClC,QAAM,EAAE,cAAA,EAAA,IAAiB,EAA8B,GACjD,EAAE,oBAAA,GAAoB,qBAAA,EAAA,IAAwB,EAAoB;AAGxE,SAAO;AAAA,IAAE,cAAA;AAAA,IAAc,OAAO,KAAgB;AAAA,IAAoB,oBAFvC,KAAgB,CAAC,KAAsB,CAAC;AAAA,EAEkB;AACvF,GAWa,IAAA,CAAkC,MAA6B;AAC1E,QAAM,EAAE,cAAA,GAAc,oBAAA,EAAA,IAAuB,EAAsB,GAC7D,IAAO,EAA4B,GACnC,IAAa,EAAM,OAAO,EAAK,GAE/B,IAAa,KAAgB,CAAC;AAEpC,EAAA,EAAM,UAAA,MAAgB;AACpB,IAAI,EAAW,WAAW,MAE1B,EAAW,UAAU,IACrB,EAAU;AAAA,EACZ,GAAG,CAAC,GAAY,CAAI,CAAC;AACvB,GAMa,IAAA,MAAsC;AACjD,QAAM,EAAE,cAAA,GAAc,OAAA,GAAO,oBAAA,EAAA,IAAuB,EAAsB,GACpE,IACJ,EAAoD,GAAG,wBAAwB,IAC3E,IAAQ,EAA4B;AAE1C,SAAO;AAAA,IACL,QAAS,KAAc,CAAC,KAAiB;AAAA,IACzC,OAAA;AAAA,IACA,OAAA,MAAA;AAAa,MAAK,EAAM;AAAA;AAAA,EAC1B;AACF"}
@@ -1,11 +1,5 @@
1
1
  import { ActionBlockProps } from '../../mappings/blocks';
2
- /**
3
- * Remaining Cash drawer (WEC-1880) for the Payday Cash Left Over Status beat. Store-driven: the
4
- * figures are today's, from CashflowStore's UiStore, not the card's generation-time numbers
5
- * (accepted trade-off, see docs/action-blocks/remaining-cash-block.md).
6
- *
7
- * `observer` is required: everything rendered is read from MobX stores and computeds.
8
- */
2
+ /** Remaining Cash drawer: today's figures from CashflowStore, not the card's (see docs/action-blocks/remaining-cash-block.md). */
9
3
  export declare const RemainingCashBlock: ((_props: ActionBlockProps) => import("react/jsx-runtime").JSX.Element) & {
10
4
  displayName: string;
11
5
  };
@@ -1,91 +1,81 @@
1
- import { CategoryGuids as L } from "../../../core/constants/Category.es.js";
2
- import { DEFAULT_INSTITUTION_LOGO_URL as T } from "../../../core/constants/InstitutionLogo.es.js";
3
- import R from "../../../common/utils/AccountDisplayName.es.js";
4
- import { useAccountStore as G, useActionContext as S, useAppConfig as w, useCashflowStore as A, useGlobalCopyStore as U, useRecurringTransactionsStore as E, useTransactionStore as I } from "../../../common/context/hooks.es.js";
5
- import { getAccountStartingBalance as O } from "../../../core/utils/AccountUtils.es.js";
6
- import b from "../../../common/components/Loader.es.js";
7
- import d from "../../components/CategoryTile.es.js";
8
- import { ErrorCard as k } from "../../components/ErrorCard.es.js";
9
- import { useRecurringTransactionLoad as v } from "../RecurringTransactionBlock/useRecurringTransactionPrepare.es.js";
10
- import { getCaption as N, getOtherLabel as D, groupRows as F } from "./layout.es.js";
11
- import z from "./RemainingCashContent.es.js";
12
- import { observer as B } from "mobx-react-lite";
13
- import H from "@mui/material/Stack";
14
- import { InstitutionLogo as p, Text as P } from "@mxenabled/mxui";
1
+ import { CategoryGuids as h } from "../../../core/constants/Category.es.js";
2
+ import { DEFAULT_INSTITUTION_LOGO_URL as _ } from "../../../core/constants/InstitutionLogo.es.js";
3
+ import y from "../../../common/utils/AccountDisplayName.es.js";
4
+ import { useAccountStore as C, useAppConfig as x, useCashflowStore as T, useGlobalCopyStore as G } from "../../../common/context/hooks.es.js";
5
+ import { getAccountStartingBalance as R } from "../../../core/utils/AccountUtils.es.js";
6
+ import L from "../../../common/components/Loader.es.js";
7
+ import r from "../../components/CategoryTile.es.js";
8
+ import { ErrorCard as E } from "../../components/ErrorCard.es.js";
9
+ import { useRecurringExpensesLoadState as S } from "../RecurringTransactionBlock/useRecurringTransactionPrepare.es.js";
10
+ import { foldOtherRows as a, getCaption as U } from "./layout.es.js";
11
+ import A from "./RemainingCashContent.es.js";
12
+ import { observer as I } from "mobx-react-lite";
13
+ import O from "@mui/material/Stack";
14
+ import { InstitutionLogo as s, Text as b } from "@mxenabled/mxui";
15
15
  import { jsx as n } from "react/jsx-runtime";
16
- var g = (m, i, s) => {
17
- const { others: a, shown: r } = F(m);
18
- return a ? [...r, {
19
- amount: a.total,
20
- key: "other",
21
- leading: s,
22
- name: D(i.one, i.multi, a.count)
23
- }] : r;
24
- }, to = B(function(i) {
25
- const { common: s, insights_feed: a } = U(), { config: r } = w(), { uiStore: t } = A(), { accountsLoaded: l } = G(), { transactionsLoaded: u, transactionsLoading: h } = I(), { isDataLoaded: c } = E(), f = S()?.recurringLoadFailed === !0, _ = v(), y = c && !u && !h, o = a?.remaining_cash;
26
- if (a?.general && !o) return /* @__PURE__ */ n(H, {
16
+ var Q = I(function(N) {
17
+ const { common: m, insights_feed: i } = G(), { config: c } = x(), { uiStore: t } = T(), { accountsLoaded: p } = C(), { failed: u, ready: d, retry: g } = S(), e = i?.remaining_cash;
18
+ if (i?.general && !e) return /* @__PURE__ */ n(O, {
27
19
  sx: { p: 24 },
28
- children: /* @__PURE__ */ n(P, { children: s?.error_message })
20
+ children: /* @__PURE__ */ n(b, { children: m?.error_message })
29
21
  });
30
- if (f && !c || y) return /* @__PURE__ */ n(k, { onRetry: () => {
31
- _();
32
- } });
33
- if (!c || !l || !u || !o) return /* @__PURE__ */ n(b, {});
34
- const C = g(t.selectedCashAccounts.map((e) => ({
35
- amount: O(e, r.display_available_balance_in_accounts),
36
- key: e.guid,
37
- leading: /* @__PURE__ */ n(p, {
22
+ if (u) return /* @__PURE__ */ n(E, { onRetry: g });
23
+ if (!d || !p || !e) return /* @__PURE__ */ n(L, {});
24
+ const l = a(t.selectedCashAccounts.map((o) => ({
25
+ amount: R(o, c.display_available_balance_in_accounts),
26
+ key: o.guid,
27
+ leading: /* @__PURE__ */ n(s, {
38
28
  alt: "",
39
- institutionGuid: e.institution_guid ?? "",
29
+ institutionGuid: o.institution_guid ?? "",
40
30
  size: 32
41
31
  }),
42
- name: R(e)
32
+ name: y(o)
43
33
  })), {
44
- multi: o.other_accounts,
45
- one: o.other_accounts_one
46
- }, /* @__PURE__ */ n(p, {
34
+ multi: e.other_accounts,
35
+ one: e.other_accounts_one
36
+ }, /* @__PURE__ */ n(s, {
47
37
  alt: "",
48
38
  institutionGuid: "",
49
- logoUrl: T,
39
+ logoUrl: _,
50
40
  size: 32
51
- })), x = g(t.expensesTilNextIncome.map((e) => ({
52
- amount: e.amount,
53
- key: `${e.repeatingTransactionGuid}-${e.expectedDate.getTime()}`,
54
- leading: /* @__PURE__ */ n(d, {
55
- categoryGuid: e.categoryGuid,
41
+ })), f = a(t.expensesTilNextIncome.map((o) => ({
42
+ amount: o.amount,
43
+ key: `${o.repeatingTransactionGuid}-${o.expectedDate.getTime()}`,
44
+ leading: /* @__PURE__ */ n(r, {
45
+ categoryGuid: o.categoryGuid,
56
46
  size: 32
57
47
  }),
58
- name: e.name
48
+ name: o.name
59
49
  })), {
60
- multi: o.other_expenses,
61
- one: o.other_expenses_one
62
- }, /* @__PURE__ */ n(d, {
63
- categoryGuid: L.UNCATEGORIZED,
50
+ multi: e.other_expenses,
51
+ one: e.other_expenses_one
52
+ }, /* @__PURE__ */ n(r, {
53
+ categoryGuid: h.UNCATEGORIZED,
64
54
  size: 32
65
55
  }));
66
- return /* @__PURE__ */ n(z, {
56
+ return /* @__PURE__ */ n(A, {
67
57
  accounts: {
68
- header: o.accounts_header,
69
- rows: C
58
+ header: e.accounts_header,
59
+ rows: l
70
60
  },
71
61
  expenses: {
72
- header: o.recurring_expenses_header,
73
- rows: x
62
+ header: e.recurring_expenses_header,
63
+ rows: f
74
64
  },
75
65
  summary: {
76
66
  remaining: t.hasUpcomingPayday ? {
77
67
  amount: t.remainingUntilPayday,
78
- caption: N(o, t.daysUntilNextIncome)
68
+ caption: U(e, t.daysUntilNextIncome)
79
69
  } : void 0,
80
70
  cashOnHand: t.selectedCashBalance,
81
- cashOnHandLabel: o.cash_on_hand,
71
+ cashOnHandLabel: e.cash_on_hand,
82
72
  upcomingExpenses: t.upcomingExpensesTotal,
83
- upcomingExpensesLabel: o.upcoming_expenses
73
+ upcomingExpensesLabel: e.upcoming_expenses
84
74
  }
85
75
  });
86
76
  });
87
77
  export {
88
- to as RemainingCashBlock
78
+ Q as RemainingCashBlock
89
79
  };
90
80
 
91
81
  //# sourceMappingURL=RemainingCashBlock.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RemainingCashBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Stack from '@mui/material/Stack'\n\nimport { InstitutionLogo, Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport {\n Loader,\n useAccountStore,\n useActionContext,\n useAppConfig,\n useCashflowStore,\n useGlobalCopyStore,\n useRecurringTransactionsStore,\n useTransactionStore,\n} from '../../../common'\nimport getAccountDisplayName from '../../../common/utils/AccountDisplayName'\nimport { CategoryGuids } from '../../../core/constants/Category'\nimport { DEFAULT_INSTITUTION_LOGO_URL } from '../../../core/constants/InstitutionLogo'\nimport { getAccountStartingBalance } from '../../../core/utils/AccountUtils'\nimport CategoryTile from '../../components/CategoryTile'\nimport { ErrorCard } from '../../components/ErrorCard'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport {\n type RecurringTransactionActionContext,\n useRecurringTransactionLoad,\n} from '../RecurringTransactionBlock'\n\nimport { getCaption, getOtherLabel, groupRows } from './layout'\nimport RemainingCashContent from './RemainingCashContent'\nimport type { RemainingCashRow } from './RemainingCashContent'\n\n/** Top rows by amount, then one \"Other (#)\" row with the rest's count and total. */\nconst toSectionRows = (\n rows: RemainingCashRow[],\n otherLabel: { one: string; multi: string },\n otherLeading: ReactNode,\n): RemainingCashRow[] => {\n const { others, shown } = groupRows(rows)\n\n if (!others) return shown\n\n return [\n ...shown,\n {\n amount: others.total,\n key: 'other',\n leading: otherLeading,\n name: getOtherLabel(otherLabel.one, otherLabel.multi, others.count),\n },\n ]\n}\n\n/**\n * Remaining Cash drawer (WEC-1880) for the Payday Cash Left Over Status beat. Store-driven: the\n * figures are today's, from CashflowStore's UiStore, not the card's generation-time numbers\n * (accepted trade-off, see docs/action-blocks/remaining-cash-block.md).\n *\n * `observer` is required: everything rendered is read from MobX stores and computeds.\n */\nexport const RemainingCashBlock = observer(function RemainingCashBlock(_props: ActionBlockProps) {\n const { common: commonCopy, insights_feed: insightsFeedCopy } = useGlobalCopyStore()\n const { config } = useAppConfig()\n const { uiStore } = useCashflowStore()\n const { accountsLoaded } = useAccountStore()\n const { transactionsLoaded, transactionsLoading } = useTransactionStore()\n const { isDataLoaded } = useRecurringTransactionsStore()\n const loadFailed =\n useActionContext<RecurringTransactionActionContext>()?.recurringLoadFailed === true\n const retryLoad = useRecurringTransactionLoad()\n\n // TransactionStore swallows a failed request, which would silently zero every expense (see the\n // States table in docs/action-blocks/remaining-cash-block.md). `transactionsLoading` excludes another\n // widget's request still in flight: loadTransactions returns early without awaiting it.\n const transactionsFailed = isDataLoaded && !transactionsLoaded && !transactionsLoading\n const copy = insightsFeedCopy?.remaining_cash\n\n // Copy loaded but without this namespace (the copy service has not shipped it). Copy loads once at\n // app start, so a retry cannot clear it: a plain message like ActionBlockLayer's unknown-block\n // state, not ErrorCard's Try Again, and never an endless loader.\n if (insightsFeedCopy?.general && !copy) {\n return (\n <Stack sx={{ p: 24 }}>\n <Text>{commonCopy?.error_message}</Text>\n </Stack>\n )\n }\n\n if ((loadFailed && !isDataLoaded) || transactionsFailed) {\n return <ErrorCard onRetry={() => void retryLoad()} />\n }\n\n // `accountsLoaded` / `transactionsLoaded` cover another widget's request still in flight.\n if (!isDataLoaded || !accountsLoaded || !transactionsLoaded || !copy) return <Loader />\n\n const accountRows = toSectionRows(\n uiStore.selectedCashAccounts.map((account) => ({\n amount: getAccountStartingBalance(account, config.display_available_balance_in_accounts),\n key: account.guid,\n // Decorative: the row's visible name already says which account it is.\n leading: (\n <InstitutionLogo alt=\"\" institutionGuid={account.institution_guid ?? ''} size={32} />\n ),\n name: getAccountDisplayName(account),\n })),\n { multi: copy.other_accounts, one: copy.other_accounts_one },\n <InstitutionLogo alt=\"\" institutionGuid=\"\" logoUrl={DEFAULT_INSTITUTION_LOGO_URL} size={32} />,\n )\n const expenseRows = toSectionRows(\n uiStore.expensesTilNextIncome.map((expense) => ({\n amount: expense.amount,\n key: `${expense.repeatingTransactionGuid}-${expense.expectedDate.getTime()}`,\n leading: <CategoryTile categoryGuid={expense.categoryGuid} size={32} />,\n name: expense.name,\n })),\n { multi: copy.other_expenses, one: copy.other_expenses_one },\n <CategoryTile categoryGuid={CategoryGuids.UNCATEGORIZED} size={32} />,\n )\n\n return (\n <RemainingCashContent\n accounts={{ header: copy.accounts_header, rows: accountRows }}\n expenses={{ header: copy.recurring_expenses_header, rows: expenseRows }}\n summary={{\n remaining: uiStore.hasUpcomingPayday\n ? {\n amount: uiStore.remainingUntilPayday,\n caption: getCaption(copy, uiStore.daysUntilNextIncome),\n }\n : undefined,\n cashOnHand: uiStore.selectedCashBalance,\n cashOnHandLabel: copy.cash_on_hand,\n upcomingExpenses: uiStore.upcomingExpensesTotal,\n upcomingExpensesLabel: copy.upcoming_expenses,\n }}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;AAkCA,IAAM,IAAA,CACJ,GACA,GACA,MACuB;AACvB,QAAM,EAAE,QAAA,GAAQ,OAAA,EAAA,IAAU,EAAU,CAAI;AAExC,SAAK,IAEE,CACL,GAAG,GACH;AAAA,IACE,QAAQ,EAAO;AAAA,IACf,KAAK;AAAA,IACL,SAAS;AAAA,IACT,MAAM,EAAc,EAAW,KAAK,EAAW,OAAO,EAAO,KAAK;AAAA,EACpE,CACF,IAVoB;AAWtB,GASa,KAAqB,EAAS,SAA4B,GAA0B;AAC/F,QAAM,EAAE,QAAQ,GAAY,eAAe,EAAA,IAAqB,EAAmB,GAC7E,EAAE,QAAA,EAAA,IAAW,EAAa,GAC1B,EAAE,SAAA,EAAA,IAAY,EAAiB,GAC/B,EAAE,gBAAA,EAAA,IAAmB,EAAgB,GACrC,EAAE,oBAAA,GAAoB,qBAAA,EAAA,IAAwB,EAAoB,GAClE,EAAE,cAAA,EAAA,IAAiB,EAA8B,GACjD,IACJ,EAAoD,GAAG,wBAAwB,IAC3E,IAAY,EAA4B,GAKxC,IAAqB,KAAgB,CAAC,KAAsB,CAAC,GAC7D,IAAO,GAAkB;AAK/B,MAAI,GAAkB,WAAW,CAAC,EAChC,QACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,GAAG,GAAG;AAAA,IACjB,UAAA,gBAAA,EAAC,GAAD,EAAA,UAAO,GAAY,cAAoB,CAAA;AAAA,EAClC,CAAA;AAIX,MAAK,KAAc,CAAC,KAAiB,EACnC,QAAO,gBAAA,EAAC,GAAD,EAAW,SAAA,MAAA;AAAe,IAAK,EAAU;AAAA,IAAI,CAAA;AAItD,MAAI,CAAC,KAAgB,CAAC,KAAkB,CAAC,KAAsB,CAAC,EAAM,QAAO,gBAAA,EAAC,GAAD,CAAS,CAAA;AAEtF,QAAM,IAAc,EAClB,EAAQ,qBAAqB,IAAA,CAAK,OAAa;AAAA,IAC7C,QAAQ,EAA0B,GAAS,EAAO,qCAAqC;AAAA,IACvF,KAAK,EAAQ;AAAA,IAEb,SACE,gBAAA,EAAC,GAAD;AAAA,MAAiB,KAAI;AAAA,MAAG,iBAAiB,EAAQ,oBAAoB;AAAA,MAAI,MAAM;AAAA,IAAK,CAAA;AAAA,IAEtF,MAAM,EAAsB,CAAO;AAAA,EACrC,EAAE,GACF;AAAA,IAAE,OAAO,EAAK;AAAA,IAAgB,KAAK,EAAK;AAAA,EAAmB,GAC3D,gBAAA,EAAC,GAAD;AAAA,IAAiB,KAAI;AAAA,IAAG,iBAAgB;AAAA,IAAG,SAAS;AAAA,IAA8B,MAAM;AAAA,EAAK,CAAA,CAC/F,GACM,IAAc,EAClB,EAAQ,sBAAsB,IAAA,CAAK,OAAa;AAAA,IAC9C,QAAQ,EAAQ;AAAA,IAChB,KAAK,GAAG,EAAQ,wBAAA,IAA4B,EAAQ,aAAa,QAAQ,CAAA;AAAA,IACzE,SAAS,gBAAA,EAAC,GAAD;AAAA,MAAc,cAAc,EAAQ;AAAA,MAAc,MAAM;AAAA,IAAK,CAAA;AAAA,IACtE,MAAM,EAAQ;AAAA,EAChB,EAAE,GACF;AAAA,IAAE,OAAO,EAAK;AAAA,IAAgB,KAAK,EAAK;AAAA,EAAmB,GAC3D,gBAAA,EAAC,GAAD;AAAA,IAAc,cAAc,EAAc;AAAA,IAAe,MAAM;AAAA,EAAK,CAAA,CACtE;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,UAAU;AAAA,MAAE,QAAQ,EAAK;AAAA,MAAiB,MAAM;AAAA,IAAY;AAAA,IAC5D,UAAU;AAAA,MAAE,QAAQ,EAAK;AAAA,MAA2B,MAAM;AAAA,IAAY;AAAA,IACtE,SAAS;AAAA,MACP,WAAW,EAAQ,oBACf;AAAA,QACE,QAAQ,EAAQ;AAAA,QAChB,SAAS,EAAW,GAAM,EAAQ,mBAAmB;AAAA,MACvD,IACA;AAAA,MACJ,YAAY,EAAQ;AAAA,MACpB,iBAAiB,EAAK;AAAA,MACtB,kBAAkB,EAAQ;AAAA,MAC1B,uBAAuB,EAAK;AAAA,IAC9B;AAAA,EACD,CAAA;AAEL,CAAC"}
1
+ {"version":3,"file":"RemainingCashBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { InstitutionLogo, Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport {\n Loader,\n useAccountStore,\n useAppConfig,\n useCashflowStore,\n useGlobalCopyStore,\n} from '../../../common'\nimport getAccountDisplayName from '../../../common/utils/AccountDisplayName'\nimport { CategoryGuids } from '../../../core/constants/Category'\nimport { DEFAULT_INSTITUTION_LOGO_URL } from '../../../core/constants/InstitutionLogo'\nimport { getAccountStartingBalance } from '../../../core/utils/AccountUtils'\nimport CategoryTile from '../../components/CategoryTile'\nimport { ErrorCard } from '../../components/ErrorCard'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { useRecurringExpensesLoadState } from '../RecurringTransactionBlock'\n\nimport { foldOtherRows, getCaption } from './layout'\nimport RemainingCashContent from './RemainingCashContent'\n\n/** Remaining Cash drawer: today's figures from CashflowStore, not the card's (see docs/action-blocks/remaining-cash-block.md). */\nexport const RemainingCashBlock = observer(function RemainingCashBlock(_props: ActionBlockProps) {\n const { common: commonCopy, insights_feed: insightsFeedCopy } = useGlobalCopyStore()\n const { config } = useAppConfig()\n const { uiStore } = useCashflowStore()\n const { accountsLoaded } = useAccountStore()\n const { failed, ready, retry } = useRecurringExpensesLoadState()\n const copy = insightsFeedCopy?.remaining_cash\n\n // Copy loads once, so a retry can't fix a missing namespace: a plain message, not ErrorCard.\n if (insightsFeedCopy?.general && !copy) {\n return (\n <Stack sx={{ p: 24 }}>\n <Text>{commonCopy?.error_message}</Text>\n </Stack>\n )\n }\n\n if (failed) return <ErrorCard onRetry={retry} />\n\n // `accountsLoaded` / `ready` cover another widget's request still in flight.\n if (!ready || !accountsLoaded || !copy) return <Loader />\n\n const accountRows = foldOtherRows(\n uiStore.selectedCashAccounts.map((account) => ({\n amount: getAccountStartingBalance(account, config.display_available_balance_in_accounts),\n key: account.guid,\n // Decorative: the row's visible name already says which account it is.\n leading: (\n <InstitutionLogo alt=\"\" institutionGuid={account.institution_guid ?? ''} size={32} />\n ),\n name: getAccountDisplayName(account),\n })),\n { multi: copy.other_accounts, one: copy.other_accounts_one },\n <InstitutionLogo alt=\"\" institutionGuid=\"\" logoUrl={DEFAULT_INSTITUTION_LOGO_URL} size={32} />,\n )\n const expenseRows = foldOtherRows(\n uiStore.expensesTilNextIncome.map((expense) => ({\n amount: expense.amount,\n key: `${expense.repeatingTransactionGuid}-${expense.expectedDate.getTime()}`,\n leading: <CategoryTile categoryGuid={expense.categoryGuid} size={32} />,\n name: expense.name,\n })),\n { multi: copy.other_expenses, one: copy.other_expenses_one },\n <CategoryTile categoryGuid={CategoryGuids.UNCATEGORIZED} size={32} />,\n )\n\n return (\n <RemainingCashContent\n accounts={{ header: copy.accounts_header, rows: accountRows }}\n expenses={{ header: copy.recurring_expenses_header, rows: expenseRows }}\n summary={{\n remaining: uiStore.hasUpcomingPayday\n ? {\n amount: uiStore.remainingUntilPayday,\n caption: getCaption(copy, uiStore.daysUntilNextIncome),\n }\n : undefined,\n cashOnHand: uiStore.selectedCashBalance,\n cashOnHandLabel: copy.cash_on_hand,\n upcomingExpenses: uiStore.upcomingExpensesTotal,\n upcomingExpensesLabel: copy.upcoming_expenses,\n }}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;AAyBA,IAAa,IAAqB,EAAS,SAA4B,GAA0B;AAC/F,QAAM,EAAE,QAAQ,GAAY,eAAe,EAAA,IAAqB,EAAmB,GAC7E,EAAE,QAAA,EAAA,IAAW,EAAa,GAC1B,EAAE,SAAA,EAAA,IAAY,EAAiB,GAC/B,EAAE,gBAAA,EAAA,IAAmB,EAAgB,GACrC,EAAE,QAAA,GAAQ,OAAA,GAAO,OAAA,EAAA,IAAU,EAA8B,GACzD,IAAO,GAAkB;AAG/B,MAAI,GAAkB,WAAW,CAAC,EAChC,QACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,GAAG,GAAG;AAAA,IACjB,UAAA,gBAAA,EAAC,GAAD,EAAA,UAAO,GAAY,cAAoB,CAAA;AAAA,EAClC,CAAA;AAIX,MAAI,EAAQ,QAAO,gBAAA,EAAC,GAAD,EAAW,SAAS,EAAQ,CAAA;AAG/C,MAAI,CAAC,KAAS,CAAC,KAAkB,CAAC,EAAM,QAAO,gBAAA,EAAC,GAAD,CAAS,CAAA;AAExD,QAAM,IAAc,EAClB,EAAQ,qBAAqB,IAAA,CAAK,OAAa;AAAA,IAC7C,QAAQ,EAA0B,GAAS,EAAO,qCAAqC;AAAA,IACvF,KAAK,EAAQ;AAAA,IAEb,SACE,gBAAA,EAAC,GAAD;AAAA,MAAiB,KAAI;AAAA,MAAG,iBAAiB,EAAQ,oBAAoB;AAAA,MAAI,MAAM;AAAA,IAAK,CAAA;AAAA,IAEtF,MAAM,EAAsB,CAAO;AAAA,EACrC,EAAE,GACF;AAAA,IAAE,OAAO,EAAK;AAAA,IAAgB,KAAK,EAAK;AAAA,EAAmB,GAC3D,gBAAA,EAAC,GAAD;AAAA,IAAiB,KAAI;AAAA,IAAG,iBAAgB;AAAA,IAAG,SAAS;AAAA,IAA8B,MAAM;AAAA,EAAK,CAAA,CAC/F,GACM,IAAc,EAClB,EAAQ,sBAAsB,IAAA,CAAK,OAAa;AAAA,IAC9C,QAAQ,EAAQ;AAAA,IAChB,KAAK,GAAG,EAAQ,wBAAA,IAA4B,EAAQ,aAAa,QAAQ,CAAA;AAAA,IACzE,SAAS,gBAAA,EAAC,GAAD;AAAA,MAAc,cAAc,EAAQ;AAAA,MAAc,MAAM;AAAA,IAAK,CAAA;AAAA,IACtE,MAAM,EAAQ;AAAA,EAChB,EAAE,GACF;AAAA,IAAE,OAAO,EAAK;AAAA,IAAgB,KAAK,EAAK;AAAA,EAAmB,GAC3D,gBAAA,EAAC,GAAD;AAAA,IAAc,cAAc,EAAc;AAAA,IAAe,MAAM;AAAA,EAAK,CAAA,CACtE;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,UAAU;AAAA,MAAE,QAAQ,EAAK;AAAA,MAAiB,MAAM;AAAA,IAAY;AAAA,IAC5D,UAAU;AAAA,MAAE,QAAQ,EAAK;AAAA,MAA2B,MAAM;AAAA,IAAY;AAAA,IACtE,SAAS;AAAA,MACP,WAAW,EAAQ,oBACf;AAAA,QACE,QAAQ,EAAQ;AAAA,QAChB,SAAS,EAAW,GAAM,EAAQ,mBAAmB;AAAA,MACvD,IACA;AAAA,MACJ,YAAY,EAAQ;AAAA,MACpB,iBAAiB,EAAK;AAAA,MACtB,kBAAkB,EAAQ;AAAA,MAC1B,uBAAuB,EAAK;AAAA,IAC9B;AAAA,EACD,CAAA;AAEL,CAAC"}