@mx-cartographer/experiences 8.0.0-alpha.bb3 → 8.0.0-alpha.mega1

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 (203) hide show
  1. package/CHANGELOG.md +178 -1
  2. package/dist/{Account-Bxw0_4FU.mjs → Account-CvR2-dSR.mjs} +1 -1
  3. package/dist/{AccountDetailsContent-CAM9y39M.mjs → AccountDetailsContent-CitErkuS.mjs} +89 -82
  4. package/dist/AccountDetailsHeader-BkG3MNYo.mjs +87 -0
  5. package/dist/{AccountFields-C9FlatNb.mjs → AccountFields-zCMqet85.mjs} +6 -6
  6. package/dist/{AccountListItem-JFMZROh7.mjs → AccountListItem-DHrz8Mml.mjs} +9 -9
  7. package/dist/{AccountStore-BgNOyMdp.mjs → AccountStore-LgfBcYMe.mjs} +112 -75
  8. package/dist/Accounts-Bzy1_REQ.mjs +9 -0
  9. package/dist/{BeatApi-DhJpgCLz.mjs → BeatApi-De2IaqH2.mjs} +1 -1
  10. package/dist/{BeatStore-IBnXd4YK.mjs → BeatStore-D_NYuBSz.mjs} +1 -1
  11. package/dist/{BudgetUtil-B2ZXyw-g.mjs → BudgetUtil-BmZXkL0C.mjs} +2 -2
  12. package/dist/{CategorySelectorDrawer-DUe4lH5-.mjs → CategorySelectorDrawer-B-I3kajA.mjs} +23 -21
  13. package/dist/CategoryStore-CA3tS1BO.mjs +186 -0
  14. package/dist/CategoryUtil-DUM8NuGO.mjs +78 -0
  15. package/dist/{ConnectDrawer-BQNs-hjk.mjs → ConnectDrawer-BkvlItWx.mjs} +11 -11
  16. package/dist/{ConnectionsDrawer-ByGQE7D5.mjs → ConnectionsDrawer-VmuVFHbL.mjs} +5 -5
  17. package/dist/{CurrencyInput-DUsQbkXb.mjs → CurrencyInput-itK0R3wV.mjs} +2 -2
  18. package/dist/{CurrencyText-kyC1aseI.mjs → CurrencyText-Dr0EZ7bp.mjs} +1 -1
  19. package/dist/{DateUtil-BcuH7ErC.mjs → DateUtil-CBdcsyuk.mjs} +3 -3
  20. package/dist/{DebtsStore-C9bblOgW.mjs → DebtsStore-Bq-aPy-5.mjs} +1 -1
  21. package/dist/{Dialog-CWW597AF.mjs → Dialog-BPTr3qHE.mjs} +2 -2
  22. package/dist/{Donut-oaQFlbit.mjs → Donut-Dmy3JTWd.mjs} +12 -12
  23. package/dist/Drawer-By9V-B5L.mjs +178 -0
  24. package/dist/{EmptyState-DA_lfRBv.mjs → EmptyState-DoxNUae-.mjs} +24 -22
  25. package/dist/{ExportCsvAction-sX8Rg4Ov.mjs → ExportCsvAction-Cglo8Mca.mjs} +3 -3
  26. package/dist/{Fetch-87LIQbEA.mjs → Fetch-DecPFeGU.mjs} +24 -22
  27. package/dist/FinstrongStore-BIrX0Xg2.mjs +451 -0
  28. package/dist/{GoalStore-D-aB35SY.mjs → GoalStore-1P19goZ7.mjs} +112 -152
  29. package/dist/{Help-B6dIcujh.mjs → Help-Ea3BlXQp.mjs} +2 -2
  30. package/dist/LineChart-KpPw1phO.mjs +580 -0
  31. package/dist/{ListItemAction-DHa3KJPs.mjs → ListItemAction-BxTkF6Tz.mjs} +10 -10
  32. package/dist/{ManageIncome-1s_q5W4X.mjs → ManageIncome-CaoQl609.mjs} +91 -88
  33. package/dist/{MerchantStore-DrFvsUyy.mjs → MerchantStore-WvZ4gnQe.mjs} +1 -1
  34. package/dist/MicroWidgetContainer-r6mtxRer.mjs +52 -0
  35. package/dist/MiniWidgetContainer-Bg02sF1Y.mjs +71 -0
  36. package/dist/{NetWorthStore-DCsTZpuS.mjs → NetWorthStore-rC0q7P7t.mjs} +2 -2
  37. package/dist/{NotificationSettings-DqrkNMod.mjs → NotificationSettings-uzM8tCoH.mjs} +236 -231
  38. package/dist/{NotificationStore-BxP_P2dA.mjs → NotificationStore-CDX_kqHa.mjs} +7 -15
  39. package/dist/{NumberFormatting-Buh7u8Oi.mjs → NumberFormatting-DjTD0t3W.mjs} +9 -9
  40. package/dist/{OriginalBalanceAction-CWuVvRq9.mjs → OriginalBalanceAction-C6jdS4ws.mjs} +4 -4
  41. package/dist/{RecurringSettings-A_rAGCTP.mjs → RecurringSettings-B4ybrS0B.mjs} +4 -4
  42. package/dist/{RecurringTransactions-DK8dWldr.mjs → RecurringTransactions-BqijW_8S.mjs} +49 -48
  43. package/dist/{RecurringTransactionsStore-C4YOD7_D.mjs → RecurringTransactionsStore-BhBUVm9a.mjs} +26 -29
  44. package/dist/{SettingsStore-BcgS_Ohv.mjs → SettingsStore-krIRNwHK.mjs} +3 -3
  45. package/dist/{SpendingData-D5vsfYKo.mjs → SpendingData-DQ1b9uqq.mjs} +11 -13
  46. package/dist/SpendingLegend-CDO060GT.mjs +193 -0
  47. package/dist/{ToggleListItem-r0Kx56wF.mjs → ToggleListItem-ciFTiqRS.mjs} +19 -14
  48. package/dist/TransactionApi-CjBoLleL.mjs +86 -0
  49. package/dist/TransactionDetails-m5PddMQn.mjs +1380 -0
  50. package/dist/TransactionStore-PRlwE-TF.mjs +677 -0
  51. package/dist/TrendsStore-yO7qYv97.mjs +186 -0
  52. package/dist/{User-BQUxBeZV.mjs → User-Cnlegl1N.mjs} +2 -2
  53. package/dist/{ViewMoreMicroCard-SCn2wt4i.mjs → ViewMoreMicroCard-DwR0v_ll.mjs} +711 -728
  54. package/dist/{WidgetContainer-BHWANqT4.mjs → WidgetContainer-CoFDmQRE.mjs} +4 -4
  55. package/dist/accounts/components/AccountsListCompact.d.ts +10 -0
  56. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +4 -1
  57. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.d.ts +2 -1
  58. package/dist/accounts/index.es.js +245 -235
  59. package/dist/accounts/stores/AccountStore.d.ts +24 -25
  60. package/dist/accounts/utils/Accounts.d.ts +1 -2
  61. package/dist/analytics/index.es.js +2 -2
  62. package/dist/budgets/components/AddBudgets.d.ts +2 -1
  63. package/dist/budgets/index.es.js +611 -580
  64. package/dist/budgets/store/BudgetsStore.d.ts +0 -1
  65. package/dist/cashflow/index.es.js +187 -180
  66. package/dist/categories/index.es.js +2 -2
  67. package/dist/categories/stores/CategoryStore.d.ts +2 -5
  68. package/dist/categories/util/CategoryUtil.d.ts +2 -3
  69. package/dist/common/components/Select.d.ts +4 -2
  70. package/dist/common/components/charts/LineChart.d.ts +12 -2
  71. package/dist/common/components/charts/index.d.ts +0 -3
  72. package/dist/common/components/charts/linechart/CustomLegend.d.ts +3 -1
  73. package/dist/common/components/charts/linechart/CustomMark.d.ts +4 -0
  74. package/dist/common/components/charts/linechart/CustomTooltip.d.ts +6 -1
  75. package/dist/common/components/charts/stackedlinechart/CustomPointTooltip.d.ts +5 -2
  76. package/dist/common/components/drawer/Drawer.d.ts +3 -0
  77. package/dist/common/components/drawer/Footer.d.ts +17 -0
  78. package/dist/common/hooks/index.d.ts +1 -0
  79. package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
  80. package/dist/common/index.es.js +397 -387
  81. package/dist/common/stores/AppDataStore.d.ts +1 -3
  82. package/dist/common/stores/GlobalCopyStore.d.ts +1 -0
  83. package/dist/common/stores/GlobalStore.d.ts +10 -4
  84. package/dist/common/stores/GlobalUiStore.d.ts +2 -3
  85. package/dist/common/stores/UserStore.d.ts +2 -3
  86. package/dist/common/types/Account.d.ts +6 -9
  87. package/dist/common/types/Finstrong.d.ts +54 -0
  88. package/dist/common/types/Global.d.ts +1 -0
  89. package/dist/common/types/Widgets.d.ts +1 -0
  90. package/dist/common/types/index.d.ts +1 -1
  91. package/dist/common/types/localization/FinstrongCopy.d.ts +105 -2
  92. package/dist/common/types/localization/GoalsCopy.d.ts +1 -0
  93. package/dist/common/types/localization/TransactionsCopy.d.ts +1 -0
  94. package/dist/dashboard/index.es.js +90 -88
  95. package/dist/debts/index.es.js +458 -448
  96. package/dist/exportTransactionsToCSV-DuAaI5XA.mjs +48 -0
  97. package/dist/finstrong/FinstrongWidget.d.ts +1 -1
  98. package/dist/finstrong/api/FinstrongApi.d.ts +5 -0
  99. package/dist/finstrong/components/ConnectMoreAccountsCard.d.ts +3 -1
  100. package/dist/finstrong/components/CreditScore/CreditScoreContent.d.ts +4 -0
  101. package/dist/finstrong/components/CreditScore/CreditScoreHeader.d.ts +4 -0
  102. package/dist/finstrong/components/FinancialStrengthGraph.d.ts +7 -1
  103. package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.d.ts +3 -0
  104. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.d.ts +3 -0
  105. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.d.ts +4 -0
  106. package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.d.ts +3 -0
  107. package/dist/finstrong/components/KeyIndicatorsBorrowTab.d.ts +2 -2
  108. package/dist/finstrong/components/KeyIndicatorsDrawer.d.ts +4 -1
  109. package/dist/finstrong/components/KeyIndicatorsSaveTab.d.ts +2 -2
  110. package/dist/finstrong/components/KeyIndicatorsSpendTab.d.ts +2 -2
  111. package/dist/finstrong/components/KeyIndicatorsTabItem.d.ts +4 -3
  112. package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.d.ts +10 -0
  113. package/dist/finstrong/components/KeyIndicatorsTabsWidget.d.ts +2 -2
  114. package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.d.ts +6 -0
  115. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.d.ts +4 -0
  116. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.d.ts +4 -0
  117. package/dist/finstrong/components/ProgressBar.d.ts +15 -0
  118. package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.d.ts +3 -0
  119. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.d.ts +3 -0
  120. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.d.ts +4 -0
  121. package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.d.ts +3 -0
  122. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.d.ts +3 -0
  123. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.d.ts +4 -0
  124. package/dist/finstrong/components/StatusChip.d.ts +5 -0
  125. package/dist/finstrong/components/onboarding/Onboarding.d.ts +2 -0
  126. package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.d.ts +17 -0
  127. package/dist/finstrong/components/onboarding/OnboardingBirthday.d.ts +8 -0
  128. package/dist/finstrong/components/onboarding/OnboardingCreditScore.d.ts +8 -0
  129. package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.d.ts +14 -0
  130. package/dist/finstrong/components/onboarding/OnboardingStepsHeader.d.ts +8 -0
  131. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.d.ts +4 -0
  132. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.d.ts +4 -0
  133. package/dist/finstrong/components/shared/Accounts.d.ts +8 -0
  134. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +24 -0
  135. package/dist/finstrong/components/shared/DialScoreCard.d.ts +7 -1
  136. package/dist/finstrong/components/shared/DoubleBarChart.d.ts +28 -0
  137. package/dist/finstrong/components/shared/LineGraph.d.ts +7 -0
  138. package/dist/finstrong/components/shared/TotalCard.d.ts +8 -0
  139. package/dist/finstrong/components/shared/Transactions.d.ts +11 -0
  140. package/dist/finstrong/constants/index.d.ts +9 -0
  141. package/dist/finstrong/index.es.js +3190 -1073
  142. package/dist/finstrong/stores/FinstrongStore.d.ts +25 -2
  143. package/dist/finstrong/util/finstrongUtils.d.ts +58 -1
  144. package/dist/goals/index.es.js +302 -291
  145. package/dist/goals/stores/GoalStore.d.ts +4 -17
  146. package/dist/help/index.es.js +13 -9
  147. package/dist/{hooks-D6XlXHf4.mjs → hooks-ZMp65DFz.mjs} +12 -12
  148. package/dist/insights/index.es.js +1 -1
  149. package/dist/investments/index.es.js +108 -104
  150. package/dist/investments/stores/HoldingStore.d.ts +0 -1
  151. package/dist/merchants/index.es.js +2 -2
  152. package/dist/microinsights/MicroCardTemplate.d.ts +16 -0
  153. package/dist/microinsights/beaticons/BeatIcon.d.ts +2 -9
  154. package/dist/microinsights/beaticons/BeatMerchantLogo.d.ts +3 -2
  155. package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +2 -1
  156. package/dist/microinsights/cards/{MicroInsightCard.d.ts → BaseCard.d.ts} +1 -8
  157. package/dist/microinsights/cards/{BeatCard.d.ts → InsightCard.d.ts} +2 -2
  158. package/dist/microinsights/cards/NoRelevantInsightsCard.d.ts +2 -5
  159. package/dist/microinsights/cards/ZeroStateCard.d.ts +2 -5
  160. package/dist/microinsights/carousel/BeatList.d.ts +10 -0
  161. package/dist/microinsights/carousel/CarouselControls.d.ts +1 -3
  162. package/dist/microinsights/carousel/CarouselHeader.d.ts +1 -2
  163. package/dist/microinsights/constants/App.d.ts +0 -1
  164. package/dist/microinsights/index.d.ts +4 -3
  165. package/dist/microinsights/index.es.js +101 -14
  166. package/dist/microinsights/interfaces.d.ts +0 -6
  167. package/dist/networth/index.es.js +197 -190
  168. package/dist/notifications/index.es.js +25 -25
  169. package/dist/notifications/stores/NotificationStore.d.ts +1 -3
  170. package/dist/recurringtransactions/index.es.js +395 -351
  171. package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +2 -3
  172. package/dist/settings/index.es.js +307 -298
  173. package/dist/spending/index.es.js +299 -438
  174. package/dist/spending/utils/SpendingData.d.ts +2 -1
  175. package/dist/transactions/components/shared/TransactionDetails.d.ts +1 -0
  176. package/dist/transactions/components/shared/TransactionList.d.ts +1 -0
  177. package/dist/transactions/index.es.js +115 -112
  178. package/dist/transactions/stores/TransactionStore.d.ts +77 -21
  179. package/dist/trends/components/TrendsTable.d.ts +0 -2
  180. package/dist/trends/index.es.js +1025 -604
  181. package/dist/trends/utils/TrendsData.d.ts +1 -0
  182. package/dist/{useAccountDisplayName-BUAApBIb.mjs → useAccountDisplayName-B7iXTNM8.mjs} +2 -2
  183. package/dist/{useCombineEvents-BUDIR1ba.mjs → useCombineEvents-CRwX-qWE.mjs} +1 -1
  184. package/dist/{useInsightsEnabled-DBpwEq10.mjs → useInsightsEnabled-B7dxpDrX.mjs} +1 -1
  185. package/dist/useWidgetLoadTimer-hIOioiKx.mjs +19 -0
  186. package/package.json +4 -4
  187. package/dist/AccountDetailsHeader-JtSX6Uf9.mjs +0 -120
  188. package/dist/Accounts-BRf_YeTf.mjs +0 -27
  189. package/dist/CategoryStore-yHI0hWmK.mjs +0 -174
  190. package/dist/CategoryUtil-pZRIYOgN.mjs +0 -80
  191. package/dist/Drawer-kEE73B87.mjs +0 -113
  192. package/dist/FinstrongStore-F2c607dj.mjs +0 -101
  193. package/dist/LineChart-D4GI7nVh.mjs +0 -541
  194. package/dist/MicroWidgetContainer-DpeqN9n3.mjs +0 -45
  195. package/dist/MiniWidgetContainer-D0gfmbaF.mjs +0 -56
  196. package/dist/TransactionApi-B3Tksf7L.mjs +0 -86
  197. package/dist/TransactionDetails-oP1eSuiS.mjs +0 -1334
  198. package/dist/TransactionStore-ai3uII_r.mjs +0 -690
  199. package/dist/TrendsStore-DCYbpXPO.mjs +0 -559
  200. package/dist/common/components/SkeletonLoader.d.ts +0 -7
  201. package/dist/exportTransactionsToCSV-7bVS7KXf.mjs +0 -47
  202. package/dist/finstrong/utils/Finstrong.d.ts +0 -6
  203. package/dist/useAriaLive-B3_pRUio.mjs +0 -35
