@mx-cartographer/experiences 9.7.49 → 9.7.51

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 +11 -0
  2. package/dist/core/constants/Help.d.ts +4 -27
  3. package/dist/core/constants/Help.es.js +46 -15
  4. package/dist/core/constants/Help.es.js.map +1 -1
  5. package/dist/core/types/Help.d.ts +13 -0
  6. package/dist/core/types/localization/TransactionsCopy.d.ts +1 -0
  7. package/dist/core/utils/HelpUtil.es.js +7 -7
  8. package/dist/core/utils/HelpUtil.es.js.map +1 -1
  9. package/dist/core/utils/TransactionUtils.d.ts +1 -0
  10. package/dist/core/utils/TransactionUtils.es.js +19 -18
  11. package/dist/core/utils/TransactionUtils.es.js.map +1 -1
  12. package/dist/help/components/Help.es.js +30 -29
  13. package/dist/help/components/Help.es.js.map +1 -1
  14. package/dist/help/components/content/ContentItem.es.js +24 -23
  15. package/dist/help/components/content/ContentItem.es.js.map +1 -1
  16. package/dist/help/components/content/section/General.es.js +37 -32
  17. package/dist/help/components/content/section/General.es.js.map +1 -1
  18. package/dist/help/components/content/section/LoginIssues.es.js +10 -7
  19. package/dist/help/components/content/section/LoginIssues.es.js.map +1 -1
  20. package/dist/help/components/content/section/index.es.js +24 -24
  21. package/dist/help/components/requestsupport/HelpByCategoryList.es.js +24 -20
  22. package/dist/help/components/requestsupport/HelpByCategoryList.es.js.map +1 -1
  23. package/dist/transactions/TransactionWidget.es.js +37 -36
  24. package/dist/transactions/TransactionWidget.es.js.map +1 -1
  25. package/dist/transactions/components/shared/TransactionList.d.ts +1 -0
  26. package/dist/transactions/components/shared/TransactionList.es.js +46 -45
  27. package/dist/transactions/components/shared/TransactionList.es.js.map +1 -1
  28. package/dist/transactions/components/shared/UnviewedIndicator.d.ts +6 -0
  29. package/dist/transactions/components/shared/UnviewedIndicator.es.js +21 -0
  30. package/dist/transactions/components/shared/UnviewedIndicator.es.js.map +1 -0
  31. package/dist/transactions/components/shared/transactionlist/TransactionRow.d.ts +2 -0
  32. package/dist/transactions/components/shared/transactionlist/TransactionRow.es.js +38 -37
  33. package/dist/transactions/components/shared/transactionlist/TransactionRow.es.js.map +1 -1
  34. package/dist/transactions/components/shared/transactiontable/cells/FlagCell.es.js +23 -32
  35. package/dist/transactions/components/shared/transactiontable/cells/FlagCell.es.js.map +1 -1
  36. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## [9.7.51] - 10-27-2026
2
+
3
+ - **FIXED** - unviewed indicator in the transactions widget list layout (MEW-4211)
4
+
5
+ ## [9.7.50] - 10-27-2026
6
+
7
+ - **CHANGED** - Help Request Support: the Institution card no longer lists "Login Issues" (it went straight to ticket submission); Login Issues is its own card that opens the help articles (WEC-1877)
8
+ - **ADDED** - The four Login Issues help articles are also listed under General FAQs on the main help screen, opening the same article pages (General FAQs delegates those topics to the `LoginIssues` section) (WEC-1877)
9
+ - **CHANGED** - General FAQs lists the four Login Issues articles first. Topics can set `copyIndex` to read a specific copy label, so the display order changes without reordering the copy (WEC-1877)
10
+ - **FIXED** - Even line spacing in Request Support's Contact Your Bank bullets (the theme's 44px list-item minimum padded one-line bullets but not wrapped ones) and between Login Issues article steps, via an optional `itemGap` on the shared help `List` (WEC-1877)
11
+
1
12
  ## [9.7.49] - 10-26-2026
2
13
 
3
14
  - **FIXED** - Transaction Details drilldown design QA (WEC-2137): the merchant logo no longer carries an elevation shadow (64px, radius 8, flat), and the account feed line is 9/12 bold 700 uppercase with 0.27px tracking in `text.secondary`, with the masked account number on that line instead of the account name line. A long feed description truncates in its line without pushing the number out, the number is omitted when the account has none, and the logo keeps a `background.paper` surface