@@ -1,690 +0,0 @@
1
- import { jsx as I } from "react/jsx-runtime";
2
- import M from "@mui/material/Box";
3
- import H from "@mui/material/FormControlLabel";
4
- import P from "@mui/material/Radio";
5
- import U from "@mui/material/styles/useTheme";
6
- import K from "@mui/material/Tooltip";
7
- import { makeAutoObservable as p } from "mobx";
8
- import { endOfToday as f } from "date-fns/endOfToday";
9
- import { formatISO as V } from "date-fns/formatISO";
10
- import { getUnixTime as O } from "date-fns/getUnixTime";
11
- import { isBefore as v } from "date-fns/isBefore";
12
- import { startOfMonth as h } from "date-fns/startOfMonth";
13
- import { startOfToday as m } from "date-fns/startOfToday";
14
- import { subDays as B } from "date-fns/subDays";
15
- import { O as n, a as y, T as b } from "./User-BQUxBeZV.mjs";
16
- import { T as u } from "./TransactionApi-B3Tksf7L.mjs";
17
- import { b as Y } from "./Category-CevNQ03n.mjs";
18
- import { f as F } from "./exportTransactionsToCSV-7bVS7KXf.mjs";
19
- import { format as W } from "date-fns/format";
20
- import { fromUnixTime as z } from "date-fns/fromUnixTime";
21
- import { f as g, D as C, O as $ } from "./Dialog-CWW597AF.mjs";
22
- import { endOfMonth as k } from "date-fns/endOfMonth";
23
- import { B as L } from "./BeatApi-DhJpgCLz.mjs";
24
- const X = ({
25
- checked: l = !1,
26
- label: t,
27
- sx: a = {},
28
- tooltip: e = "",
29
- value: A
30
- }) => {
31
- const d = U(), s = d.palette.mode === "light" ? d.palette.grey[400] : d.palette.grey[700], c = l ? d.palette.action.active : s;
32
- return /* @__PURE__ */ I(
33
- M,
34
- {
35
- bgcolor: "background.paper",
36
- border: `${l ? 3 : 1}px solid`,
37
- borderColor: c,
38
- borderRadius: 2,
39
- mt: -2,
40
- mx: 8,
41
- pr: 8,
42
- py: 4,
43
- sx: { "&:hover": { borderColor: d.palette.action.active }, ...a },
44
- children: /* @__PURE__ */ I(K, { title: e, children: /* @__PURE__ */ I(
45
- H,
46
- {
47
- control: /* @__PURE__ */ I(
48
- P,
49
- {
50
- disableRipple: !0,
51
- sx: { "&.Mui-checked": { color: d.palette.action.active } }
52
- }
53
- ),
54
- label: t,
55
- labelPlacement: "start",
56
- sx: { ml: 0, pl: 8 },
57
- value: A
58
- }
59
- ) })
60
- }
61
- );
62
- }, pt = X, G = {
63
- ASC: "ASC",
64
- DESC: "DESC",
65
- DIRECTION: {
66
- ASC: "ascending",
67
- DESC: "descending"
68
- },
69
- ALIGN: {
70
- center: "center",
71
- left: "flex-start",
72
- right: "flex-end"
73
- }
74
- }, o = {
75
- ADD: "Add",
76
- ADD_CATEGORY: "Add Category",
77
- CHANGE_CATEGORY: "Change Category",
78
- CHANGE_DATE: "Change Date",
79
- CLOSE: "Close",
80
- DELETE: "Delete",
81
- EDIT: "Edit",
82
- HIDE: "Hide",
83
- SAVE: "Save",
84
- SPLIT: "Split",
85
- SELECT: "Select",
86
- UNHIDE: "Unhide",
87
- UNSPLIT: "Unsplit"
88
- }, T = {
89
- TRANSACTION_DETAILS: "Transaction Details",
90
- TRANSACTIONS_LIST: "Transactions List",
91
- TRANSACTIONS_WIDGET: "Transactions Widget"
92
- }, r = {
93
- ADD_TRANSACTION: "Manual Transaction",
94
- CATEGORY: "Category",
95
- DATE: "Date",
96
- DELETE_MERCHANT_LOGO: "Merchant Logo",
97
- DELETE_TRANSACTION: "Delete Transaction",
98
- DESCRIPTION: "Description",
99
- EXPORT_CSV: "Export CSV",
100
- FLAG: "Flag",
101
- HIDE_TRANSACTION: "Hide Transaction",
102
- MEMO: "Memo",
103
- SPLITS: "Split Transactions",
104
- TAGS: "Tags",
105
- TAG_ADD: "Add Tag",
106
- TAG_DELETE: "Delete Tag",
107
- TAG_EDIT: "Edit Tag",
108
- TRANSACTION: "Transaction",
109
- TRANSACTIONS_LIST: "Transactions List",
110
- UNHIDE_TRANSACTION: "Unhide Transaction"
111
- }, R = {
112
- // splits
113
- [n.ON_TRANSACTION_SPLIT_CLICK]: {
114
- action: o.SELECT,
115
- category: T.TRANSACTION_DETAILS,
116
- label: r.SPLITS
117
- },
118
- [n.ON_TRANSACTION_SPLIT_CATEGORY_CLICK]: {
119
- action: o.ADD_CATEGORY,
120
- category: T.TRANSACTION_DETAILS,
121
- label: r.SPLITS
122
- },
123
- [n.ON_TRANSACTION_SPLIT_DELETE_CLICK]: {
124
- action: o.DELETE,
125
- category: T.TRANSACTION_DETAILS,
126
- label: r.SPLITS
127
- },
128
- [n.ON_TRANSACTION_SPLIT_SAVE_CLICK]: {
129
- action: o.SPLIT,
130
- category: T.TRANSACTION_DETAILS,
131
- label: r.SPLITS
132
- },
133
- [n.ON_TRANSACTION_UNSPLIT]: {
134
- action: o.UNSPLIT,
135
- category: T.TRANSACTION_DETAILS,
136
- label: r.SPLITS
137
- },
138
- // category
139
- [n.ON_TRANSACTION_CATEGORY_CLICK]: {
140
- action: o.SELECT,
141
- category: T.TRANSACTIONS_LIST,
142
- label: r.CATEGORY
143
- },
144
- [n.ON_TRANSACTION_CATEGORY_CHANGED]: {
145
- action: o.CHANGE_CATEGORY,
146
- category: T.TRANSACTION_DETAILS,
147
- label: r.CATEGORY
148
- },
149
- // date
150
- [n.ON_TRANSACTION_DATE_CHANGED]: {
151
- action: o.SAVE,
152
- category: T.TRANSACTION_DETAILS,
153
- label: r.DATE
154
- },
155
- [n.ON_TRANSACTION_DATE_CLICK]: {
156
- action: o.SELECT,
157
- category: T.TRANSACTION_DETAILS,
158
- label: r.DATE
159
- },
160
- // merchant logo
161
- [n.ON_TRANSACTION_DELETE_LOGO_CANCEL]: {
162
- action: o.CLOSE,
163
- category: T.TRANSACTION_DETAILS,
164
- label: r.DELETE_MERCHANT_LOGO
165
- },
166
- [n.ON_TRANSACTION_DELETE_LOGO_CLICK]: {
167
- action: o.SELECT,
168
- category: T.TRANSACTION_DETAILS,
169
- label: r.DELETE_MERCHANT_LOGO
170
- },
171
- [n.ON_TRANSACTION_DELETE_LOGO_DELETED]: {
172
- action: o.DELETE,
173
- category: T.TRANSACTION_DETAILS,
174
- label: r.DELETE_MERCHANT_LOGO
175
- },
176
- // description
177
- [n.ON_TRANSACTION_DESCRIPTION_EDIT_CLICK]: {
178
- action: o.EDIT,
179
- category: T.TRANSACTION_DETAILS,
180
- label: r.DESCRIPTION
181
- },
182
- [n.ON_TRANSACTION_DESCRIPTION_SAVE_CLICK]: {
183
- action: o.SAVE,
184
- category: T.TRANSACTION_DETAILS,
185
- label: r.DESCRIPTION
186
- },
187
- // hide transactions
188
- [n.ON_TRANSACTION_HIDDEN]: {
189
- action: o.SAVE,
190
- category: T.TRANSACTION_DETAILS,
191
- label: r.HIDE_TRANSACTION
192
- },
193
- [n.ON_TRANSACTION_HIDE_CLICK]: {
194
- action: o.SELECT,
195
- category: T.TRANSACTION_DETAILS,
196
- label: r.HIDE_TRANSACTION
197
- },
198
- [n.ON_TRANSACTION_HIDE_CANCEL_CLICK]: {
199
- action: o.CLOSE,
200
- category: T.TRANSACTION_DETAILS,
201
- label: r.HIDE_TRANSACTION
202
- },
203
- // transaction list
204
- [n.ON_TRANSACTION_LIST_ITEM_CLICK]: {
205
- action: o.SELECT,
206
- category: T.TRANSACTIONS_LIST,
207
- label: r.TRANSACTION
208
- },
209
- // memo
210
- [n.ON_TRANSACTION_MEMO_CHANGED]: {
211
- action: o.SAVE,
212
- category: T.TRANSACTION_DETAILS,
213
- label: r.MEMO
214
- },
215
- [n.ON_TRANSACTION_MEMO_CLICK]: {
216
- action: o.SELECT,
217
- category: T.TRANSACTION_DETAILS,
218
- label: r.MEMO
219
- },
220
- // tags
221
- [n.ON_TRANSACTION_TAGS_CHANGED]: {
222
- action: o.SAVE,
223
- category: T.TRANSACTION_DETAILS,
224
- label: r.TAGS
225
- },
226
- [n.ON_TRANSACTION_TAGS_CLICK]: {
227
- action: o.SELECT,
228
- category: T.TRANSACTION_DETAILS,
229
- label: r.TAGS
230
- },
231
- [n.ON_TRANSACTION_TAGS_TAG_ADD_CANCEL_CLICK]: {
232
- action: o.CLOSE,
233
- category: T.TRANSACTION_DETAILS,
234
- label: r.TAGS
235
- },
236
- [n.ON_TRANSACTION_TAGS_TAG_ADD_CLICK]: {
237
- action: o.ADD,
238
- category: T.TRANSACTION_DETAILS,
239
- label: r.TAG_ADD
240
- },
241
- [n.ON_TRANSACTION_TAGS_TAG_ADDED]: {
242
- action: o.SAVE,
243
- category: T.TRANSACTION_DETAILS,
244
- label: r.TAG_ADD
245
- },
246
- [n.ON_TRANSACTION_TAGS_TAG_DELETE_CLICK]: {
247
- action: o.SELECT,
248
- category: T.TRANSACTION_DETAILS,
249
- label: r.TAG_DELETE
250
- },
251
- [n.ON_TRANSACTION_TAGS_TAG_DELETE_CANCEL_CLICK]: {
252
- action: o.CLOSE,
253
- category: T.TRANSACTION_DETAILS,
254
- label: r.TAG_DELETE
255
- },
256
- [n.ON_TRANSACTION_TAGS_TAG_DELETED]: {
257
- action: o.SAVE,
258
- category: T.TRANSACTION_DETAILS,
259
- label: r.TAG_DELETE
260
- },
261
- [n.ON_TRANSACTION_TAGS_TAG_EDIT_CLICK]: {
262
- action: o.EDIT,
263
- category: T.TRANSACTION_DETAILS,
264
- label: r.TAG_EDIT
265
- },
266
- [n.ON_TRANSACTION_TAGS_TAG_EDIT_SAVED]: {
267
- action: o.SAVE,
268
- category: T.TRANSACTION_DETAILS,
269
- label: r.TAG_EDIT
270
- },
271
- // flag
272
- [n.ON_TRANSACTION_TOGGLE_FLAG_CLICK]: {
273
- action: o.SELECT,
274
- category: T.TRANSACTION_DETAILS,
275
- label: r.FLAG
276
- },
277
- // hide
278
- [n.ON_TRANSACTION_UNHIDDEN]: {
279
- action: o.SAVE,
280
- category: T.TRANSACTION_DETAILS,
281
- label: r.UNHIDE_TRANSACTION
282
- },
283
- [n.ON_TRANSACTION_UNHIDE_CLICK]: {
284
- action: o.SELECT,
285
- category: T.TRANSACTION_DETAILS,
286
- label: r.UNHIDE_TRANSACTION
287
- },
288
- [n.ON_TRANSACTION_UNHIDE_CANCEL_CLICK]: {
289
- action: o.CLOSE,
290
- category: T.TRANSACTION_DETAILS,
291
- label: r.UNHIDE_TRANSACTION
292
- },
293
- // export CSV
294
- [n.ON_TRANSACTION_EXPORT_CSV_CLICK]: {
295
- action: o.SELECT,
296
- category: T.TRANSACTIONS_WIDGET,
297
- label: r.EXPORT_CSV
298
- },
299
- // add transaction
300
- [n.ON_TRANSACTION_MANUAL_ADD_CLICK]: {
301
- action: o.SELECT,
302
- category: T.TRANSACTIONS_WIDGET,
303
- label: r.ADD_TRANSACTION
304
- },
305
- [n.ON_TRANSACTION_MANUAL_ADD_ADDED]: {
306
- action: o.ADD,
307
- category: T.TRANSACTIONS_WIDGET,
308
- label: r.ADD_TRANSACTION
309
- },
310
- [n.ON_TRANSACTION_DELETE_CLICK]: {
311
- action: o.SELECT,
312
- category: T.TRANSACTIONS_WIDGET,
313
- label: r.DELETE_TRANSACTION
314
- },
315
- [n.ON_TRANSACTION_DELETE_CANCEL]: {
316
- action: o.CLOSE,
317
- category: T.TRANSACTIONS_WIDGET,
318
- label: r.DELETE_TRANSACTION
319
- },
320
- [n.ON_TRANSACTION_DELETE_DELETED]: {
321
- action: o.DELETE,
322
- category: T.TRANSACTIONS_WIDGET,
323
- label: r.DELETE_TRANSACTION
324
- }
325
- }, j = async (l, t) => !t || !R[l] ? null : t.sendAnalyticEvent(R[l]), D = {
326
- FLAG: "flag",
327
- DATE: "date",
328
- PAYEE: "payee",
329
- CATEGORY: "category",
330
- ACCOUNT: "account",
331
- AMOUNT: "amount"
332
- }, Z = (l, t, a, e = []) => {
333
- const A = t.reduce((c, i) => ({ ...c, [i.guid]: i }), {}), d = a.reduce((c, i) => ({ ...c, [i.guid]: i }), {}), s = e.reduce((c, i) => {
334
- const { transaction_guid: N, tag_guid: E } = i;
335
- if (!c[N])
336
- return {
337
- ...c,
338
- [N]: [E]
339
- };
340
- const S = [...c[N], E];
341
- return {
342
- ...c,
343
- [N]: S
344
- };
345
- }, {});
346
- return l.map((c) => {
347
- const i = A[c.account_guid], N = c.category_guid ? d[c.category_guid] : null, E = s[c.guid] ?? [];
348
- return {
349
- ...c,
350
- account: i?.user_name || "Unknown",
351
- accountIsClosed: i?.is_closed,
352
- accountIsHidden: i?.is_hidden,
353
- category: N?.name || "Uncategorized",
354
- isIncome: c.top_level_category_guid === Y.INCOME,
355
- isPending: c.feed_status === y.PENDING,
356
- number: i?.account_number || "",
357
- payee: c.description,
358
- tags: E
359
- };
360
- });
361
- }, q = "uncategorized", J = (l, t, a, e, A, d) => {
362
- const s = Q(l, A, d), c = tt(s, a, e);
363
- return t.forEach((i) => {
364
- const N = c.findIndex((S) => S.guid === i), E = d.filter((S) => S.parent_guid === i);
365
- c.splice(N + 1, 0, ...E);
366
- }), c;
367
- }, Q = (l, t, a) => {
368
- const {
369
- accounts: e = [],
370
- dateRange: A = { start: h(m()), end: f() },
371
- custom: d = () => !0,
372
- searchTerm: s = "",
373
- showSplits: c = !1
374
- } = l;
375
- return a.filter((i) => c ? !i.has_been_split : !i.parent_guid).filter((i) => !!e.find((N) => N === i.account_guid)).filter((i) => i.date >= O(A.start) && i.date <= O(A.end)).filter(d).filter((i) => {
376
- if (s === q && i.has_been_split)
377
- return !1;
378
- if (/^spl/i.test(s) && (i.has_been_split || i.parent_guid))
379
- return !0;
380
- const E = i.tags.some(
381
- (w) => _(s, t.find((x) => x.guid === w)?.name)
382
- ), S = z(i.date);
383
- return _(s, i.payee) || _(s, i.feed_description) || _(s, i.category) || _(s, g(S, C.MONTH)) || _(s, g(S, C.DAY)) || _(s, g(S, C.FULL_MONTH_DAY)) || _(s, g(S, C.MONTH_DAY_YEAR)) || _(s, W(S, $)) || _(s, i.account) || _(s, `${i.amount}`) || _(s, i.memo) || E;
384
- });
385
- }, tt = (l, t, a) => [...l].sort((e, A) => {
386
- const d = t, s = (e[d] || "") > (A[d] || "");
387
- let c = s ? -1 : 1, i = s ? 1 : -1;
388
- return (t === D.DATE || t === D.AMOUNT) && (c = s ? 1 : -1, i = s ? -1 : 1), a === G.ASC ? c : i;
389
- }), _ = (l, t) => {
390
- const a = l.toLowerCase().split(" "), e = t?.toString().toLowerCase() ?? "";
391
- return a.every((A) => e.indexOf(A) > -1);
392
- }, at = {
393
- account_guid: "",
394
- amount: 0,
395
- currency_code: "",
396
- date: 0,
397
- description: "",
398
- duplicate: !1,
399
- feed_description: "",
400
- feed_status: y.POSTED,
401
- feed_transaction_date: 0,
402
- has_been_split: !1,
403
- has_been_viewed: !1,
404
- is_cleared: !1,
405
- is_flagged: !1,
406
- is_hidden: !1,
407
- is_manual: !0,
408
- is_personal: !0,
409
- is_reimbursable: !1,
410
- is_subscription: !1,
411
- is_void: !1,
412
- revision: 1,
413
- transaction_type: b.DEBIT,
414
- user_guid: "",
415
- is_duplicate: !1,
416
- feed_transacted_at: 0,
417
- guid: "",
418
- memo: void 0,
419
- tags: []
420
- };
421
- class et {
422
- beginDate = h(/* @__PURE__ */ new Date());
423
- endDate = k(/* @__PURE__ */ new Date());
424
- expandedSplits = [];
425
- isInitialized = !1;
426
- height = 550;
427
- width = 1e3;
428
- shouldDisableDrawerScroll = !1;
429
- searchValue = "";
430
- selectedAccountGuids = [];
431
- manualTransaction = at;
432
- isAmountValid = !1;
433
- showInsights = !1;
434
- constructor() {
435
- p(this);
436
- }
437
- setDateRange = (t, a) => {
438
- this.beginDate = t, this.endDate = a;
439
- };
440
- setIsInitialized = (t) => this.isInitialized = t;
441
- setIsAmountValid = (t) => this.isAmountValid = t;
442
- setSearchValue = (t) => this.searchValue = t;
443
- setSelectedAccountGuids = (t) => this.selectedAccountGuids = t;
444
- setShouldDisableDrawerScroll = (t) => this.shouldDisableDrawerScroll = t;
445
- setShowInsights = (t) => {
446
- this.showInsights = t;
447
- };
448
- setSize = (t, a) => {
449
- this.height = t, this.width = a;
450
- };
451
- toggleSplit = (t) => {
452
- const a = [...this.expandedSplits], e = this.expandedSplits.findIndex((A) => A === t);
453
- e >= 0 ? a.splice(e, 1) : a.push(t), this.expandedSplits = a;
454
- };
455
- clearExpandedSplits = () => {
456
- this.expandedSplits.length !== 0 && (this.expandedSplits = []);
457
- };
458
- updateManualTransaction = (t) => {
459
- this.manualTransaction = t;
460
- };
461
- }
462
- class ft {
463
- globalStore;
464
- uiStore;
465
- api = new u("/", "");
466
- beatApi = new L("/", "");
467
- associatedBeats = [];
468
- associatedBeatsLoaded = !1;
469
- transactions = [];
470
- transactionsLoaded = !1;
471
- taggings = [];
472
- taggingsLoaded = !1;
473
- tags = [];
474
- tagsLoaded = !1;
475
- transactionRules = [];
476
- transactionRulesLoaded = !1;
477
- cachedStartDate = B(m(), 90);
478
- filter = {};
479
- isLoading = !0;
480
- sortColumn = D.DATE;
481
- sortDirection = G.DESC;
482
- onAnalyticEvent = j;
483
- constructor(t) {
484
- this.globalStore = t, this.uiStore = new et(), this.api = new u(
485
- t.endpoint,
486
- t.sessionToken,
487
- t.onError
488
- ), this.beatApi = new L(t.endpoint, t.sessionToken, t.onError), p(this);
489
- }
490
- loadTransactionData = async () => {
491
- await Promise.all([
492
- this.loadAssociatedBeats(h(/* @__PURE__ */ new Date())),
493
- this.loadTags(),
494
- this.loadTaggings(),
495
- this.loadTransactionRules(),
496
- // By default loads 90 days of transactions
497
- this.loadTransactions(this.cachedStartDate)
498
- ]), this.uiStore.setIsInitialized(!0);
499
- };
500
- get isTransactionDataLoaded() {
501
- return this.associatedBeatsLoaded && this.tagsLoaded && this.taggingsLoaded && this.transactionRulesLoaded && this.transactionsLoaded;
502
- }
503
- get sortedTransactions() {
504
- return J(
505
- this.filter,
506
- this.uiStore.expandedSplits,
507
- this.sortColumn,
508
- this.sortDirection,
509
- this.tags,
510
- this.detailedTransactions
511
- );
512
- }
513
- get sortedTransactionsWithSplits() {
514
- return F(this.sortedTransactions, this.transactions);
515
- }
516
- get detailedTransactions() {
517
- return Z(
518
- this.transactions,
519
- this.globalStore.accountStore.visibleAccounts,
520
- this.globalStore.categoryStore.categories,
521
- this.taggings
522
- );
523
- }
524
- setAssociatedBeats = (t) => {
525
- this.associatedBeats = t, this.associatedBeatsLoaded = !0;
526
- };
527
- setTaggings = (t) => {
528
- this.taggings = t, this.taggingsLoaded = !0;
529
- };
530
- setTags = (t) => {
531
- this.tags = t, this.tagsLoaded = !0;
532
- };
533
- setTransactionRules = (t) => {
534
- this.transactionRules = t, this.transactionRulesLoaded = !0;
535
- };
536
- setTransactions = (t) => {
537
- this.transactions = t, this.transactionsLoaded = !0;
538
- };
539
- addTag = async (t) => {
540
- await this.api.addTag({ name: t }), await this.loadTags();
541
- };
542
- addTagging = async (t, a) => {
543
- await this.api.addTagging({
544
- tag_guid: t,
545
- transaction_guid: a
546
- });
547
- };
548
- addOrUpdateTransactionRule = async (t, a) => {
549
- const e = this.transactionRules.find(
550
- (A) => A.guid === a.user_transaction_rule_guid
551
- );
552
- e ? await this.api.updateTransactionRule({
553
- ...e,
554
- category_guid: t,
555
- description: a.description
556
- }) : await this.api.addTransactionRule({
557
- category_guid: t,
558
- description: a.description,
559
- match_description: a.description
560
- }), await this.loadTransactionRules();
561
- };
562
- addTransaction = async (t) => {
563
- const a = await this.api.addTransaction(t);
564
- if (a) {
565
- this.setTransactions([a, ...this.transactions]);
566
- const e = a.transaction_type === b.CREDIT ? a.amount : -a.amount;
567
- this.globalStore.accountStore.updateAccountBalance(a.account_guid, e);
568
- }
569
- };
570
- loadAssociatedBeats = async (t) => {
571
- const a = t ? V(t, { representation: "date" }) : void 0;
572
- try {
573
- const e = await this.beatApi.getBeatsWithAssociatedTransaction(a);
574
- this.setAssociatedBeats(e);
575
- } catch (e) {
576
- console.error(`Error occurred while loading associated beats: ${e}`);
577
- }
578
- };
579
- loadTags = async () => {
580
- try {
581
- const t = await this.api.getTags();
582
- this.setTags(t);
583
- } catch (t) {
584
- console.error(`Error occurred while loading tags: ${t}`);
585
- }
586
- };
587
- loadTaggings = async () => {
588
- try {
589
- const t = await this.api.getTaggings();
590
- this.setTaggings(t);
591
- } catch (t) {
592
- console.error(`Error occurred while loading taggings: ${t}`);
593
- }
594
- };
595
- loadTransactionRules = async () => {
596
- const t = await this.api.getTransactionRules();
597
- this.setTransactionRules(t);
598
- };
599
- loadTransactions = async (t = this.cachedStartDate) => {
600
- this.setIsLoading(!0), this.transactions = [];
601
- try {
602
- const a = await this.api.getTransactionsByDateRange(
603
- O(t),
604
- O(f())
605
- );
606
- this.setTransactions(a);
607
- } catch (a) {
608
- console.error(`Error occurred while loading transactions: ${a}`);
609
- }
610
- this.setIsLoading(!1);
611
- };
612
- modifyTransactionByAccountGuid = (t, a) => {
613
- this.transactions = this.transactions.map(
614
- (e) => e.account_guid === t ? { ...e, ...a } : e
615
- );
616
- };
617
- removeTag = async (t) => {
618
- await this.api.removeTag(t), await this.loadTags();
619
- };
620
- removeTagging = async (t) => {
621
- await this.api.removeTagging(t);
622
- };
623
- removeTransaction = async (t) => {
624
- await this.api.removeTransaction(t);
625
- const a = this.transactions.findIndex((e) => e.guid === t);
626
- if (a >= 0) {
627
- const e = [...this.transactions];
628
- e.splice(a, 1), this.setTransactions(e);
629
- }
630
- };
631
- setFilter = (t) => {
632
- this.filter = t, t.dateRange && v(t.dateRange.start, this.cachedStartDate) && this.loadTransactions(t.dateRange.start).then(() => {
633
- t.dateRange && (this.cachedStartDate = t.dateRange.start);
634
- });
635
- };
636
- setIsLoading = (t) => this.isLoading = t;
637
- splitTransaction = async (t, a) => {
638
- const e = await this.api.updateTransaction(t), A = [];
639
- for (let s = 0; s < a.length; s++) {
640
- const c = await this.api.addTransaction(a[s]);
641
- A.push(c);
642
- }
643
- const d = this.transactions.findIndex((s) => s.guid === t.guid);
644
- d >= 0 && this.setTransactions([
645
- ...this.transactions.slice(0, d),
646
- e,
647
- ...this.transactions.slice(d + 1),
648
- ...A
649
- ]);
650
- };
651
- unSplitTransaction = async (t) => {
652
- const a = this.transactions.filter((s) => s.parent_guid === t);
653
- await this.api.removeTransactionSplit(t);
654
- const e = [...this.transactions];
655
- a.forEach((s) => {
656
- const c = e.findIndex((i) => i.guid === s.guid);
657
- c >= 0 && e.splice(c, 1);
658
- });
659
- const A = e.findIndex((s) => s.guid === t), d = e[A];
660
- d.has_been_split = !1, A >= 0 && this.setTransactions([
661
- ...e.slice(0, A),
662
- d,
663
- ...e.slice(A + 1)
664
- ]);
665
- };
666
- updateTaggings = async (t, a) => {
667
- const e = this.taggings.filter((s) => s.transaction_guid === a), A = new Set(e.map((s) => s.tag_guid)), d = new Set(t);
668
- for (const s of t)
669
- A.has(s) || await this.addTagging(s, a);
670
- for (const s of e)
671
- d.has(s.tag_guid) || await this.removeTagging(s.guid);
672
- await this.loadTaggings();
673
- };
674
- updateTag = async (t) => {
675
- await this.api.updateTag(t), await this.loadTags();
676
- };
677
- updateTransaction = async (t) => {
678
- const a = await this.api.updateTransaction(t), e = this.transactions.findIndex((A) => A.guid === t.guid);
679
- e >= 0 && this.setTransactions([
680
- ...this.transactions.slice(0, e),
681
- a,
682
- ...this.transactions.slice(e + 1)
683
- ]);
684
- };
685
- }
686
- export {
687
- at as D,
688
- pt as S,
689
- ft as T
690
- };