@@ -1,30 +1,7 @@
1
- import { HelpByCategoryDefinition } from '../types/Help';
2
- export declare const HELP_CATEGORIES: ({
3
- guid: string;
4
- icon: string;
5
- title: string;
6
- topics: {
7
- topicKey: string;
8
- }[];
9
- flags?: undefined;
10
- } | {
11
- flags: string[];
12
- guid: string;
13
- icon: string;
14
- title: string;
15
- topics: {
16
- topicKey: string;
17
- }[];
18
- } | {
19
- flags: string[];
20
- guid: string;
21
- icon: string;
22
- title: string;
23
- topics: {
24
- label: string;
25
- topicKey: string;
26
- }[];
27
- })[];
1
+ import { HelpByCategoryDefinition, HelpCategoryDefinition } from '../types/Help';
2
+ export declare const LOGIN_ISSUE_TOPIC_KEYS: readonly ["not-receiving-code", "wrong-phone-number", "outdated-contact-info", "new-code-or-token"];
3
+ export declare const isLoginIssueTopic: (topicKey: string) => boolean;
4
+ export declare const HELP_CATEGORIES: HelpCategoryDefinition[];
28
5
  export declare const HELP_CONTENT: {
29
6
  accounts: {
30
7
  guid: string;
@@ -1,13 +1,46 @@
1
- var e = [
1
+ var t = [
2
+ "not-receiving-code",
3
+ "wrong-phone-number",
4
+ "outdated-contact-info",
5
+ "new-code-or-token"
6
+ ], i = (e) => t.includes(e), o = [
2
7
  {
3
8
  guid: "general",
4
9
  icon: "info",
5
10
  title: "General FAQs",
6
11
  topics: [
7
- { topicKey: "is-my-data-private-and-secure" },
8
- { topicKey: "why-are-some-of-my-transactions-uncategorized" },
9
- { topicKey: "why-cant-i-see-the-software" },
10
- { topicKey: "how-do-i-log-out-of-the-software" }
12
+ {
13
+ topicKey: "not-receiving-code",
14
+ copyIndex: 4
15
+ },
16
+ {
17
+ topicKey: "wrong-phone-number",
18
+ copyIndex: 5
19
+ },
20
+ {
21
+ topicKey: "outdated-contact-info",
22
+ copyIndex: 6
23
+ },
24
+ {
25
+ topicKey: "new-code-or-token",
26
+ copyIndex: 7
27
+ },
28
+ {
29
+ topicKey: "is-my-data-private-and-secure",
30
+ copyIndex: 0
31
+ },
32
+ {
33
+ topicKey: "why-are-some-of-my-transactions-uncategorized",
34
+ copyIndex: 1
35
+ },
36
+ {
37
+ topicKey: "why-cant-i-see-the-software",
38
+ copyIndex: 2
39
+ },
40
+ {
41
+ topicKey: "how-do-i-log-out-of-the-software",
42
+ copyIndex: 3
43
+ }
11
44
  ]
12
45
  },
13
46
  {
@@ -94,10 +127,7 @@ var e = [
94
127
  guid: "recurring_transactions",
95
128
  icon: "currency_exchange",
96
129
  title: "Recurring Transactions",
97
- topics: [{
98
- label: "Recurring Transactions Widget Overview",
99
- topicKey: "overview"
100
- }]
130
+ topics: [{ topicKey: "overview" }]
101
131
  },
102
132
  {
103
133
  flags: ["show_investments_widget_in_master"],
@@ -126,7 +156,7 @@ var e = [
126
156
  title: "Mobile",
127
157
  topics: [{ topicKey: "mobile-devices-overview" }]
128
158
  }
129
- ], t = [
159
+ ], n = [
130
160
  {
131
161
  guid: "personal_information",
132
162
  icon: "person",
@@ -153,7 +183,6 @@ var e = [
153
183
  topics: [
154
184
  { type: "external" },
155
185
  { type: "other" },
156
- { type: "internal" },
157
186
  { type: "internal" }
158
187
  ]
159
188
  },
@@ -181,7 +210,7 @@ var e = [
181
210
  icon: "call",
182
211
  topics: []
183
212
  }
184
- ], i = [
213
+ ], c = [
185
214
  { type: "external" },
186
215
  { type: "external" },
187
216
  { type: "external" },
@@ -190,9 +219,11 @@ var e = [
190
219
  { type: "internal" }
191
220
  ];
192
221
  export {
193
- t as HELP_BY_CATEGORY_LIST,
194
- e as HELP_CATEGORIES,
195
- i as POPULAR_TOPICS_LIST
222
+ n as HELP_BY_CATEGORY_LIST,
223
+ o as HELP_CATEGORIES,
224
+ t as LOGIN_ISSUE_TOPIC_KEYS,
225
+ c as POPULAR_TOPICS_LIST,
226
+ i as isLoginIssueTopic
196
227
  };
197
228
 
198
229
  //# sourceMappingURL=Help.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Help.es.js","names":[],"sources":["../../../src/core/constants/Help.ts"],"sourcesContent":["import type { HelpByCategoryDefinition } from '../types/Help'\n\nexport const HELP_CATEGORIES = [\n {\n guid: 'general',\n icon: 'info',\n title: 'General FAQs',\n topics: [\n {\n topicKey: 'is-my-data-private-and-secure',\n },\n {\n topicKey: 'why-are-some-of-my-transactions-uncategorized',\n },\n {\n topicKey: 'why-cant-i-see-the-software',\n },\n {\n topicKey: 'how-do-i-log-out-of-the-software',\n },\n ],\n },\n {\n flags: ['show_accounts_widget_in_master'],\n guid: 'accounts',\n icon: 'account_balance',\n title: 'Accounts',\n topics: [\n {\n topicKey: 'accounts-overview',\n },\n {\n topicKey: 'trouble-adding-an-account',\n },\n {\n topicKey: 'need-to-fix-a-broken-account',\n },\n {\n topicKey: 'seeing-outdated-accounts-or-paid-off-loans',\n },\n {\n topicKey: 'seeing-duplicate-accounts',\n },\n ],\n },\n {\n flags: ['show_transactions_widget_in_master'],\n guid: 'transactions',\n icon: 'receipt_long',\n title: 'Transactions',\n topics: [\n {\n topicKey: 'transactions-overview',\n },\n {\n topicKey: 'seeing-duplicate-transactions',\n },\n {\n topicKey: 'missing-transactions',\n },\n {\n topicKey: 'pending-transactions',\n },\n {\n topicKey: 'exporting-transactions',\n },\n ],\n },\n {\n flags: ['show_spending_widget_in_master'],\n guid: 'spending',\n icon: 'donut_small',\n title: 'Spending',\n topics: [\n {\n topicKey: 'spending-widget-overview',\n },\n {\n topicKey: 'not-seeing-all-spending-categories',\n },\n {\n topicKey: 'spending-categories-seem-inaccurate',\n },\n ],\n },\n {\n flags: ['show_budgets_widget_in_master'],\n guid: 'budgets',\n icon: 'bubble_chart',\n title: 'Budgets',\n topics: [\n {\n topicKey: 'budgets-overview',\n },\n ],\n },\n {\n flags: ['show_trends_widget_in_master'],\n guid: 'trends',\n icon: 'multiline_chart',\n title: 'Trends',\n topics: [\n {\n topicKey: 'trends-overview',\n },\n ],\n },\n {\n flags: ['show_debts_widget_in_master'],\n guid: 'debts',\n icon: 'note_stack',\n title: 'Debts',\n topics: [\n {\n topicKey: 'debts-overview',\n },\n ],\n },\n {\n flags: ['show_net_worth_widget_in_master'],\n guid: 'networth',\n icon: 'elevation',\n title: 'Net Worth',\n topics: [\n {\n topicKey: 'net-worth-overview',\n },\n ],\n },\n {\n flags: ['show_goals_widget_in_master'],\n guid: 'goals',\n icon: 'trophy',\n title: 'Goals',\n topics: [\n {\n topicKey: 'goals-overview',\n },\n ],\n },\n {\n flags: ['show_cash_flow_widget_in_master'],\n guid: 'cashflow',\n icon: 'flowsheet',\n title: 'Cash Flow',\n topics: [\n {\n topicKey: 'cash-flow-overview',\n },\n ],\n },\n {\n flags: ['show_recurring_transactions_widget_in_master'],\n guid: 'recurring_transactions',\n icon: 'currency_exchange',\n title: 'Recurring Transactions',\n topics: [\n {\n label: 'Recurring Transactions Widget Overview',\n topicKey: 'overview',\n },\n ],\n },\n {\n flags: ['show_investments_widget_in_master'],\n guid: 'investments',\n icon: 'bid_landscape',\n title: 'Investments',\n topics: [\n {\n topicKey: 'investments-overview',\n },\n ],\n },\n {\n flags: ['show_notifications_widget_in_master'],\n guid: 'alerts',\n icon: 'account_balance',\n title: 'Alerts',\n topics: [\n {\n topicKey: 'notifications-overview',\n },\n ],\n },\n {\n guid: 'insights',\n icon: 'lightbulb',\n title: 'Insights',\n topics: [\n {\n topicKey: 'insights-widget-overview',\n },\n ],\n },\n {\n flags: ['display_mobile_devices_in_settings'],\n guid: 'mobile',\n icon: 'phone_iphone',\n title: 'Mobile',\n topics: [\n {\n topicKey: 'mobile-devices-overview',\n },\n ],\n },\n]\n\nexport const HELP_CONTENT = {\n accounts: {\n guid: 'accounts',\n title: 'Accounts',\n topicTitle: 'Accounts Overview',\n content: {\n section1: {\n description:\n \"FinTech Solutions is committed to revolutionizing the way individuals and businesses manage their finances. By providing an integrated platform of smart tools, we make it easier to track personal expenses, manage investments, and optimize business finances all in one place. Our innovative technology empowers users to make informed decisions, whether it's monitoring their spending, analyzing investment performance, or ensuring smooth cash flow for their business operations. With a focus on security, simplicity, and efficiency, FinTech Solutions helps users navigate the complexities of finance with confidence and clarity. Our platform is designed to be intuitive, scalable, and adaptable, allowing users to customize their financial strategies according to their unique needs, ensuring long-term growth and financial success.\",\n image: 'https://assets.mx.com/images/company/careers/value-box-bg.png',\n title: 'Revolutionizing Financial Management',\n },\n section2: {\n description:\n \"FinTech Solutions is committed to revolutionizing the way individuals and businesses manage their finances. By providing an integrated platform of smart tools, we make it easier to track personal expenses, manage investments, and optimize business finances all in one place. Our innovative technology empowers users to make informed decisions, whether it's monitoring their spending, analyzing investment performance, or ensuring smooth cash flow for their business operations. With a focus on security, simplicity, and efficiency, FinTech Solutions helps users navigate the complexities of finance with confidence and clarity.\",\n image: 'https://assets.mx.com/images/company/careers/value-box-bg.png',\n listItems: [\n 'Easily track expenses and manage personal finances.',\n 'Easily track expenses and manage personal finances.',\n 'Manage cash flow and financial operations in one platform.',\n 'Ensure your financial data is protected with industry-leading security measures',\n ],\n listTitle: 'Effortless Financial Solutions',\n subDescription:\n 'FinTech Solutions combines advanced technology with intuitive tools to make financial management easy for both individuals and businesses. Our platform offers everything from budgeting features to real-time insights, empowering users to take control of their financial future with confidence and security.',\n subTitle: 'Simplifying Financial Management',\n title: 'Empowering Financial Management',\n },\n section3: {\n description:\n 'FinTech Solutions provides the tools and insights needed to make informed financial choices. From budgeting and investment tracking to comprehensive business financial management, our platform delivers real-time data and personalized recommendations. With a focus on ease of use and security, we help users navigate the complexities of finance and achieve their financial goals with confidence.',\n image: 'https://assets.mx.com/images/company/careers/value-box-bg.png',\n listItems: [\n 'Track expenses, set budgets, and achieve savings goals.',\n 'Monitor and analyze your investments with real-time updates.',\n 'Streamline cash flow management and financial reporting.',\n 'Protect your financial data with top-tier encryption and security protocols.',\n ],\n listTitle: 'Complete Financial Tools',\n title: 'Empowering Smarter Financial Decisions',\n },\n section4: {\n description:\n \"FinTech Solutions simplifies managing your finances with powerful tools designed for both individuals and businesses. Whether you're tracking personal spending, optimizing investments, or streamlining business operations, our platform provides the insights and features you need to make confident financial decisions. With a focus on ease of use and data security, we help you stay in control of your financial future. Our innovative solutions offer real-time updates, personalized recommendations, and automated reporting, ensuring you're always in the know. Plus, with scalable features tailored to your needs, our platform grows with you, making it the ideal choice for anyone looking to take charge of their financial journey.\",\n title: 'Seamless Financial Management',\n },\n },\n },\n}\n\n// TODO: Add more keys for additional logic\nexport const HELP_BY_CATEGORY_LIST: HelpByCategoryDefinition[] = [\n {\n guid: 'personal_information',\n icon: 'person',\n topics: [\n {\n type: 'external',\n },\n {\n type: 'external',\n },\n {\n type: 'internal',\n },\n {\n type: 'external',\n },\n ],\n },\n {\n guid: 'money_movement',\n icon: 'currency_exchange',\n topics: [\n {\n type: 'external',\n },\n {\n type: 'external',\n },\n {\n type: 'external',\n },\n {\n type: 'external',\n },\n ],\n },\n {\n guid: 'institution',\n icon: 'account_balance',\n topics: [\n {\n type: 'external',\n },\n {\n type: 'other',\n },\n {\n type: 'internal',\n },\n {\n type: 'internal',\n },\n ],\n },\n {\n guid: 'transactions',\n icon: 'compare_arrows',\n topics: [\n {\n type: 'internal',\n },\n {\n type: 'external',\n },\n {\n type: 'internal',\n },\n ],\n },\n {\n guid: 'login_issues',\n icon: 'lock',\n topics: [\n { topicKey: 'not-receiving-code' },\n { topicKey: 'wrong-phone-number' },\n { topicKey: 'outdated-contact-info' },\n { topicKey: 'new-code-or-token' },\n ],\n },\n {\n guid: 'contact_your_bank',\n icon: 'call',\n topics: [],\n },\n]\n\n// TODO: Add more keys for additional logic\nexport const POPULAR_TOPICS_LIST = [\n {\n type: 'external',\n },\n {\n type: 'external',\n },\n {\n type: 'external',\n },\n {\n type: 'external',\n },\n {\n type: 'other',\n },\n {\n type: 'internal',\n },\n]\n"],"mappings":"AAEA,IAAa,IAAkB;AAAA,EAC7B;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,MACN,EACE,UAAU,gCACZ;AAAA,MACA,EACE,UAAU,gDACZ;AAAA,MACA,EACE,UAAU,8BACZ;AAAA,MACA,EACE,UAAU,mCACZ;AAAA,IACF;AAAA,EACF;AAAA,EACA;AAAA,IACE,OAAO,CAAC,gCAAgC;AAAA,IACxC,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,MACN,EACE,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R;AAAA,MACA,EACE,MAAM,WACR;AAAA,IACF;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA,MACN,EACE,MAAM,WACR;AAAA,MACA,EACE,MAAM,WACR;AAAA,MACA,EACE,MAAM,WACR;AAAA,MACA,EACE,MAAM,WACR;AAAA,IACF;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA,MACN,EACE,MAAM,WACR;AAAA,MACA,EACE,MAAM,QACR;AAAA,MACA,EACE,MAAM,WACR;AAAA,MACA,EACE,MAAM,WACR;AAAA,IACF;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA,MACN,EACE,MAAM,WACR;AAAA,MACA,EACE,MAAM,WACR;AAAA,MACA,EACE,MAAM,WACR;AAAA,IACF;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA,MACN,EAAE,UAAU,qBAAqB;AAAA,MACjC,EAAE,UAAU,qBAAqB;AAAA,MACjC,EAAE,UAAU,wBAAwB;AAAA,MACpC,EAAE,UAAU,oBAAoB;AAAA,IAClC;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,QAAQ,CAAC;AAAA,EACX;AACF,GAGa,IAAsB;AAAA,EACjC,EACE,MAAM,WACR;AAAA,EACA,EACE,MAAM,WACR;AAAA,EACA,EACE,MAAM,WACR;AAAA,EACA,EACE,MAAM,WACR;AAAA,EACA,EACE,MAAM,QACR;AAAA,EACA,EACE,MAAM,WACR;AACF"}
1
+ {"version":3,"file":"Help.es.js","names":[],"sources":["../../../src/core/constants/Help.ts"],"sourcesContent":["import type { HelpByCategoryDefinition, HelpCategoryDefinition } from '../types/Help'\n\n// Topic keys of the Login Issues articles. They are listed under General FAQs and the Login Issues\n// support card; the LoginIssues section renders them in both places.\nexport const LOGIN_ISSUE_TOPIC_KEYS = [\n 'not-receiving-code',\n 'wrong-phone-number',\n 'outdated-contact-info',\n 'new-code-or-token',\n] as const\n\nexport const isLoginIssueTopic = (topicKey: string) =>\n (LOGIN_ISSUE_TOPIC_KEYS as readonly string[]).includes(topicKey)\n\n// Topics pair with `copy.category_list[guid].topics` by position, so their order must match the\n// copy service's. A topic with `copyIndex` reads that copy label instead, so it can be shown in a\n// different order without reordering the copy.\nexport const HELP_CATEGORIES: HelpCategoryDefinition[] = [\n {\n guid: 'general',\n icon: 'info',\n title: 'General FAQs',\n topics: [\n // Login Issues articles first (rendered by the LoginIssues section); their copy labels sit\n // after the general ones, hence the explicit copyIndex.\n { topicKey: 'not-receiving-code', copyIndex: 4 },\n { topicKey: 'wrong-phone-number', copyIndex: 5 },\n { topicKey: 'outdated-contact-info', copyIndex: 6 },\n { topicKey: 'new-code-or-token', copyIndex: 7 },\n { topicKey: 'is-my-data-private-and-secure', copyIndex: 0 },\n {\n topicKey: 'why-are-some-of-my-transactions-uncategorized',\n copyIndex: 1,\n },\n { topicKey: 'why-cant-i-see-the-software', copyIndex: 2 },\n { topicKey: 'how-do-i-log-out-of-the-software', copyIndex: 3 },\n ],\n },\n {\n flags: ['show_accounts_widget_in_master'],\n guid: 'accounts',\n icon: 'account_balance',\n title: 'Accounts',\n topics: [\n {\n topicKey: 'accounts-overview',\n },\n {\n topicKey: 'trouble-adding-an-account',\n },\n {\n topicKey: 'need-to-fix-a-broken-account',\n },\n {\n topicKey: 'seeing-outdated-accounts-or-paid-off-loans',\n },\n {\n topicKey: 'seeing-duplicate-accounts',\n },\n ],\n },\n {\n flags: ['show_transactions_widget_in_master'],\n guid: 'transactions',\n icon: 'receipt_long',\n title: 'Transactions',\n topics: [\n {\n topicKey: 'transactions-overview',\n },\n {\n topicKey: 'seeing-duplicate-transactions',\n },\n {\n topicKey: 'missing-transactions',\n },\n {\n topicKey: 'pending-transactions',\n },\n {\n topicKey: 'exporting-transactions',\n },\n ],\n },\n {\n flags: ['show_spending_widget_in_master'],\n guid: 'spending',\n icon: 'donut_small',\n title: 'Spending',\n topics: [\n {\n topicKey: 'spending-widget-overview',\n },\n {\n topicKey: 'not-seeing-all-spending-categories',\n },\n {\n topicKey: 'spending-categories-seem-inaccurate',\n },\n ],\n },\n {\n flags: ['show_budgets_widget_in_master'],\n guid: 'budgets',\n icon: 'bubble_chart',\n title: 'Budgets',\n topics: [\n {\n topicKey: 'budgets-overview',\n },\n ],\n },\n {\n flags: ['show_trends_widget_in_master'],\n guid: 'trends',\n icon: 'multiline_chart',\n title: 'Trends',\n topics: [\n {\n topicKey: 'trends-overview',\n },\n ],\n },\n {\n flags: ['show_debts_widget_in_master'],\n guid: 'debts',\n icon: 'note_stack',\n title: 'Debts',\n topics: [\n {\n topicKey: 'debts-overview',\n },\n ],\n },\n {\n flags: ['show_net_worth_widget_in_master'],\n guid: 'networth',\n icon: 'elevation',\n title: 'Net Worth',\n topics: [\n {\n topicKey: 'net-worth-overview',\n },\n ],\n },\n {\n flags: ['show_goals_widget_in_master'],\n guid: 'goals',\n icon: 'trophy',\n title: 'Goals',\n topics: [\n {\n topicKey: 'goals-overview',\n },\n ],\n },\n {\n flags: ['show_cash_flow_widget_in_master'],\n guid: 'cashflow',\n icon: 'flowsheet',\n title: 'Cash Flow',\n topics: [\n {\n topicKey: 'cash-flow-overview',\n },\n ],\n },\n {\n flags: ['show_recurring_transactions_widget_in_master'],\n guid: 'recurring_transactions',\n icon: 'currency_exchange',\n title: 'Recurring Transactions',\n topics: [\n {\n topicKey: 'overview',\n },\n ],\n },\n {\n flags: ['show_investments_widget_in_master'],\n guid: 'investments',\n icon: 'bid_landscape',\n title: 'Investments',\n topics: [\n {\n topicKey: 'investments-overview',\n },\n ],\n },\n {\n flags: ['show_notifications_widget_in_master'],\n guid: 'alerts',\n icon: 'account_balance',\n title: 'Alerts',\n topics: [\n {\n topicKey: 'notifications-overview',\n },\n ],\n },\n {\n guid: 'insights',\n icon: 'lightbulb',\n title: 'Insights',\n topics: [\n {\n topicKey: 'insights-widget-overview',\n },\n ],\n },\n {\n flags: ['display_mobile_devices_in_settings'],\n guid: 'mobile',\n icon: 'phone_iphone',\n title: 'Mobile',\n topics: [\n {\n topicKey: 'mobile-devices-overview',\n },\n ],\n },\n]\n\nexport const HELP_CONTENT = {\n accounts: {\n guid: 'accounts',\n title: 'Accounts',\n topicTitle: 'Accounts Overview',\n content: {\n section1: {\n description:\n \"FinTech Solutions is committed to revolutionizing the way individuals and businesses manage their finances. By providing an integrated platform of smart tools, we make it easier to track personal expenses, manage investments, and optimize business finances all in one place. Our innovative technology empowers users to make informed decisions, whether it's monitoring their spending, analyzing investment performance, or ensuring smooth cash flow for their business operations. With a focus on security, simplicity, and efficiency, FinTech Solutions helps users navigate the complexities of finance with confidence and clarity. Our platform is designed to be intuitive, scalable, and adaptable, allowing users to customize their financial strategies according to their unique needs, ensuring long-term growth and financial success.\",\n image: 'https://assets.mx.com/images/company/careers/value-box-bg.png',\n title: 'Revolutionizing Financial Management',\n },\n section2: {\n description:\n \"FinTech Solutions is committed to revolutionizing the way individuals and businesses manage their finances. By providing an integrated platform of smart tools, we make it easier to track personal expenses, manage investments, and optimize business finances all in one place. Our innovative technology empowers users to make informed decisions, whether it's monitoring their spending, analyzing investment performance, or ensuring smooth cash flow for their business operations. With a focus on security, simplicity, and efficiency, FinTech Solutions helps users navigate the complexities of finance with confidence and clarity.\",\n image: 'https://assets.mx.com/images/company/careers/value-box-bg.png',\n listItems: [\n 'Easily track expenses and manage personal finances.',\n 'Easily track expenses and manage personal finances.',\n 'Manage cash flow and financial operations in one platform.',\n 'Ensure your financial data is protected with industry-leading security measures',\n ],\n listTitle: 'Effortless Financial Solutions',\n subDescription:\n 'FinTech Solutions combines advanced technology with intuitive tools to make financial management easy for both individuals and businesses. Our platform offers everything from budgeting features to real-time insights, empowering users to take control of their financial future with confidence and security.',\n subTitle: 'Simplifying Financial Management',\n title: 'Empowering Financial Management',\n },\n section3: {\n description:\n 'FinTech Solutions provides the tools and insights needed to make informed financial choices. From budgeting and investment tracking to comprehensive business financial management, our platform delivers real-time data and personalized recommendations. With a focus on ease of use and security, we help users navigate the complexities of finance and achieve their financial goals with confidence.',\n image: 'https://assets.mx.com/images/company/careers/value-box-bg.png',\n listItems: [\n 'Track expenses, set budgets, and achieve savings goals.',\n 'Monitor and analyze your investments with real-time updates.',\n 'Streamline cash flow management and financial reporting.',\n 'Protect your financial data with top-tier encryption and security protocols.',\n ],\n listTitle: 'Complete Financial Tools',\n title: 'Empowering Smarter Financial Decisions',\n },\n section4: {\n description:\n \"FinTech Solutions simplifies managing your finances with powerful tools designed for both individuals and businesses. Whether you're tracking personal spending, optimizing investments, or streamlining business operations, our platform provides the insights and features you need to make confident financial decisions. With a focus on ease of use and data security, we help you stay in control of your financial future. Our innovative solutions offer real-time updates, personalized recommendations, and automated reporting, ensuring you're always in the know. Plus, with scalable features tailored to your needs, our platform grows with you, making it the ideal choice for anyone looking to take charge of their financial journey.\",\n title: 'Seamless Financial Management',\n },\n },\n },\n}\n\n// TODO: Add more keys for additional logic\n// Topics pair with `copy.help_by_category_list[guid].topics` by position, so their order must match\n// the copy service's.\nexport const HELP_BY_CATEGORY_LIST: HelpByCategoryDefinition[] = [\n {\n guid: 'personal_information',\n icon: 'person',\n topics: [\n {\n type: 'external',\n },\n {\n type: 'external',\n },\n {\n type: 'internal',\n },\n {\n type: 'external',\n },\n ],\n },\n {\n guid: 'money_movement',\n icon: 'currency_exchange',\n topics: [\n {\n type: 'external',\n },\n {\n type: 'external',\n },\n {\n type: 'external',\n },\n {\n type: 'external',\n },\n ],\n },\n {\n guid: 'institution',\n icon: 'account_balance',\n // Login Issues is its own card (articles), so it is no longer a ticket row here.\n topics: [\n {\n type: 'external',\n },\n {\n type: 'other',\n },\n {\n type: 'internal',\n },\n ],\n },\n {\n guid: 'transactions',\n icon: 'compare_arrows',\n topics: [\n {\n type: 'internal',\n },\n {\n type: 'external',\n },\n {\n type: 'internal',\n },\n ],\n },\n {\n guid: 'login_issues',\n icon: 'lock',\n topics: [\n { topicKey: 'not-receiving-code' },\n { topicKey: 'wrong-phone-number' },\n { topicKey: 'outdated-contact-info' },\n { topicKey: 'new-code-or-token' },\n ],\n },\n {\n guid: 'contact_your_bank',\n icon: 'call',\n topics: [],\n },\n]\n\n// TODO: Add more keys for additional logic\nexport const POPULAR_TOPICS_LIST = [\n {\n type: 'external',\n },\n {\n type: 'external',\n },\n {\n type: 'external',\n },\n {\n type: 'external',\n },\n {\n type: 'other',\n },\n {\n type: 'internal',\n },\n]\n"],"mappings":"AAIA,IAAa,IAAyB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEa,IAAA,CAAqB,MAC/B,EAA6C,SAAS,CAAQ,GAKpD,IAA4C;AAAA,EACvD;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,MAGN;AAAA,QAAE,UAAU;AAAA,QAAsB,WAAW;AAAA,MAAE;AAAA,MAC/C;AAAA,QAAE,UAAU;AAAA,QAAsB,WAAW;AAAA,MAAE;AAAA,MAC/C;AAAA,QAAE,UAAU;AAAA,QAAyB,WAAW;AAAA,MAAE;AAAA,MAClD;AAAA,QAAE,UAAU;AAAA,QAAqB,WAAW;AAAA,MAAE;AAAA,MAC9C;AAAA,QAAE,UAAU;AAAA,QAAiC,WAAW;AAAA,MAAE;AAAA,MAC1D;AAAA,QACE,UAAU;AAAA,QACV,WAAW;AAAA,MACb;AAAA,MACA;AAAA,QAAE,UAAU;AAAA,QAA+B,WAAW;AAAA,MAAE;AAAA,MACxD;AAAA,QAAE,UAAU;AAAA,QAAoC,WAAW;AAAA,MAAE;AAAA,IAC/D;AAAA,EACF;AAAA,EACA;AAAA,IACE,OAAO,CAAC,gCAAgC;AAAA,IACxC,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,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AAM,WACR;AAAA,IACF;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA,MACN,EACE,MAAM,WACR;AAAA,MACA,EACE,MAAM,WACR;AAAA,MACA,EACE,MAAM,WACR;AAAA,MACA,EACE,MAAM,WACR;AAAA,IACF;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IAEN,QAAQ;AAAA,MACN,EACE,MAAM,WACR;AAAA,MACA,EACE,MAAM,QACR;AAAA,MACA,EACE,MAAM,WACR;AAAA,IACF;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA,MACN,EACE,MAAM,WACR;AAAA,MACA,EACE,MAAM,WACR;AAAA,MACA,EACE,MAAM,WACR;AAAA,IACF;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA,MACN,EAAE,UAAU,qBAAqB;AAAA,MACjC,EAAE,UAAU,qBAAqB;AAAA,MACjC,EAAE,UAAU,wBAAwB;AAAA,MACpC,EAAE,UAAU,oBAAoB;AAAA,IAClC;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,QAAQ,CAAC;AAAA,EACX;AACF,GAGa,IAAsB;AAAA,EACjC,EACE,MAAM,WACR;AAAA,EACA,EACE,MAAM,WACR;AAAA,EACA,EACE,MAAM,WACR;AAAA,EACA,EACE,MAAM,WACR;AAAA,EACA,EACE,MAAM,QACR;AAAA,EACA,EACE,MAAM,WACR;AACF"}
@@ -14,6 +14,13 @@ export interface HelpCategory {
14
14
  title: string;
15
15
  topics: HelpTopic[];
16
16
  }
17
+ export interface HelpCategoryDefinition {
18
+ flags?: string[];
19
+ guid: string;
20
+ icon: string;
21
+ title: string;
22
+ topics: HelpTopicDefinition[];
23
+ }
17
24
  export interface HelpByCategoryDefinition {
18
25
  guid: keyof HelpByCategoryList;
19
26
  icon: string;
@@ -34,6 +41,10 @@ export interface HelpTopic {
34
41
  label: string;
35
42
  topicKey: string;
36
43
  }
44
+ export interface HelpTopicDefinition {
45
+ copyIndex?: number;
46
+ topicKey: string;
47
+ }
37
48
  export type HelpType = 'external' | 'internal' | 'other' | undefined;
38
49
  export interface ImageContentProps {
39
50
  altImage: string;
@@ -71,6 +82,8 @@ export interface Ticket {
71
82
  title: string;
72
83
  }
73
84
  export interface ListProps {
85
+ /** Space between items in px, so multi-line steps stay visibly separate. Defaults to none. */
86
+ itemGap?: number;
74
87
  items: string[] | React.ReactNode[];
75
88
  subItemPlacement?: number;
76
89
  subItems?: string[] | React.ReactNode[];
@@ -32,6 +32,7 @@ export interface TransactionsCopy {
32
32
  including_transaction: string;
33
33
  is_excluded: string;
34
34
  is_flagged: string;
35
+ is_unviewed: string;
35
36
  manual_transaction_credit_button_label: string;
36
37
  manual_transaction_credit_button_tooltip: string;
37
38
  manual_transaction_debit_button_label: string;
@@ -1,26 +1,26 @@
1
- import { HELP_CATEGORIES as f } from "../constants/Help.es.js";
2
- var u = (e, i) => e.guid === "general" || e.guid === "insights" ? !0 : e.flags ? e.flags.every((t) => i[t]) : !1, g = (e, i) => {
1
+ import { HELP_CATEGORIES as u } from "../constants/Help.es.js";
2
+ var p = (e, i) => e.guid === "general" || e.guid === "insights" ? !0 : e.flags ? e.flags.every((t) => i[t]) : !1, d = (e, i) => {
3
3
  const t = [];
4
- for (const s of f) {
4
+ for (const s of u) {
5
5
  const r = i[s.guid];
6
6
  if (!r) continue;
7
7
  const n = r.topics ?? {}, o = {
8
8
  ...s,
9
9
  title: r.label,
10
- topics: s.topics.flatMap(({ topicKey: a }, c) => {
11
- const l = n[c];
10
+ topics: s.topics.flatMap(({ topicKey: a, copyIndex: c }, f) => {
11
+ const l = n[c ?? f];
12
12
  return l === void 0 ? [] : [{
13
13
  topicKey: a,
14
14
  label: l
15
15
  }];
16
16
  })
17
17
  };
18
- u(o, e) && t.push(o);
18
+ p(o, e) && t.push(o);
19
19
  }
20
20
  return t;
21
21
  };
22
22
  export {
23
- g as HelpUtil
23
+ d as HelpUtil
24
24
  };
25
25
 
26
26
  //# sourceMappingURL=HelpUtil.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HelpUtil.es.js","names":[],"sources":["../../../src/core/utils/HelpUtil.ts"],"sourcesContent":["import type { HelpCategory, Profile } from '../types/Help'\nimport { CategoryList } from '../types/localization/HelpCopy'\nimport { HELP_CATEGORIES } from '../constants/Help'\n\nconst isCategoryAccessibleByProfile = (category: HelpCategory, profile: Profile): boolean => {\n if (category.guid === 'general' || category.guid === 'insights') return true\n if (!category.flags) return false\n return category.flags.every((flag) => profile[flag as keyof Profile])\n}\n\nexport const HelpUtil = (profile: Profile, categoryList: CategoryList): HelpCategory[] => {\n const accessibleCategories: HelpCategory[] = []\n\n for (const el of HELP_CATEGORIES) {\n const category = categoryList[el.guid as keyof CategoryList]\n if (!category) continue\n\n const topicLabels = category.topics ?? {}\n const updatedCategory = {\n ...el,\n title: category.label,\n // A definition entry whose copy is missing would otherwise produce a\n // focusable row with no name, so drop it.\n topics: el.topics.flatMap(({ topicKey }, index) => {\n const label = topicLabels[index]\n return label === undefined ? [] : [{ topicKey, label }]\n }),\n }\n if (isCategoryAccessibleByProfile(updatedCategory, profile))\n accessibleCategories.push(updatedCategory)\n }\n\n return accessibleCategories\n}\n"],"mappings":";AAIA,IAAM,IAAA,CAAiC,GAAwB,MACzD,EAAS,SAAS,aAAa,EAAS,SAAS,aAAmB,KACnE,EAAS,QACP,EAAS,MAAM,MAAA,CAAO,MAAS,EAAQ,CAAA,CAAsB,IADxC,IAIjB,IAAA,CAAY,GAAkB,MAA+C;AACxF,QAAM,IAAuC,CAAC;AAE9C,aAAW,KAAM,GAAiB;AAChC,UAAM,IAAW,EAAa,EAAG,IAAA;AACjC,QAAI,CAAC,EAAU;AAEf,UAAM,IAAc,EAAS,UAAU,CAAC,GAClC,IAAkB;AAAA,MACtB,GAAG;AAAA,MACH,OAAO,EAAS;AAAA,MAGhB,QAAQ,EAAG,OAAO,QAAA,CAAS,EAAE,UAAA,EAAA,GAAY,MAAU;AACjD,cAAM,IAAQ,EAAY,CAAA;AAC1B,eAAO,MAAU,SAAY,CAAC,IAAI,CAAC;AAAA,UAAE,UAAA;AAAA,UAAU,OAAA;AAAA,QAAM,CAAC;AAAA,MACxD,CAAC;AAAA,IACH;AACA,IAAI,EAA8B,GAAiB,CAAO,KACxD,EAAqB,KAAK,CAAe;AAAA,EAC7C;AAEA,SAAO;AACT"}
1
+ {"version":3,"file":"HelpUtil.es.js","names":[],"sources":["../../../src/core/utils/HelpUtil.ts"],"sourcesContent":["import type { HelpCategory, Profile } from '../types/Help'\nimport { CategoryList } from '../types/localization/HelpCopy'\nimport { HELP_CATEGORIES } from '../constants/Help'\n\nconst isCategoryAccessibleByProfile = (category: HelpCategory, profile: Profile): boolean => {\n if (category.guid === 'general' || category.guid === 'insights') return true\n if (!category.flags) return false\n return category.flags.every((flag) => profile[flag as keyof Profile])\n}\n\nexport const HelpUtil = (profile: Profile, categoryList: CategoryList): HelpCategory[] => {\n const accessibleCategories: HelpCategory[] = []\n\n for (const el of HELP_CATEGORIES) {\n const category = categoryList[el.guid as keyof CategoryList]\n if (!category) continue\n\n const topicLabels = category.topics ?? {}\n const updatedCategory = {\n ...el,\n title: category.label,\n // A definition entry whose copy is missing would otherwise produce a\n // focusable row with no name, so drop it.\n topics: el.topics.flatMap(({ topicKey, copyIndex }, index) => {\n const label = topicLabels[copyIndex ?? index]\n return label === undefined ? [] : [{ topicKey, label }]\n }),\n }\n if (isCategoryAccessibleByProfile(updatedCategory, profile))\n accessibleCategories.push(updatedCategory)\n }\n\n return accessibleCategories\n}\n"],"mappings":";AAIA,IAAM,IAAA,CAAiC,GAAwB,MACzD,EAAS,SAAS,aAAa,EAAS,SAAS,aAAmB,KACnE,EAAS,QACP,EAAS,MAAM,MAAA,CAAO,MAAS,EAAQ,CAAA,CAAsB,IADxC,IAIjB,IAAA,CAAY,GAAkB,MAA+C;AACxF,QAAM,IAAuC,CAAC;AAE9C,aAAW,KAAM,GAAiB;AAChC,UAAM,IAAW,EAAa,EAAG,IAAA;AACjC,QAAI,CAAC,EAAU;AAEf,UAAM,IAAc,EAAS,UAAU,CAAC,GAClC,IAAkB;AAAA,MACtB,GAAG;AAAA,MACH,OAAO,EAAS;AAAA,MAGhB,QAAQ,EAAG,OAAO,QAAA,CAAS,EAAE,UAAA,GAAU,WAAA,EAAA,GAAa,MAAU;AAC5D,cAAM,IAAQ,EAAY,KAAa,CAAA;AACvC,eAAO,MAAU,SAAY,CAAC,IAAI,CAAC;AAAA,UAAE,UAAA;AAAA,UAAU,OAAA;AAAA,QAAM,CAAC;AAAA,MACxD,CAAC;AAAA,IACH;AACA,IAAI,EAA8B,GAAiB,CAAO,KACxD,EAAqB,KAAK,CAAe;AAAA,EAC7C;AAEA,SAAO;AACT"}
@@ -1,6 +1,7 @@
1
1
  import { TransactionStatus, TransactionType, Category, CategoryCopy, DetailedAccount, Tag, Tagging, Transaction } from '../types';
2
2
  import { TransactionFilter } from '../stores/TransactionStore';
3
3
  export declare const isTransferTransaction: (transaction: Pick<Transaction, "top_level_category_guid">) => boolean;
4
+ export declare const isUnviewedTransaction: (transaction: Pick<Transaction, "has_been_viewed" | "parent_guid">) => boolean;
4
5
  export declare const buildDetailedTransactions: (transactions: Transaction[], accounts: DetailedAccount[], categories: Category[], taggings: Tagging[] | undefined, categoryCopy: CategoryCopy) => {
5
6
  account: string;
6
7
  accountIsClosed: boolean;
@@ -1,16 +1,16 @@
1
1
  import { CategoryGuidToName as y, CategoryGuids as T } from "../constants/Category.es.js";
2
2
  import { DATE_FORMATS_INTL as m, formatDate as f } from "../constants/DateFormats.es.js";
3
- import { TransactionStatus as C, TransactionType as v } from "../types/Transaction.es.js";
3
+ import { TransactionStatus as v, TransactionType as C } from "../types/Transaction.es.js";
4
4
  import { endOfUtcDay as A, fromUnixUTC as h, startOfUtcDay as O } from "./DateUtil.es.js";
5
- import { formatCurrency as D } from "./NumberFormatting.es.js";
6
- import { getLocalizedCategoryName as E } from "./CategoryUtil.es.js";
7
- import { TABLE_CONST as S } from "../constants/Table.es.js";
5
+ import { formatCurrency as b } from "./NumberFormatting.es.js";
6
+ import { getLocalizedCategoryName as D } from "./CategoryUtil.es.js";
7
+ import { TABLE_CONST as E } from "../constants/Table.es.js";
8
8
  import { COLUMN_NAMES as _ } from "../constants/Transaction.es.js";
9
- import { format as b } from "date-fns/format";
9
+ import { format as S } from "date-fns/format";
10
10
  import { startOfMonth as N } from "date-fns/startOfMonth";
11
11
  import { startOfToday as M } from "date-fns/startOfToday";
12
12
  import { endOfToday as U } from "date-fns/endOfToday";
13
- var X = (t) => t.top_level_category_guid === T.TRANSFER, ee = (t, r, n, d = [], i) => {
13
+ var X = (t) => t.top_level_category_guid === T.TRANSFER, ee = (t) => !t.has_been_viewed && !t.parent_guid, te = (t, r, n, d = [], i) => {
14
14
  const c = r.reduce((e, s) => ({
15
15
  ...e,
16
16
  [s.guid]: s
@@ -36,16 +36,16 @@ var X = (t) => t.top_level_category_guid === T.TRANSFER, ee = (t, r, n, d = [],
36
36
  account: s?.user_name || "Unknown",
37
37
  accountIsClosed: s?.is_closed,
38
38
  accountIsHidden: s?.is_hidden,
39
- category: u ? E(u, i) : "Uncategorized",
39
+ category: u ? D(u, i) : "Uncategorized",
40
40
  institutionName: s?.institution?.name || s?.institutionName || void 0,
41
41
  isIncome: e.top_level_category_guid === T.INCOME,
42
- isPending: e.feed_status === C.PENDING,
42
+ isPending: e.feed_status === v.PENDING,
43
43
  number: s?.account_number || "",
44
44
  payee: e.description,
45
45
  tags: g
46
46
  };
47
47
  });
48
- }, L = "uncategorized", te = (t, r, n, d, i, c) => {
48
+ }, L = "uncategorized", re = (t, r, n, d, i, c) => {
49
49
  const o = R(t, i, c), a = I(o, n, d);
50
50
  return r.forEach((e) => {
51
51
  const s = a.findIndex((g) => g.guid === e), u = c.filter((g) => g.parent_guid === e);
@@ -60,12 +60,12 @@ var X = (t) => t.top_level_category_guid === T.TRANSFER, ee = (t, r, n, d = [],
60
60
  if (o === L && e.has_been_split) return !1;
61
61
  if (/^spl/i.test(o) && (e.has_been_split || e.parent_guid)) return !0;
62
62
  const s = e.tags.some((g) => p(o, r.find((l) => l.guid === g)?.name)), u = h(e.date);
63
- return p(o, e.payee) || p(o, e.feed_description) || p(o, e.category) || p(o, f(u, m.MONTH)) || p(o, f(u, m.DAY)) || p(o, f(u, m.FULL_MONTH_DAY)) || p(o, f(u, m.MONTH_DAY_YEAR)) || p(o, b(u, "do")) || p(o, e.account) || p(o, D(e.amount, "0,0.00")) || p(o, e.memo) || s;
63
+ return p(o, e.payee) || p(o, e.feed_description) || p(o, e.category) || p(o, f(u, m.MONTH)) || p(o, f(u, m.DAY)) || p(o, f(u, m.FULL_MONTH_DAY)) || p(o, f(u, m.MONTH_DAY_YEAR)) || p(o, S(u, "do")) || p(o, e.account) || p(o, b(e.amount, "0,0.00")) || p(o, e.memo) || s;
64
64
  });
65
65
  }, I = (t, r, n) => [...t].sort((d, i) => {
66
66
  const c = r, o = (d[c] || "") > (i[c] || "");
67
67
  let a = o ? -1 : 1, e = o ? 1 : -1;
68
- return (r === _.DATE || r === _.AMOUNT) && (a = o ? 1 : -1, e = o ? -1 : 1), n === S.ASC ? a : e;
68
+ return (r === _.DATE || r === _.AMOUNT) && (a = o ? 1 : -1, e = o ? -1 : 1), n === E.ASC ? a : e;
69
69
  }), p = (t, r) => {
70
70
  const n = t.toLowerCase().split(" "), d = r?.toString().toLowerCase() ?? "";
71
71
  return n.every((i) => d.indexOf(i) > -1);
@@ -76,14 +76,14 @@ function w(t) {
76
76
  function j(t) {
77
77
  return t.reduce((r, n) => (n.parent_guid && (r[n.parent_guid] || (r[n.parent_guid] = []), r[n.parent_guid].push(n)), r), {});
78
78
  }
79
- function re(t, r) {
79
+ function ne(t, r) {
80
80
  const n = w(r), d = j(r), i = /* @__PURE__ */ new Set(), c = [];
81
81
  for (const o of t) n.has(o.guid) ? (d[o.guid] ?? []).slice().sort((a, e) => Math.abs(e.amount) - Math.abs(a.amount)).forEach((a) => {
82
82
  i.has(a.guid) || (c.push(a), i.add(a.guid));
83
83
  }) : i.has(o.guid) || (c.push(o), i.add(o.guid));
84
84
  return c;
85
85
  }
86
- var ne = (t, r) => {
86
+ var oe = (t, r) => {
87
87
  const n = F(G(t, r)), d = new Blob([n], { type: "text/csv;charset=utf-8;" }), i = document.createElement("a");
88
88
  i.href = URL.createObjectURL(d), i.setAttribute("download", "transactions.csv"), document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(i.href);
89
89
  }, G = (t, r) => t.map((n) => ({
@@ -91,7 +91,7 @@ var ne = (t, r) => {
91
91
  Description: B(n),
92
92
  "Original Description": n.feed_description,
93
93
  Amount: `${n.amount}`,
94
- Type: n.transaction_type === v.CREDIT ? "Credit" : "Debit",
94
+ Type: n.transaction_type === C.CREDIT ? "Credit" : "Debit",
95
95
  "Parent Category": y[n.top_level_category_guid || ""],
96
96
  Category: n.category,
97
97
  Account: n.account,
@@ -105,11 +105,12 @@ var ne = (t, r) => {
105
105
  return r += t.is_hidden ? "(Excluded) " : "", r += t.description, r;
106
106
  }, Y = (t, r) => t.tags.map((n) => r.filter((d) => d.guid === n)[0]?.name ?? "").join(" ");
107
107
  export {
108
- ee as buildDetailedTransactions,
109
- ne as exportTransactionsToCSV,
110
- re as flattenTransactionsWithSplits,
108
+ te as buildDetailedTransactions,
109
+ oe as exportTransactionsToCSV,
110
+ ne as flattenTransactionsWithSplits,
111
111
  X as isTransferTransaction,
112
- te as sortAndFilterTransactions
112
+ ee as isUnviewedTransaction,
113
+ re as sortAndFilterTransactions
113
114
  };
114
115
 
115
116
  //# sourceMappingURL=TransactionUtils.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TransactionUtils.es.js","names":[],"sources":["../../../src/core/utils/TransactionUtils.ts"],"sourcesContent":["import { endOfToday } from 'date-fns/endOfToday'\nimport { format } from 'date-fns/format'\nimport { startOfMonth } from 'date-fns/startOfMonth'\nimport { startOfToday } from 'date-fns/startOfToday'\n\nimport { TABLE_CONST } from '../constants/Table'\nimport {\n CategoryGuids,\n CategoryGuidToName,\n DATE_FORMATS_INTL,\n formatDate,\n ORDINAL_DATE_FORMAT,\n} from '../constants'\nimport { COLUMN_NAMES } from '../constants/Transaction'\nimport { TransactionStatus, TransactionType } from '../types'\nimport type { Category, CategoryCopy, DetailedAccount, Tag, Tagging, Transaction } from '../types'\n\nimport { type TransactionFilter } from '../stores/TransactionStore'\n\nimport { getLocalizedCategoryName } from './CategoryUtil'\nimport { endOfUtcDay, fromUnixUTC, startOfUtcDay } from './DateUtil'\nimport { formatCurrency } from './NumberFormatting'\n\ninterface AccountsMap {\n [key: string]: DetailedAccount\n}\n\n// True for account-to-account transfers (top-level Transfer category). Used to\n// swap the payee/description for the institution name in the transaction detail\n// header, the table Payee column, and the mobile list.\nexport const isTransferTransaction = (\n transaction: Pick<Transaction, 'top_level_category_guid'>,\n): boolean => transaction.top_level_category_guid === CategoryGuids.TRANSFER\n\ninterface CategoriesMap {\n [key: string]: Category\n}\n\ninterface TaggingsMap {\n [key: string]: string[]\n}\n\nexport const buildDetailedTransactions = (\n transactions: Transaction[],\n accounts: DetailedAccount[],\n categories: Category[],\n taggings: Tagging[] = [],\n categoryCopy: CategoryCopy,\n) => {\n const accountsMap = accounts.reduce((acc: AccountsMap, account: DetailedAccount) => {\n return { ...acc, [account.guid]: account }\n }, {})\n\n const categoriesMap = categories.reduce((acc: CategoriesMap, category: Category) => {\n return { ...acc, [category.guid]: category }\n }, {})\n\n const taggingsMap = taggings.reduce((acc: TaggingsMap, tagging: Tagging) => {\n const { transaction_guid, tag_guid } = tagging\n\n if (!acc[transaction_guid]) {\n return {\n ...acc,\n [transaction_guid]: [tag_guid],\n }\n }\n const tags = [...acc[transaction_guid], tag_guid] as string[]\n\n return {\n ...acc,\n [transaction_guid]: tags,\n }\n }, {})\n\n return transactions.map((transaction: Transaction) => {\n const account = accountsMap[transaction.account_guid]\n const category = transaction.category_guid ? categoriesMap[transaction.category_guid] : null\n const tags = taggingsMap[transaction.guid] ?? []\n\n return {\n ...transaction,\n account: account?.user_name || 'Unknown',\n accountIsClosed: account?.is_closed,\n accountIsHidden: account?.is_hidden,\n category: category ? getLocalizedCategoryName(category, categoryCopy) : 'Uncategorized',\n institutionName: account?.institution?.name || account?.institutionName || undefined,\n isIncome: transaction.top_level_category_guid === CategoryGuids.INCOME,\n isPending: transaction.feed_status === TransactionStatus.PENDING,\n number: account?.account_number || '',\n payee: transaction.description,\n tags,\n }\n })\n}\n\nconst UNCATEGORIZED_TERM = 'uncategorized'\n\nexport const sortAndFilterTransactions = (\n filter: TransactionFilter,\n expandedSplits: string[],\n sortColumn: string,\n sortDirection: string,\n tags: Tag[],\n transactions: Transaction[],\n) => {\n const filteredTransactions = filterTransactions(filter, tags, transactions)\n\n const sortedTransactions = sortTransactions(filteredTransactions, sortColumn, sortDirection)\n\n expandedSplits.forEach((guid) => {\n const index = sortedTransactions.findIndex((t) => t.guid === guid)\n const children = transactions.filter((t) => t.parent_guid === guid)\n sortedTransactions.splice(index + 1, 0, ...children)\n })\n return sortedTransactions\n}\n\nconst filterTransactions = (\n filter: TransactionFilter,\n tags: Tag[],\n transactions: Transaction[],\n) => {\n const {\n accounts = [],\n dateRange = { start: startOfMonth(startOfToday()), end: endOfToday() },\n custom = () => true,\n searchTerm: searchFilter = '',\n showSplits = false,\n } = filter\n\n return (\n transactions\n // Filters out parent of split transactions when showSplits is true and filters out split\n // transaction children when showSplits is false\n .filter((t) => (showSplits ? !t.has_been_split : !t.parent_guid))\n // Filter for selected accounts\n .filter((t) => Boolean(accounts.find((guid) => guid === t.account_guid)))\n // Date range on the UTC calendar day, the same day the Date cell, CSV export\n // and category totals use. Local-midnight bounds put a midnight-UTC row near\n // a month boundary in a different month than the chart. (MEW-4191)\n .filter(\n (t) => t.date >= startOfUtcDay(dateRange.start) && t.date <= endOfUtcDay(dateRange.end),\n )\n // Custom filter\n .filter(custom)\n // Search filter\n .filter((transaction) => {\n // Don't return uncategorized split transactions\n if (searchFilter === UNCATEGORIZED_TERM && transaction.has_been_split) {\n return false\n }\n\n // Split check - When searching for \"Splits\" and transaction is a split or is a parent of a split(s)\n const splitPattern = /^spl/i\n if (\n splitPattern.test(searchFilter) &&\n (transaction.has_been_split || Boolean(transaction.parent_guid))\n ) {\n return true\n }\n\n // Check transactions tags\n const isTagIncludedInSearch = transaction.tags.some((guid) =>\n isIncludedInSearch(searchFilter, tags.find((tag) => tag.guid === guid)?.name),\n )\n const date = fromUnixUTC(transaction.date)\n return (\n isIncludedInSearch(searchFilter, transaction.payee) ||\n isIncludedInSearch(searchFilter, transaction.feed_description) ||\n isIncludedInSearch(searchFilter, transaction.category) ||\n isIncludedInSearch(searchFilter, formatDate(date, DATE_FORMATS_INTL.MONTH)) ||\n isIncludedInSearch(searchFilter, formatDate(date, DATE_FORMATS_INTL.DAY)) ||\n isIncludedInSearch(searchFilter, formatDate(date, DATE_FORMATS_INTL.FULL_MONTH_DAY)) ||\n isIncludedInSearch(searchFilter, formatDate(date, DATE_FORMATS_INTL.MONTH_DAY_YEAR)) ||\n isIncludedInSearch(searchFilter, format(date, ORDINAL_DATE_FORMAT)) ||\n isIncludedInSearch(searchFilter, transaction.account) ||\n isIncludedInSearch(searchFilter, formatCurrency(transaction.amount, '0,0.00')) ||\n isIncludedInSearch(searchFilter, transaction.memo) ||\n isTagIncludedInSearch\n )\n })\n )\n}\n\nconst sortTransactions = (\n transactions: Transaction[],\n sortColumn: string,\n sortDirection: string,\n) => {\n return [...transactions].sort((a: Transaction, b: Transaction) => {\n const column = sortColumn as keyof Transaction\n const sortCompare = (a[column] || '') > (b[column] || '')\n\n let sortASC = sortCompare ? -1 : 1\n let sortDESC = sortCompare ? 1 : -1\n\n if (sortColumn === COLUMN_NAMES.DATE || sortColumn === COLUMN_NAMES.AMOUNT) {\n sortASC = sortCompare ? 1 : -1\n sortDESC = sortCompare ? -1 : 1\n }\n\n return sortDirection === TABLE_CONST.ASC ? sortASC : sortDESC\n })\n}\n\n/**\n * Determines if a value is included within the terms set in the search bar\n */\nconst isIncludedInSearch = (searchFilter: string, value: string | null | undefined) => {\n const lowerCasedTerms = searchFilter.toLowerCase().split(' ')\n const lowerCasedValue = value?.toString().toLowerCase() ?? ''\n\n return lowerCasedTerms.every((filter) => lowerCasedValue.indexOf(filter) > -1)\n}\n\n// TODO: Change the way formatting data is exported in order to handle localization\ntype FormattedTransaction = {\n Date: string\n Description: string\n 'Original Description': string\n Amount: string\n Type: string\n 'Parent Category': string\n Category: string\n Account: string\n Tags: string\n Memo: string\n Pending: string\n}\n\n/**\n * Collects the GUIDs of all transactions that act as parents\n * to one or more split (child) transactions.\n */\nfunction extractParentTransactionGuids(transactions: Transaction[]): Set<string> {\n return new Set(\n transactions.filter((tx) => tx.parent_guid !== undefined).map((tx) => tx.parent_guid!),\n )\n}\n\n/**\n * Organizes child transactions by their parent transaction GUID.\n * Returns a map from parent GUID to an array of its child transactions.\n */\nfunction mapChildTransactionsByParent(transactions: Transaction[]): Record<string, Transaction[]> {\n return transactions.reduce<Record<string, Transaction[]>>((accumulator, tx) => {\n if (tx.parent_guid) {\n if (!accumulator[tx.parent_guid]) accumulator[tx.parent_guid] = []\n accumulator[tx.parent_guid].push(tx)\n }\n return accumulator\n }, {})\n}\n\n/**\n * Produces a list of transactions based on the given sorted transactions,\n * where parent transactions that have split children are replaced by those\n * children sorted by descending absolute amount. All other transactions\n * are included as-is, with duplicates removed.\n */\nexport function flattenTransactionsWithSplits(\n sortedTransactions: Transaction[],\n allTransactions: Transaction[],\n): Transaction[] {\n // Set of parent transaction GUIDs that have split child transactions\n const parentTransactionGuidsWithSplits = extractParentTransactionGuids(allTransactions)\n\n // Map from parent GUID to array of its child split transactions\n const childTransactionsGroupedByParent = mapChildTransactionsByParent(allTransactions)\n\n // Track GUIDs of transactions already included in the result to avoid duplicates\n const processedTransactionGuids = new Set<string>()\n\n // Resulting list of transactions with parents replaced by their split children\n const flattenedTransactionList: Transaction[] = []\n\n for (const transaction of sortedTransactions) {\n if (parentTransactionGuidsWithSplits.has(transaction.guid)) {\n // This transaction is a parent with splits, so replace it with its children\n const splitChildTransactions = childTransactionsGroupedByParent[transaction.guid] ?? []\n\n splitChildTransactions\n .slice()\n .sort((a, b) => Math.abs(b.amount) - Math.abs(a.amount))\n .forEach((childTransaction) => {\n if (!processedTransactionGuids.has(childTransaction.guid)) {\n flattenedTransactionList.push(childTransaction)\n processedTransactionGuids.add(childTransaction.guid)\n }\n })\n } else if (!processedTransactionGuids.has(transaction.guid)) {\n // Normal transaction (no splits), add as-is if not already added\n flattenedTransactionList.push(transaction)\n processedTransactionGuids.add(transaction.guid)\n }\n }\n\n return flattenedTransactionList\n}\n\nexport const exportTransactionsToCSV = (transactions: Transaction[], tags: Tag[]) => {\n const csvContent = structureCSVData(formatTransactions(transactions, tags))\n\n const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' })\n const link = document.createElement('a')\n link.href = URL.createObjectURL(blob)\n link.setAttribute('download', 'transactions.csv')\n\n document.body.appendChild(link)\n link.click()\n document.body.removeChild(link)\n\n URL.revokeObjectURL(link.href)\n}\n\n/**\n * Formats a list of transactions into a list that will be used when\n * downloaded to a CSV file.\n */\nconst formatTransactions = (transactions: Transaction[], tags: Tag[]) => {\n return transactions.map((transaction) => ({\n // Post dates are calendar days; format on the UTC day so the export can't\n // shift to the prior day in a Western-offset browser.\n Date: formatDate(fromUnixUTC(transaction.date), DATE_FORMATS_INTL.YEAR_MONTH_DAY),\n Description: getDescription(transaction),\n 'Original Description': transaction.feed_description,\n Amount: `${transaction.amount}`,\n Type: transaction.transaction_type === TransactionType.CREDIT ? 'Credit' : 'Debit',\n 'Parent Category': CategoryGuidToName[transaction.top_level_category_guid || ''],\n Category: transaction.category,\n Account: transaction.account,\n Tags: getTags(transaction, tags),\n Memo: transaction.memo,\n Pending: transaction.isPending ? 'TRUE' : 'FALSE',\n })) as FormattedTransaction[]\n}\n\n/**\n * Escapes a value for safe CSV output\n */\nconst escapeCsvField = (field?: string | null): string => {\n if (!field) return ''\n return /[,\"\\n\\r]/.test(field) ? `\"${field.replace(/\"/g, '\"\"')}\"` : field\n}\n\n/**\n * Structures the CSV file data using the formatted transactions\n */\nconst structureCSVData = (formattedTransactions: FormattedTransaction[]) => {\n // Guard the empty export: Object.keys(undefined) would throw for a zero-row\n // list (e.g. an over-filtered range), so emit an empty file instead.\n if (formattedTransactions.length === 0) return ''\n\n const csvHeader = Object.keys(formattedTransactions[0]).join(',').concat('\\r\\n')\n const csvRows = formattedTransactions\n .map((transaction) => Object.values(transaction).map(escapeCsvField).join(','))\n .join('\\r\\n')\n\n return csvHeader + csvRows\n}\n\n/**\n * Get the description for a transaction that will be used within the CSV copy.\n * We want to highlight that split transactions are a split as well as\n * hidden transactions are hidden.\n */\nconst getDescription = (transaction: Transaction) => {\n let description = transaction.parent_guid ? 'Split: ' : ''\n description += transaction.is_hidden ? '(Excluded) ' : ''\n description += transaction.description\n\n return description\n}\n\nconst getTags = (transaction: Transaction, tags: Tag[]) => {\n return transaction.tags\n .map((tagGuid) => {\n const tag = tags.filter((t) => t.guid === tagGuid)[0]\n\n return tag?.name ?? ''\n })\n .join(' ')\n}\n"],"mappings":";;;;;;;;;;;;AA8BA,IAAa,IAAA,CACX,MACY,EAAY,4BAA4B,EAAc,UAUvD,KAAA,CACX,GACA,GACA,GACA,IAAsB,CAAC,GACvB,MACG;AACH,QAAM,IAAc,EAAS,OAAA,CAAQ,GAAkB,OAC9C;AAAA,IAAE,GAAG;AAAA,IAAM,CAAA,EAAQ,IAAA,GAAO;AAAA,EAAQ,IACxC,CAAC,CAAC,GAEC,IAAgB,EAAW,OAAA,CAAQ,GAAoB,OACpD;AAAA,IAAE,GAAG;AAAA,IAAM,CAAA,EAAS,IAAA,GAAO;AAAA,EAAS,IAC1C,CAAC,CA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/B,MAAM,EAAY;AAAA,EAClB,SAAS,EAAY,YAAY,SAAS;AAC5C,EAAE,GAME,IAAA,CAAkB,MACjB,IACE,WAAW,KAAK,CAAK,IAAI,IAAI,EAAM,QAAQ,MAAM,IAAI,CAAA,MAAO,IADhD,IAOf,IAAA,CAAoB,MAGpB,EAAsB,WAAW,IAAU,KAE7B,OAAO,KAAK,EAAsB,CAAA,CAAE,EAAE,KAAK,GAAG,EAAE,OAAO;AAAA,CAKlE,IAJS,EACb,IAAA,CAAK,MAAgB,OAAO,OAAO,CAAW,EAAE,IAAI,CAAc,EAAE,KAAK,GAAG,CAAC,EAC7E,KAAK;AAAA,CAEW,GAQf,IAAA,CAAkB,MAA6B;AACnD,MAAI,IAAc,EAAY,cAAc,YAAY;AACxD,SAAA,KAAe,EAAY,YAAY,gBAAgB,IACvD,KAAe,EAAY,aAEpB;AACT,GAEM,IAAA,CAAW,GAA0B,MAClC,EAAY,KAChB,IAAA,CAAK,MACQ,EAAK,OAAA,CAAQ,MAAM,EAAE,SAAS,CAAO,EAAE,CAAA,GAEvC,QAAQ,EACrB,EACA,KAAK,GAAG"}
1
+ {"version":3,"file":"TransactionUtils.es.js","names":[],"sources":["../../../src/core/utils/TransactionUtils.ts"],"sourcesContent":["import { endOfToday } from 'date-fns/endOfToday'\nimport { format } from 'date-fns/format'\nimport { startOfMonth } from 'date-fns/startOfMonth'\nimport { startOfToday } from 'date-fns/startOfToday'\n\nimport { TABLE_CONST } from '../constants/Table'\nimport {\n CategoryGuids,\n CategoryGuidToName,\n DATE_FORMATS_INTL,\n formatDate,\n ORDINAL_DATE_FORMAT,\n} from '../constants'\nimport { COLUMN_NAMES } from '../constants/Transaction'\nimport { TransactionStatus, TransactionType } from '../types'\nimport type { Category, CategoryCopy, DetailedAccount, Tag, Tagging, Transaction } from '../types'\n\nimport { type TransactionFilter } from '../stores/TransactionStore'\n\nimport { getLocalizedCategoryName } from './CategoryUtil'\nimport { endOfUtcDay, fromUnixUTC, startOfUtcDay } from './DateUtil'\nimport { formatCurrency } from './NumberFormatting'\n\ninterface AccountsMap {\n [key: string]: DetailedAccount\n}\n\n// True for account-to-account transfers (top-level Transfer category). Used to\n// swap the payee/description for the institution name in the transaction detail\n// header, the table Payee column, and the mobile list.\nexport const isTransferTransaction = (\n transaction: Pick<Transaction, 'top_level_category_guid'>,\n): boolean => transaction.top_level_category_guid === CategoryGuids.TRANSFER\n\nexport const isUnviewedTransaction = (\n transaction: Pick<Transaction, 'has_been_viewed' | 'parent_guid'>,\n): boolean => !transaction.has_been_viewed && !transaction.parent_guid\n\ninterface CategoriesMap {\n [key: string]: Category\n}\n\ninterface TaggingsMap {\n [key: string]: string[]\n}\n\nexport const buildDetailedTransactions = (\n transactions: Transaction[],\n accounts: DetailedAccount[],\n categories: Category[],\n taggings: Tagging[] = [],\n categoryCopy: CategoryCopy,\n) => {\n const accountsMap = accounts.reduce((acc: AccountsMap, account: DetailedAccount) => {\n return { ...acc, [account.guid]: account }\n }, {})\n\n const categoriesMap = categories.reduce((acc: CategoriesMap, category: Category) => {\n return { ...acc, [category.guid]: category }\n }, {})\n\n const taggingsMap = taggings.reduce((acc: TaggingsMap, tagging: Tagging) => {\n const { transaction_guid, tag_guid } = tagging\n\n if (!acc[transaction_guid]) {\n return {\n ...acc,\n [transaction_guid]: [tag_guid],\n }\n }\n const tags = [...acc[transaction_guid], tag_guid] as string[]\n\n return {\n ...acc,\n [transaction_guid]: tags,\n }\n }, {})\n\n return transactions.map((transaction: Transaction) => {\n const account = accountsMap[transaction.account_guid]\n const category = transaction.category_guid ? categoriesMap[transaction.category_guid] : null\n const tags = taggingsMap[transaction.guid] ?? []\n\n return {\n ...transaction,\n account: account?.user_name || 'Unknown',\n accountIsClosed: account?.is_closed,\n accountIsHidden: account?.is_hidden,\n category: category ? getLocalizedCategoryName(category, categoryCopy) : 'Uncategorized',\n institutionName: account?.institution?.name || account?.institutionName || undefined,\n isIncome: transaction.top_level_category_guid === CategoryGuids.INCOME,\n isPending: transaction.feed_status === TransactionStatus.PENDING,\n number: account?.account_number || '',\n payee: transaction.description,\n tags,\n }\n })\n}\n\nconst UNCATEGORIZED_TERM = 'uncategorized'\n\nexport const sortAndFilterTransactions = (\n filter: TransactionFilter,\n expandedSplits: string[],\n sortColumn: string,\n sortDirection: string,\n tags: Tag[],\n transactions: Transaction[],\n) => {\n const filteredTransactions = filterTransactions(filter, tags, transactions)\n\n const sortedTransactions = sortTransactions(filteredTransactions, sortColumn, sortDirection)\n\n expandedSplits.forEach((guid) => {\n const index = sortedTransactions.findIndex((t) => t.guid === guid)\n const children = transactions.filter((t) => t.parent_guid === guid)\n sortedTransactions.splice(index + 1, 0, ...children)\n })\n return sortedTransactions\n}\n\nconst filterTransactions = (\n filter: TransactionFilter,\n tags: Tag[],\n transactions: Transaction[],\n) => {\n const {\n accounts = [],\n dateRange = { start: startOfMonth(startOfToday()), end: endOfToday() },\n custom = () => true,\n searchTerm: searchFilter = '',\n showSplits = false,\n } = filter\n\n return (\n transactions\n // Filters out parent of split transactions when showSplits is true and filters out split\n // transaction children when showSplits is false\n .filter((t) => (showSplits ? !t.has_been_split : !t.parent_guid))\n // Filter for selected accounts\n .filter((t) => Boolean(accounts.find((guid) => guid === t.account_guid)))\n // Date range on the UTC calendar day, the same day the Date cell, CSV export\n // and category totals use. Local-midnight bounds put a midnight-UTC row near\n // a month boundary in a different month than the chart. (MEW-4191)\n .filter(\n (t) => t.date >= startOfUtcDay(dateRange.start) && t.date <= endOfUtcDay(dateRange.end),\n )\n // Custom filter\n .filter(custom)\n // Search filter\n .filter((transaction) => {\n // Don't return uncategorized split transactions\n if (searchFilter === UNCATEGORIZED_TERM && transaction.has_been_split) {\n return false\n }\n\n // Split check - When searching for \"Splits\" and transaction is a split or is a parent of a split(s)\n const splitPattern = /^spl/i\n if (\n splitPattern.test(searchFilter) &&\n (transaction.has_been_split || Boolean(transaction.parent_guid))\n ) {\n return true\n }\n\n // Check transactions tags\n const isTagIncludedInSearch = transaction.tags.some((guid) =>\n isIncludedInSearch(searchFilter, tags.find((tag) => tag.guid === guid)?.name),\n )\n const date = fromUnixUTC(transaction.date)\n return (\n isIncludedInSearch(searchFilter, transaction.payee) ||\n isIncludedInSearch(searchFilter, transaction.feed_description) ||\n isIncludedInSearch(searchFilter, transaction.category) ||\n isIncludedInSearch(searchFilter, formatDate(date, DATE_FORMATS_INTL.MONTH)) ||\n isIncludedInSearch(searchFilter, formatDate(date, DATE_FORMATS_INTL.DAY)) ||\n isIncludedInSearch(searchFilter, formatDate(date, DATE_FORMATS_INTL.FULL_MONTH_DAY)) ||\n isIncludedInSearch(searchFilter, formatDate(date, DATE_FORMATS_INTL.MONTH_DAY_YEAR)) ||\n isIncludedInSearch(searchFilter, format(date, ORDINAL_DATE_FORMAT)) ||\n isIncludedInSearch(searchFilter, transaction.account) ||\n isIncludedInSearch(searchFilter, formatCurrency(transaction.amount, '0,0.00')) ||\n isIncludedInSearch(searchFilter, transaction.memo) ||\n isTagIncludedInSearch\n )\n })\n )\n}\n\nconst sortTransactions = (\n transactions: Transaction[],\n sortColumn: string,\n sortDirection: string,\n) => {\n return [...transactions].sort((a: Transaction, b: Transaction) => {\n const column = sortColumn as keyof Transaction\n const sortCompare = (a[column] || '') > (b[column] || '')\n\n let sortASC = sortCompare ? -1 : 1\n let sortDESC = sortCompare ? 1 : -1\n\n if (sortColumn === COLUMN_NAMES.DATE || sortColumn === COLUMN_NAMES.AMOUNT) {\n sortASC = sortCompare ? 1 : -1\n sortDESC = sortCompare ? -1 : 1\n }\n\n return sortDirection === TABLE_CONST.ASC ? sortASC : sortDESC\n })\n}\n\n/**\n * Determines if a value is included within the terms set in the search bar\n */\nconst isIncludedInSearch = (searchFilter: string, value: string | null | undefined) => {\n const lowerCasedTerms = searchFilter.toLowerCase().split(' ')\n const lowerCasedValue = value?.toString().toLowerCase() ?? ''\n\n return lowerCasedTerms.every((filter) => lowerCasedValue.indexOf(filter) > -1)\n}\n\n// TODO: Change the way formatting data is exported in order to handle localization\ntype FormattedTransaction = {\n Date: string\n Description: string\n 'Original Description': string\n Amount: string\n Type: string\n 'Parent Category': string\n Category: string\n Account: string\n Tags: string\n Memo: string\n Pending: string\n}\n\n/**\n * Collects the GUIDs of all transactions that act as parents\n * to one or more split (child) transactions.\n */\nfunction extractParentTransactionGuids(transactions: Transaction[]): Set<string> {\n return new Set(\n transactions.filter((tx) => tx.parent_guid !== undefined).map((tx) => tx.parent_guid!),\n )\n}\n\n/**\n * Organizes child transactions by their parent transaction GUID.\n * Returns a map from parent GUID to an array of its child transactions.\n */\nfunction mapChildTransactionsByParent(transactions: Transaction[]): Record<string, Transaction[]> {\n return transactions.reduce<Record<string, Transaction[]>>((accumulator, tx) => {\n if (tx.parent_guid) {\n if (!accumulator[tx.parent_guid]) accumulator[tx.parent_guid] = []\n accumulator[tx.parent_guid].push(tx)\n }\n return accumulator\n }, {})\n}\n\n/**\n * Produces a list of transactions based on the given sorted transactions,\n * where parent transactions that have split children are replaced by those\n * children sorted by descending absolute amount. All other transactions\n * are included as-is, with duplicates removed.\n */\nexport function flattenTransactionsWithSplits(\n sortedTransactions: Transaction[],\n allTransactions: Transaction[],\n): Transaction[] {\n // Set of parent transaction GUIDs that have split child transactions\n const parentTransactionGuidsWithSplits = extractParentTransactionGuids(allTransactions)\n\n // Map from parent GUID to array of its child split transactions\n const childTransactionsGroupedByParent = mapChildTransactionsByParent(allTransactions)\n\n // Track GUIDs of transactions already included in the result to avoid duplicates\n const processedTransactionGuids = new Set<string>()\n\n // Resulting list of transactions with parents replaced by their split children\n const flattenedTransactionList: Transaction[] = []\n\n for (const transaction of sortedTransactions) {\n if (parentTransactionGuidsWithSplits.has(transaction.guid)) {\n // This transaction is a parent with splits, so replace it with its children\n const splitChildTransactions = childTransactionsGroupedByParent[transaction.guid] ?? []\n\n splitChildTransactions\n .slice()\n .sort((a, b) => Math.abs(b.amount) - Math.abs(a.amount))\n .forEach((childTransaction) => {\n if (!processedTransactionGuids.has(childTransaction.guid)) {\n flattenedTransactionList.push(childTransaction)\n processedTransactionGuids.add(childTransaction.guid)\n }\n })\n } else if (!processedTransactionGuids.has(transaction.guid)) {\n // Normal transaction (no splits), add as-is if not already added\n flattenedTransactionList.push(transaction)\n processedTransactionGuids.add(transaction.guid)\n }\n }\n\n return flattenedTransactionList\n}\n\nexport const exportTransactionsToCSV = (transactions: Transaction[], tags: Tag[]) => {\n const csvContent = structureCSVData(formatTransactions(transactions, tags))\n\n const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' })\n const link = document.createElement('a')\n link.href = URL.createObjectURL(blob)\n link.setAttribute('download', 'transactions.csv')\n\n document.body.appendChild(link)\n link.click()\n document.body.removeChild(link)\n\n URL.revokeObjectURL(link.href)\n}\n\n/**\n * Formats a list of transactions into a list that will be used when\n * downloaded to a CSV file.\n */\nconst formatTransactions = (transactions: Transaction[], tags: Tag[]) => {\n return transactions.map((transaction) => ({\n // Post dates are calendar days; format on the UTC day so the export can't\n // shift to the prior day in a Western-offset browser.\n Date: formatDate(fromUnixUTC(transaction.date), DATE_FORMATS_INTL.YEAR_MONTH_DAY),\n Description: getDescription(transaction),\n 'Original Description': transaction.feed_description,\n Amount: `${transaction.amount}`,\n Type: transaction.transaction_type === TransactionType.CREDIT ? 'Credit' : 'Debit',\n 'Parent Category': CategoryGuidToName[transaction.top_level_category_guid || ''],\n Category: transaction.category,\n Account: transaction.account,\n Tags: getTags(transaction, tags),\n Memo: transaction.memo,\n Pending: transaction.isPending ? 'TRUE' : 'FALSE',\n })) as FormattedTransaction[]\n}\n\n/**\n * Escapes a value for safe CSV output\n */\nconst escapeCsvField = (field?: string | null): string => {\n if (!field) return ''\n return /[,\"\\n\\r]/.test(field) ? `\"${field.replace(/\"/g, '\"\"')}\"` : field\n}\n\n/**\n * Structures the CSV file data using the formatted transactions\n */\nconst structureCSVData = (formattedTransactions: FormattedTransaction[]) => {\n // Guard the empty export: Object.keys(undefined) would throw for a zero-row\n // list (e.g. an over-filtered range), so emit an empty file instead.\n if (formattedTransactions.length === 0) return ''\n\n const csvHeader = Object.keys(formattedTransactions[0]).join(',').concat('\\r\\n')\n const csvRows = formattedTransactions\n .map((transaction) => Object.values(transaction).map(escapeCsvField).join(','))\n .join('\\r\\n')\n\n return csvHeader + csvRows\n}\n\n/**\n * Get the description for a transaction that will be used within the CSV copy.\n * We want to highlight that split transactions are a split as well as\n * hidden transactions are hidden.\n */\nconst getDescription = (transaction: Transaction) => {\n let description = transaction.parent_guid ? 'Split: ' : ''\n description += transaction.is_hidden ? '(Excluded) ' : ''\n description += transaction.description\n\n return description\n}\n\nconst getTags = (transaction: Transaction, tags: Tag[]) => {\n return transaction.tags\n .map((tagGuid) => {\n const tag = tags.filter((t) => t.guid === tagGuid)[0]\n\n return tag?.name ?? ''\n })\n .join(' ')\n}\n"],"mappings":";;;;;;;;;;;;AA8BA,IAAa,IAAA,CACX,MACY,EAAY,4BAA4B,EAAc,UAEvD,KAAA,CACX,MACY,CAAC,EAAY,mBAAmB,CAAC,EAAY,aAU9C,KAAA,CACX,GACA,GACA,GACA,IAAsB,CAAC,GACvB,MACG;AACH,QAAM,IAAc,EAAS,OAAA,CAAQ,GAAkB,OAC9C;AAAA,IAAE,GAAG;AAAA,IAAM,CAAA,EAAQ,IAAA,GAAO;AAAA,EAAQ,IACxC,CAAC,CAAC,GAEC,IAAgB,EAAW,OAAA,CAAQ,GAAoB,OACpD;AAAA,IAAE,GAAG;AAAA,IAAM,CAAA,EAAS,IAAA,GAAO;AAAA,EAAS,IAC1C,CAAC,CAAC,GAEC,IAAc,EAAS,OAAA,CAAQ,GAAkB,MAAqB;AAC1E,UAAM,EAAE,kBAAA,GAAkB,UAAA,EAAA,IAAa;AAEvC,QAAI,CAAC,EAAI,CAAA,EACP,QAAO;AAAA,MACL,GAAG;AAAA,MACF,CAAA,CAAA,GAAmB,CAAC,CAAQ;AAAA,IAC/B;AAEF,UAAM,IAAO,CAAC,GAAG,EAAI,CAAA,GAAmB,CAAQ;AAEhD,WAAO;AAAA,MACL,G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S,EACb,IAAA,CAAK,MAAgB,OAAO,OAAO,CAAW,EAAE,IAAI,CAAc,EAAE,KAAK,GAAG,CAAC,EAC7E,KAAK;AAAA,CAEW,GAQf,IAAA,CAAkB,MAA6B;AACnD,MAAI,IAAc,EAAY,cAAc,YAAY;AACxD,SAAA,KAAe,EAAY,YAAY,gBAAgB,IACvD,KAAe,EAAY,aAEpB;AACT,GAEM,IAAA,CAAW,GAA0B,MAClC,EAAY,KAChB,IAAA,CAAK,MACQ,EAAK,OAAA,CAAQ,MAAM,EAAE,SAAS,CAAO,EAAE,CAAA,GAEvC,QAAQ,EACrB,EACA,KAAK,GAAG"}
@@ -1,59 +1,60 @@
1
- import { useAppConfig as _, useEvent as R, useGlobalCopyStore as d, useHelpStore as x } from "../../common/context/hooks.es.js";
2
- import { useScreenSize as y } from "../../common/hooks/useScreenSize.es.js";
3
- import { ANALYTICS_EVENTS as H } from "../../common/constants/Analytics.es.js";
4
- import g from "../../common/components/ErrorBoundary.es.js";
1
+ import { useAppConfig as q, useEvent as y, useGlobalCopyStore as g, useHelpStore as R } from "../../common/context/hooks.es.js";
2
+ import { useScreenSize as d } from "../../common/hooks/useScreenSize.es.js";
3
+ import { ANALYTICS_EVENTS as b } from "../../common/constants/Analytics.es.js";
4
+ import { isLoginIssueTopic as x } from "../../core/constants/Help.es.js";
5
+ import H from "../../common/components/ErrorBoundary.es.js";
5
6
  import { HelpList as E } from "./HelpList.es.js";
6
- import { HelpContent as O } from "./HelpContent.es.js";
7
- import { RequestSupport as b } from "./requestsupport/RequestSupport.es.js";
7
+ import { HelpContent as I } from "./HelpContent.es.js";
8
+ import { RequestSupport as L } from "./requestsupport/RequestSupport.es.js";
8
9
  import p from "react";
9
- import { jsx as s, jsxs as I } from "react/jsx-runtime";
10
- import L from "@mui/material/Box";
11
- var V = ({ sx: a = {} }) => {
12
- const { config: n } = _(), { onEvent: m } = R(), { help: t } = d(), { helpCategories: S } = x(), { isMobile: f } = y(), [h, o] = p.useState(!1), [r, l] = p.useState(null), [C, u] = p.useState(""), c = (e) => {
13
- m(H.HELP_CLICK_TOPIC, {
14
- feature: e.category,
10
+ import { jsx as s, jsxs as O } from "react/jsx-runtime";
11
+ import v from "@mui/material/Box";
12
+ var k = ({ sx: a = {} }) => {
13
+ const { config: n } = q(), { onEvent: m } = y(), { help: t } = g(), { helpCategories: f } = R(), { isMobile: S } = d(), [h, o] = p.useState(!1), [r, l] = p.useState(null), [T, i] = p.useState(""), u = (e) => {
14
+ m(b.HELP_CLICK_TOPIC, {
15
+ feature: x(e.topicKey) ? t.help_by_category_list?.login_issues?.label ?? e.category : e.category,
15
16
  helpTopic: e.pageTitle
16
17
  }), l(e);
17
- }, i = () => o(!0), T = (e) => {
18
- u(e), o(!0);
19
- }, q = () => {
20
- o(!1), u("");
18
+ }, c = () => o(!0), C = (e) => {
19
+ i(e), o(!0);
20
+ }, _ = () => {
21
+ o(!1), i("");
21
22
  };
22
- return /* @__PURE__ */ I(L, {
23
+ return /* @__PURE__ */ O(v, {
23
24
  sx: {
24
25
  pt: 24,
25
- px: f ? 24 : 0,
26
+ px: S ? 24 : 0,
26
27
  ...a
27
28
  },
28
- children: [r ? /* @__PURE__ */ s(O, {
29
+ children: [r ? /* @__PURE__ */ s(I, {
29
30
  copy: t,
30
31
  hasRequestButton: n.enable_support_requests,
31
32
  onNavigateToList: () => l(null),
32
- onOpenCase: T,
33
- onRequestSupport: i,
33
+ onOpenCase: C,
34
+ onRequestSupport: c,
34
35
  topicInfo: r
35
36
  }) : /* @__PURE__ */ s(E, {
36
37
  buttonText: t.request_support,
37
38
  copy: t,
38
39
  hasRequestButton: n.enable_support_requests,
39
- helpCategories: S,
40
+ helpCategories: f,
40
41
  helpContent: t.list_short_content,
41
42
  helpTitle: t.list_title,
42
- onRequestHelp: i,
43
- onTopicSelect: c
44
- }), /* @__PURE__ */ s(g, { children: /* @__PURE__ */ s(b, {
45
- caseTopic: C,
43
+ onRequestHelp: c,
44
+ onTopicSelect: u
45
+ }), /* @__PURE__ */ s(H, { children: /* @__PURE__ */ s(L, {
46
+ caseTopic: T,
46
47
  copy: t,
47
48
  isOpen: h,
48
49
  onTopicSelect: (e) => {
49
- c(e), o(!1);
50
+ u(e), o(!1);
50
51
  },
51
- onClose: q
52
+ onClose: _
52
53
  }) })]
53
54
  });
54
55
  };
55
56
  export {
56
- V as Help
57
+ k as Help
57
58
  };
58
59
 
59
60
  //# sourceMappingURL=Help.es.js.map