@mx-cartographer/experiences 8.0.0-alpha.sms2 → 9.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 (139) hide show
  1. package/CHANGELOG.md +217 -0
  2. package/dist/{Account-Cp30A3ad.mjs → Account-BIKn4XEZ.mjs} +1 -1
  3. package/dist/Account-CMjOp7S2.mjs +118 -0
  4. package/dist/AccountApi-DgZ8ILj1.mjs +19 -0
  5. package/dist/AccountDetailsHeader-BOV91g1o.mjs +95 -0
  6. package/dist/AccountDisplayName-CO7z3v99.mjs +11 -0
  7. package/dist/{AccountFields-CW6cIthP.mjs → AccountFields-BRRH37K1.mjs} +10 -11
  8. package/dist/{AccountListItem-DxmAs98Z.mjs → AccountListItem-Ds5C0mOT.mjs} +4 -4
  9. package/dist/{AccountStore-hIs-yA6W.mjs → AccountStore-BFKvXJSD.mjs} +79 -69
  10. package/dist/{Accounts-DUHkUyK4.mjs → Accounts-CuE8aSZN.mjs} +1 -1
  11. package/dist/{BudgetUtil-CIDAPPPT.mjs → BudgetUtil-CDSOZXem.mjs} +4 -4
  12. package/dist/CategorySelectorDrawer-C4aZYP4N.mjs +418 -0
  13. package/dist/CategoryStore-DEqAnHbi.mjs +186 -0
  14. package/dist/{CategoryUtil-DfVKKkRf.mjs → CategoryUtil-CFHBvaV4.mjs} +1 -1
  15. package/dist/{ConnectionsDrawer-CSo6AFkG.mjs → ConnectionsDrawer-BExzgE16.mjs} +5 -5
  16. package/dist/{CurrencyInput-BrGvhgVK.mjs → CurrencyInput-DDQ4DBrE.mjs} +1 -1
  17. package/dist/{CurrencyText-Dr0EZ7bp.mjs → CurrencyText-C-85TnUF.mjs} +3 -3
  18. package/dist/{DateUtil-CDPZw_-m.mjs → DateUtil-CVsMhbZU.mjs} +3 -3
  19. package/dist/{DebtsStore-hi1cqrRk.mjs → DebtsStore-Dv_T7Dts.mjs} +12 -12
  20. package/dist/{Dialog-CDV0kKxj.mjs → Dialog-CWymUiuO.mjs} +32 -35
  21. package/dist/Drawer-Bet2ZPJo.mjs +176 -0
  22. package/dist/{ExportCsvAction-CQ1grpwo.mjs → ExportCsvAction-oG_Mn66T.mjs} +3 -3
  23. package/dist/{FinstrongStore-dKZOZ2hM.mjs → FinstrongStore-BjFkMTIL.mjs} +6 -6
  24. package/dist/GlobalAccountFilter-BpWlPAl5.mjs +316 -0
  25. package/dist/{GoalStore-CFeAJloA.mjs → GoalStore-Dbjgft2i.mjs} +155 -137
  26. package/dist/{Help-i4OasOO-.mjs → Help-BW_ar-4B.mjs} +2 -2
  27. package/dist/LineChart-DHj-Bufi.mjs +580 -0
  28. package/dist/{ListItemAction-BNCWQAN_.mjs → ListItemAction-Cbr3417C.mjs} +10 -10
  29. package/dist/{ManageIncome-D_qVX5dN.mjs → ManageIncome-DIIyqDTp.mjs} +85 -85
  30. package/dist/{MicroWidgetContainer-BGpNl5ZS.mjs → MicroWidgetContainer-DSyYwRCU.mjs} +2 -2
  31. package/dist/{MiniWidgetContainer-D7MkHG15.mjs → MiniWidgetContainer-DKn7ndO6.mjs} +1 -1
  32. package/dist/NetWorthStore-B6ziBtaH.mjs +168 -0
  33. package/dist/NotificationSettings-e789PcRb.mjs +676 -0
  34. package/dist/{OriginalBalanceAction-62e0mU_3.mjs → OriginalBalanceAction-DFoG79Ba.mjs} +3 -3
  35. package/dist/{RecurringSettings-RfZ8Wuhh.mjs → RecurringSettings-BpCUcE8w.mjs} +4 -4
  36. package/dist/{RecurringTransactionsStore-D3EOKZ2B.mjs → RecurringTransactionsStore-D_--5PWH.mjs} +1 -1
  37. package/dist/{RecurringTransactions-Bhx56aA3.mjs → RepeatingTransaction-C2txVA9O.mjs} +3 -3
  38. package/dist/{SettingsStore-BASMQSIp.mjs → SettingsStore-CInvh-rQ.mjs} +1 -1
  39. package/dist/SpendingData-B7NuTQ9s.mjs +53 -0
  40. package/dist/SpendingLegend-BxefXiQd.mjs +193 -0
  41. package/dist/TransactionDetails-CPwv9xtZ.mjs +1374 -0
  42. package/dist/{TransactionStore-DgLrYW4C.mjs → TransactionStore-D2aMUClq.mjs} +128 -111
  43. package/dist/TrendsStore-BdsYfCc7.mjs +183 -0
  44. package/dist/{User-DqNX2GAK.mjs → User-CulNdZUr.mjs} +21 -20
  45. package/dist/ViewMoreMicroCard-CDWR16_h.mjs +1147 -0
  46. package/dist/WidgetContainer-mzejMmz2.mjs +555 -0
  47. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +1 -0
  48. package/dist/accounts/index.es.js +933 -232
  49. package/dist/accounts/stores/AccountStore.d.ts +6 -2
  50. package/dist/accounts/utils/AccountDetails.d.ts +5 -0
  51. package/dist/analytics/index.es.js +2 -2
  52. package/dist/budgets/components/AddBudgets.d.ts +2 -1
  53. package/dist/budgets/index.es.js +561 -522
  54. package/dist/cashflow/index.es.js +397 -396
  55. package/dist/categories/components/CustomCategories/AddSubcategory.d.ts +1 -0
  56. package/dist/categories/components/CustomCategories/DeleteSubcategory.d.ts +1 -0
  57. package/dist/categories/components/CustomCategories/RenameSubcategory.d.ts +1 -0
  58. package/dist/categories/components/SubcategoryRow.d.ts +1 -0
  59. package/dist/categories/index.es.js +2 -2
  60. package/dist/categories/stores/CategoryStore.d.ts +5 -3
  61. package/dist/common/components/GlobalAccountFilter.d.ts +11 -0
  62. package/dist/common/components/WidgetContainer.d.ts +7 -6
  63. package/dist/common/components/charts/linechart/CustomTooltip.d.ts +6 -1
  64. package/dist/common/components/charts/stackedlinechart/CustomPointTooltip.d.ts +5 -2
  65. package/dist/common/components/globalaccountfilter/GlobalAccountFilterList.d.ts +7 -0
  66. package/dist/common/components/index.d.ts +2 -2
  67. package/dist/common/hooks/index.d.ts +1 -0
  68. package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
  69. package/dist/common/index.es.js +325 -306
  70. package/dist/common/stores/GlobalUiStore.d.ts +7 -4
  71. package/dist/common/types/localization/AccountsCopy.d.ts +6 -0
  72. package/dist/common/types/localization/CategoryCopy.d.ts +3 -0
  73. package/dist/common/types/localization/CommonCopy.d.ts +3 -0
  74. package/dist/common/types/localization/GoalsCopy.d.ts +3 -1
  75. package/dist/common/types/localization/MicroInsightsCopy.d.ts +1 -0
  76. package/dist/common/types/localization/TransactionsCopy.d.ts +4 -0
  77. package/dist/common/types/localization/TrendsCopy.d.ts +4 -0
  78. package/dist/dashboard/index.es.js +95 -125
  79. package/dist/debts/index.es.js +466 -460
  80. package/dist/{exportTransactionsToCSV-BFpuIAXW.mjs → exportTransactionsToCSV-BU1jTY0Q.mjs} +4 -4
  81. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +4 -5
  82. package/dist/finstrong/index.es.js +1660 -1553
  83. package/dist/goals/index.es.js +716 -677
  84. package/dist/goals/stores/GoalStore.d.ts +2 -0
  85. package/dist/help/index.es.js +14 -10
  86. package/dist/{hooks-C41HAxM5.mjs → hooks-fY_n74f7.mjs} +16 -16
  87. package/dist/investments/index.es.js +464 -457
  88. package/dist/merchants/index.es.js +1 -1
  89. package/dist/microinsights/MicroCardTemplate.d.ts +23 -0
  90. package/dist/microinsights/beaticons/BeatMaterialIcon.d.ts +8 -0
  91. package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +1 -2
  92. package/dist/microinsights/beaticons/index.d.ts +1 -0
  93. package/dist/microinsights/cards/InsightCard.d.ts +0 -2
  94. package/dist/microinsights/cards/ViewMoreMicroCard.d.ts +2 -5
  95. package/dist/microinsights/index.d.ts +2 -2
  96. package/dist/microinsights/index.es.js +824 -14
  97. package/dist/networth/components/NetWorthChart.d.ts +3 -2
  98. package/dist/networth/components/NetWorthList.d.ts +3 -3
  99. package/dist/networth/index.es.js +433 -438
  100. package/dist/networth/stores/NetWorthStore.d.ts +20 -9
  101. package/dist/networth/utils/NetWorthUtils.d.ts +2 -2
  102. package/dist/notifications/index.es.js +5 -5
  103. package/dist/recurringtransactions/index.es.js +331 -325
  104. package/dist/settings/index.es.js +293 -285
  105. package/dist/spending/components/SpendingChart.d.ts +1 -1
  106. package/dist/spending/components/SpendingList.d.ts +1 -1
  107. package/dist/spending/components/SpendingTabLabel.d.ts +1 -0
  108. package/dist/spending/index.es.js +250 -235
  109. package/dist/transactions/index.es.js +288 -281
  110. package/dist/transactions/stores/TransactionStore.d.ts +5 -0
  111. package/dist/trends/components/TrendsTable.d.ts +0 -2
  112. package/dist/trends/index.es.js +876 -802
  113. package/dist/trends/utils/TrendsData.d.ts +1 -0
  114. package/dist/trends/utils/TrendsTable.d.ts +12 -0
  115. package/dist/{useAccountDisplayName-usSZCQ7I.mjs → useAccountDisplayName-DbkgGLdg.mjs} +2 -2
  116. package/dist/useAriaLive-B3_pRUio.mjs +35 -0
  117. package/dist/{useInsightsEnabled-CNjP5cfR.mjs → useInsightsEnabled-dhmXeSyF.mjs} +1 -1
  118. package/dist/useWidgetLoadTimer-CrUzxN-P.mjs +19 -0
  119. package/package.json +26 -21
  120. package/dist/AccountDetailsContent-C1HumFnW.mjs +0 -683
  121. package/dist/AccountDetailsHeader-NMx79DGs.mjs +0 -87
  122. package/dist/CategorySelectorDrawer-DqDAA_5I.mjs +0 -399
  123. package/dist/CategoryStore-MUwRWH9e.mjs +0 -176
  124. package/dist/ConnectDrawer-Dn1MlqLz.mjs +0 -545
  125. package/dist/Drawer-Dqe5EqvA.mjs +0 -163
  126. package/dist/LineChart-bc1D9xBE.mjs +0 -581
  127. package/dist/NetWorthStore-8FFC1Bs0.mjs +0 -150
  128. package/dist/NotificationSettings-BsWiYD94.mjs +0 -672
  129. package/dist/SpendingData-DPQ96k3x.mjs +0 -55
  130. package/dist/SpendingLegend-CZzDb-7d.mjs +0 -193
  131. package/dist/TransactionDetails-Duv1X9ec.mjs +0 -1379
  132. package/dist/TrendsStore-_mRaFUdf.mjs +0 -182
  133. package/dist/ViewMoreMicroCard-CH9E-jOx.mjs +0 -1930
  134. package/dist/WidgetContainer-B1Jzb4XA.mjs +0 -565
  135. package/dist/common/components/accountfilter/AccountFilter.d.ts +0 -20
  136. package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +0 -31
  137. package/dist/common/components/accountfilter/index.d.ts +0 -1
  138. package/dist/microinsights/cards/BaseCard.d.ts +0 -13
  139. package/dist/{ToggleListItem-ciFTiqRS.mjs → Notification-Bs1fdbzI.mjs} +1 -1
@@ -1,683 +0,0 @@
1
- import { jsxs as d, Fragment as g, jsx as t } from "react/jsx-runtime";
2
- import u from "react";
3
- import { observer as S } from "mobx-react-lite";
4
- import H from "@mui/material/Tab";
5
- import nt from "@mui/material/Tabs";
6
- import $ from "@mui/material/List";
7
- import Y from "@mui/material/ListSubheader";
8
- import ot from "@mui/material/Switch";
9
- import { Text as T, Icon as I, THEMES as G } from "@mxenabled/mxui";
10
- import M from "@mui/material/Divider";
11
- import v from "@mui/material/ListItem";
12
- import N from "@mui/material/ListItemButton";
13
- import w from "@mui/material/ListItemText";
14
- import { u as E } from "./AccountDetailsHeader-NMx79DGs.mjs";
15
- import { d as z, u as y, g as O, h as X } from "./hooks-C41HAxM5.mjs";
16
- import { A as at } from "./AccountListItem-DxmAs98Z.mjs";
17
- import { D as V, f as B, a as K } from "./Dialog-CDV0kKxj.mjs";
18
- import { D as J } from "./Drawer-Dqe5EqvA.mjs";
19
- import { A as k } from "./WidgetContainer-B1Jzb4XA.mjs";
20
- import { b as h } from "./Localization-2MODESHW.mjs";
21
- import P from "@mui/material/ListItemAvatar";
22
- import ct from "@mui/material/Stack";
23
- import st from "@mui/material/styles/useTheme";
24
- import { Language as it, Error as q, CheckCircle as rt } from "@mxenabled/mx-icons";
25
- import { n as m, N as Q, l as Z, F as R } from "./ConnectDrawer-Dn1MlqLz.mjs";
26
- import { fromUnixTime as lt } from "date-fns/fromUnixTime";
27
- import { isToday as dt } from "date-fns/isToday";
28
- import { isYesterday as ut } from "date-fns/isYesterday";
29
- import { I as F } from "./IconBacking-DgT8DCeh.mjs";
30
- import { addMonths as _t } from "date-fns/addMonths";
31
- import { alpha as mt } from "@mui/material/styles";
32
- import { AdapterDateFns as pt } from "@mui/x-date-pickers/AdapterDateFnsV3";
33
- import { DateCalendar as ht } from "@mui/x-date-pickers/DateCalendar";
34
- import gt from "@mui/material/FormControl";
35
- import Ct from "@mui/material/InputLabel";
36
- import { LocalizationProvider as ft } from "@mui/x-date-pickers-pro";
37
- import bt from "@mui/material/MenuItem";
38
- import At from "@mui/material/Select";
39
- import Tt from "@mui/material/TextField";
40
- import { C as Dt } from "./CurrencyInput-BrGvhgVK.mjs";
41
- import { b as St } from "./AccountFields-CW6cIthP.mjs";
42
- import Et from "@mui/material/Alert";
43
- import yt from "@mui/material/AlertTitle";
44
- import xt from "@mui/material/Link";
45
- import wt from "@mui/material/Paper";
46
- import { endOfToday as kt, subDays as It, startOfToday as Mt } from "date-fns";
47
- import { T as vt, a as Lt } from "./TransactionDetails-Duv1X9ec.mjs";
48
- import { T as j } from "./TabContentContainer-CnMXkVqr.mjs";
49
- const U = ({
50
- children: e,
51
- isLast: o = !1,
52
- onClick: n,
53
- primaryText: c,
54
- secondaryText: i
55
- }) => /* @__PURE__ */ d(g, { children: [
56
- /* @__PURE__ */ t(v, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ d(N, { onClick: n, children: [
57
- /* @__PURE__ */ t(w, { primary: c, secondary: i }),
58
- e
59
- ] }) }),
60
- /* @__PURE__ */ t(M, { sx: { ml: o ? 0 : 24 } })
61
- ] }), Nt = () => {
62
- const { accounts: e } = z(), { selectedAccount: o, selectedMember: n } = E();
63
- return e.filter(
64
- (c) => c.member_guid === n.guid && n.successfully_aggregated_at && c.guid !== o.guid
65
- );
66
- }, Ot = () => {
67
- const [e, o] = u.useState(!1), [n, c] = u.useState(!1), [i, _] = u.useState(!1), [l, s] = u.useState({}), { selectedAccount: r } = E(), { mergeAccounts: f, updateAccount: b } = z(), { accounts: a } = y(), C = Nt(), { onEvent: D } = O(), { modifyTransactionByAccountGuid: x } = X(), L = async (A) => {
68
- await b({
69
- ...r,
70
- ...A
71
- }), "is_closed" in A && A.is_closed !== r.is_closed && x(r.guid, { accountIsClosed: A.is_closed });
72
- }, p = () => {
73
- f([r.guid, l.guid]).finally(
74
- () => c(!1)
75
- );
76
- };
77
- return /* @__PURE__ */ d(g, { children: [
78
- /* @__PURE__ */ t(Y, { sx: { backgroundColor: "transparent", mb: 4, mt: 12, mx: 8 }, children: /* @__PURE__ */ t(T, { bold: !0, component: "h2", variant: "XSmall", children: a.actions }) }),
79
- /* @__PURE__ */ t(
80
- U,
81
- {
82
- onClick: () => {
83
- L({ is_hidden: !r.is_hidden }), D(k.ACCOUNT_DETAILS_CLICK_HIDE, { account_guid: r.guid });
84
- },
85
- primaryText: r.is_hidden ? a.unhide_account : a.hide_Account,
86
- secondaryText: r.is_hidden ? a.include_this_account : a.exclude_this_account,
87
- children: /* @__PURE__ */ t(ot, { checked: r.is_hidden })
88
- }
89
- ),
90
- /* @__PURE__ */ t(
91
- U,
92
- {
93
- onClick: () => {
94
- o(!0), D(k.ACCOUNT_DETAILS_CLICK_MARK_CLOSED, {
95
- account_guid: r.guid
96
- });
97
- },
98
- primaryText: r.is_closed ? a.mark_as_open : a.mark_as_closed,
99
- secondaryText: r.is_closed ? a.this_will_set_the_closed_account : a.this_will_set_the_account_balance_to_0,
100
- children: /* @__PURE__ */ t(I, { name: "chevron_right" })
101
- }
102
- ),
103
- C.length > 0 && /* @__PURE__ */ t(
104
- U,
105
- {
106
- isLast: !0,
107
- onClick: () => {
108
- c(!0), D(k.ACCOUNT_DETAILS_CLICK_MARK_DUPLICATE, {
109
- account_guid: r.guid
110
- });
111
- },
112
- primaryText: a.mark_as_duplicate,
113
- secondaryText: a.if_a_connected_account_is_showing_up_twice,
114
- children: /* @__PURE__ */ t(I, { name: "chevron_right" })
115
- }
116
- ),
117
- /* @__PURE__ */ t(
118
- V,
119
- {
120
- copy: {
121
- close_aria: a.close_modal,
122
- title: r.is_closed ? a.confirm_mark_as_open : a.confirm_mark_closed
123
- },
124
- isOpen: e,
125
- onClose: () => {
126
- o(!1);
127
- },
128
- onPrimaryAction: () => L({ is_closed: !r.is_closed }),
129
- children: /* @__PURE__ */ t(T, { truncate: !1, children: h(
130
- r.is_closed ? a.this_will_resume_updating_the_balance : a.this_will_set_the_balance_of_your_account,
131
- r.name
132
- ) })
133
- }
134
- ),
135
- /* @__PURE__ */ t(
136
- J,
137
- {
138
- ariaLabelClose: a.close_drawer,
139
- isOpen: n,
140
- onClose: () => c(!1),
141
- title: a.mark_as_duplicate,
142
- children: /* @__PURE__ */ t($, { children: C.map((A) => {
143
- const et = C.indexOf(A) === C.length - 1;
144
- return /* @__PURE__ */ d(u.Fragment, { children: [
145
- /* @__PURE__ */ t(
146
- at,
147
- {
148
- account: A,
149
- onRowClick: () => {
150
- _(!0), s(A);
151
- }
152
- }
153
- ),
154
- /* @__PURE__ */ t($, { sx: { ml: et ? 0 : 24 } })
155
- ] }, A.guid);
156
- }) })
157
- }
158
- ),
159
- i && /* @__PURE__ */ d(
160
- V,
161
- {
162
- copy: {
163
- close_aria: a.close_modal,
164
- title: a.confirm_merge
165
- },
166
- isOpen: i,
167
- onClose: () => _(!1),
168
- onPrimaryAction: p,
169
- children: [
170
- /* @__PURE__ */ t(T, { truncate: !1, children: h(
171
- a.this_means_accounts_will_be_merged,
172
- r.name,
173
- l.name
174
- ) }),
175
- /* @__PURE__ */ t(T, { color: "error", sx: { mt: 24 }, children: a.this_action_cannot_be_undone })
176
- ]
177
- }
178
- )
179
- ] });
180
- }, Pt = S(Ot), tt = (e, o) => {
181
- const { connection_messages: n } = o;
182
- switch (e.connection_status) {
183
- case m.CHALLENGED:
184
- return {
185
- cta: n.challenged_cta,
186
- main: h(
187
- n.challenged_connection_description,
188
- e.name
189
- ),
190
- statusName: o.connection_statuses[e.connection_status],
191
- title: n.challenged_connection_title
192
- };
193
- case m.CLOSED:
194
- return {
195
- main: n.closed_connection_description,
196
- statusName: o.connection_statuses[e.connection_status],
197
- title: n.closed_connection_title
198
- };
199
- case m.DEGRADED:
200
- return {
201
- main: n.degraded_connection_description,
202
- statusName: o.connection_statuses[e.connection_status],
203
- title: n.degraded_connection_title
204
- };
205
- case m.DELAYED:
206
- return {
207
- main: h(
208
- n.delayed_connection_description,
209
- e.name
210
- ),
211
- statusName: o.connection_statuses[e.connection_status],
212
- title: n.delayed_connection_title
213
- };
214
- case m.DENIED:
215
- return {
216
- cta: n.denied_cta,
217
- main: h(
218
- n.denied_connection_description,
219
- e.name
220
- ),
221
- statusName: o.connection_statuses[e.connection_status],
222
- title: n.denied_connection_title
223
- };
224
- case m.DISABLED:
225
- return {
226
- main: n.disabled_connection_description,
227
- statusName: o.connection_statuses[e.connection_status],
228
- title: n.disabled_connection_title
229
- };
230
- case m.DISCONNECTED:
231
- return {
232
- main: h(
233
- n.disconnected_connection_description,
234
- e.name
235
- ),
236
- statusName: o.connection_statuses[e.connection_status],
237
- title: n.disconnected_connection_title
238
- };
239
- case m.DISCONTINUED:
240
- return {
241
- main: n.discontinued_connection_description,
242
- statusName: o.connection_statuses[e.connection_status],
243
- title: n.discontinued_connection_title
244
- };
245
- case m.EXPIRED:
246
- return {
247
- cta: n.expired_cta,
248
- main: n.expired_connection_description,
249
- statusName: o.connection_statuses[e.connection_status],
250
- title: n.expired_connection_title
251
- };
252
- case m.FAILED:
253
- return {
254
- main: h(
255
- n.failed_connection_description,
256
- e.name
257
- ),
258
- statusName: o.connection_statuses[e.connection_status],
259
- title: n.failed_connection_title
260
- };
261
- case m.IMPAIRED:
262
- return {
263
- cta: n.impaired_cta,
264
- main: h(
265
- n.impaired_connection_description,
266
- e.name
267
- ),
268
- statusName: o.connection_statuses[e.connection_status],
269
- title: n.impaired_connection_title
270
- };
271
- case m.IMPEDED:
272
- return {
273
- main: h(
274
- n.impeded_connection_description,
275
- e.name,
276
- e.name
277
- ),
278
- statusName: o.connection_statuses[e.connection_status],
279
- title: n.impeded_connection_title
280
- };
281
- case m.IMPORTED:
282
- return {
283
- cta: n.imported_cta,
284
- main: h(
285
- n.imported_connection_description,
286
- e.name
287
- ),
288
- statusName: o.connection_statuses[e.connection_status],
289
- title: n.imported_connection_title
290
- };
291
- case m.LOCKED:
292
- return {
293
- cta: n.locked_cta,
294
- main: h(
295
- n.locked_connection_description,
296
- e.name
297
- ),
298
- statusName: o.connection_statuses[e.connection_status],
299
- title: n.locked_connection_title
300
- };
301
- case m.PREVENTED:
302
- return {
303
- cta: n.prevented_cta,
304
- main: n.prevented_connection_description,
305
- statusName: o.connection_statuses[e.connection_status],
306
- title: n.prevented_connection_title
307
- };
308
- case m.REJECTED:
309
- return {
310
- cta: n.rejected_cta,
311
- main: n.rejected_connection_description,
312
- statusName: o.connection_statuses[e.connection_status],
313
- title: n.rejected_connection_title
314
- };
315
- default: {
316
- const c = () => {
317
- const i = e.successfully_aggregated_at ? lt(e.successfully_aggregated_at) : void 0, _ = i && B(i, K.TIME_STAMP_HOUR_MINUTE);
318
- if (_)
319
- return dt(i) ? h(o.last_updated_at, o.today, _) : ut(i) ? h(o.last_updated_at, o.yesterday, _) : h(
320
- o.last_updated_at,
321
- B(i, K.MONTH_DAY_YEAR),
322
- _
323
- );
324
- };
325
- return {
326
- statusName: o.connection_statuses[6],
327
- // Connected
328
- title: c()
329
- };
330
- }
331
- }
332
- }, W = {
333
- color: "background.default",
334
- fontSize: 20,
335
- gridRow: 1,
336
- gridColumn: 1,
337
- zIndex: 2
338
- }, Rt = () => {
339
- const [e, o] = u.useState(!1), {
340
- palette: { mode: n }
341
- } = st(), { selectedMember: c } = E(), { accounts: i, connect: _ } = y(), l = tt(c, _), s = Q.includes(c.connection_status) ? {
342
- color: "error.main",
343
- ctaCopy: l.cta ?? "",
344
- icon: /* @__PURE__ */ t(q, { filled: !0, sx: { ...W } }),
345
- mainMessage: l.statusName,
346
- secondaryMessage: `${l.title}.`
347
- } : {
348
- color: "success.main",
349
- icon: /* @__PURE__ */ t(rt, { filled: !0, sx: { ...W } }),
350
- mainMessage: l.statusName,
351
- secondaryMessage: l.title
352
- };
353
- return /* @__PURE__ */ d(g, { children: [
354
- /* @__PURE__ */ t(Y, { sx: { mb: 4, mt: 12, mx: 8 }, children: /* @__PURE__ */ t(T, { bold: !0, component: "h2", variant: "XSmall", children: i.connection_status }) }),
355
- /* @__PURE__ */ t(v, { sx: { backgroundColor: "background.paper" }, children: c.is_manual || !s.ctaCopy ? /* @__PURE__ */ d(ct, { alignItems: "center", direction: "row", px: 24, py: 12, children: [
356
- /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(F, { backingSx: { backgroundColor: s.color, borderRadius: 1 }, size: 32, children: s.icon }) }),
357
- /* @__PURE__ */ t(w, { primary: s.mainMessage, secondary: s.secondaryMessage })
358
- ] }) : /* @__PURE__ */ d(N, { onClick: () => o(!0), children: [
359
- /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(F, { backingSx: { backgroundColor: s.color, borderRadius: 1 }, size: 32, children: s.icon }) }),
360
- /* @__PURE__ */ t(
361
- w,
362
- {
363
- primary: s.mainMessage,
364
- secondary: s.secondaryMessage && /* @__PURE__ */ d(g, { children: [
365
- s.secondaryMessage,
366
- " ",
367
- /* @__PURE__ */ t(T, { bold: !0, sx: { color: "action.active" }, variant: "XSmall", children: s.ctaCopy })
368
- ] })
369
- }
370
- ),
371
- /* @__PURE__ */ t(I, { name: "chevron_right" })
372
- ] }) }),
373
- /* @__PURE__ */ t(M, { sx: { ml: c.is_manual || !c.institution_url ? 0 : 24 } }),
374
- !c.is_manual && c.institution_url && /* @__PURE__ */ d(g, { children: [
375
- /* @__PURE__ */ t(v, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ d(N, { component: "a", href: c.institution_url, target: "_blank", children: [
376
- /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(
377
- F,
378
- {
379
- backingSx: {
380
- backgroundColor: n === G.LIGHT ? "grey.300" : "grey.700",
381
- borderRadius: 1
382
- },
383
- size: 32,
384
- children: /* @__PURE__ */ t(
385
- it,
386
- {
387
- sx: {
388
- ...W,
389
- color: n === G.LIGHT ? "grey.900" : "common.white"
390
- }
391
- }
392
- )
393
- }
394
- ) }),
395
- /* @__PURE__ */ t(w, { primary: c.name, secondary: c.institution_url }),
396
- /* @__PURE__ */ t(I, { name: "launch" })
397
- ] }) }),
398
- /* @__PURE__ */ t(M, {})
399
- ] }),
400
- e && /* @__PURE__ */ t(
401
- Z,
402
- {
403
- loadWidgetProps: { current_member_guid: c.guid },
404
- onClose: () => o(!1),
405
- showConnectWidget: e,
406
- title: i.manage_connection
407
- }
408
- )
409
- ] });
410
- }, Ft = S(Rt), Ut = ({ field: e, isOpen: o, onClose: n }) => {
411
- const { updateAccount: c } = z(), { selectedAccount: i } = E(), { accounts: _ } = y(), [l, s] = u.useState(i[e.name]), [r, f] = u.useState(""), [b, a] = u.useState(!0), C = () => {
412
- s(""), f(""), n();
413
- }, D = () => {
414
- switch (e.type) {
415
- case R.Select:
416
- return /* @__PURE__ */ d(gt, { fullWidth: !0, children: [
417
- /* @__PURE__ */ t(Ct, { id: `${e.label}-select-label`, children: e.label }),
418
- /* @__PURE__ */ t(
419
- At,
420
- {
421
- id: `${e.label}-select`,
422
- inputProps: {
423
- sx: {
424
- backgroundColor: "background.paper"
425
- }
426
- },
427
- label: e.label,
428
- labelId: `${e.label}-select-label`,
429
- onChange: (p) => s(p.target.value),
430
- placeholder: e.placeholder,
431
- value: l,
432
- children: e.options?.map((p) => /* @__PURE__ */ t(bt, { value: p.value, children: p.label }, p.value))
433
- }
434
- )
435
- ] });
436
- case R.Currency:
437
- return /* @__PURE__ */ t(
438
- Dt,
439
- {
440
- amount: l || "",
441
- ariaLabel: e.placeholder,
442
- fullWidth: !0,
443
- label: e.label,
444
- placeholder: e.placeholder,
445
- setAmount: s,
446
- setHasValidInput: a
447
- }
448
- );
449
- case R.Date:
450
- return /* @__PURE__ */ t(ft, { dateAdapter: pt, children: /* @__PURE__ */ t(
451
- ht,
452
- {
453
- maxDate: _t(/* @__PURE__ */ new Date(), 1),
454
- minDate: /* @__PURE__ */ new Date(),
455
- onChange: (p) => {
456
- i[e.name] && Number(i[e.name]) <= 31 ? s(p.getDate()) : s(p);
457
- },
458
- sx: {
459
- "& .MuiPickersDay-today": {
460
- color: "primary.lighter"
461
- },
462
- "& .MuiPickersArrowSwitcher-button": {
463
- color: "primary.lighter",
464
- "&:hover": {
465
- backgroundColor: (p) => mt(p.palette.primary.light, 0.1)
466
- }
467
- }
468
- },
469
- views: ["day"]
470
- }
471
- ) });
472
- default:
473
- return /* @__PURE__ */ t(
474
- Tt,
475
- {
476
- defaultValue: i[e.name],
477
- error: !!r,
478
- fullWidth: !0,
479
- helperText: r,
480
- inputProps: {
481
- "aria-label": e.placeholder
482
- },
483
- onChange: L,
484
- placeholder: e.placeholder
485
- }
486
- );
487
- }
488
- }, x = () => {
489
- i[e.name] !== l && c({
490
- ...i,
491
- [e.name]: l
492
- }), C();
493
- }, L = (p) => {
494
- s(p.target.value), e.validation && f(e.validation(p.target.value));
495
- };
496
- return /* @__PURE__ */ t(
497
- V,
498
- {
499
- copy: {
500
- close_aria: _.close_aria,
501
- title: h(_.edit_field, e.label)
502
- },
503
- disablePrimaryButton: !!r || !b,
504
- isOpen: o,
505
- onClose: C,
506
- onPrimaryAction: x,
507
- primaryText: _.save,
508
- children: D()
509
- }
510
- );
511
- }, Wt = S(Ut), $t = () => {
512
- const e = window.app?.config, { onEvent: o } = O(), { selectedAccount: n } = E(), { accounts: c } = y(), i = St(n, c), _ = n.member_is_managed_by_user || !n.member_is_managed_by_user && e.enable_renaming_home_accounts, [l, s] = u.useState(!1), [r, f] = u.useState(i[0]), b = i.filter(
513
- (a) => _ || n[a.name] || n[a.name] === 0
514
- );
515
- return /* @__PURE__ */ d(g, { children: [
516
- b.map((a) => {
517
- const C = n[a.name] || n[a.name] === 0, D = b.indexOf(a) === b.length - 1, x = /* @__PURE__ */ t(
518
- w,
519
- {
520
- disableTypography: !0,
521
- primary: /* @__PURE__ */ t(T, { sx: { fontSize: 11 }, children: a.label }),
522
- secondary: /* @__PURE__ */ t(T, { bold: !0, sx: { fontSize: 15 }, children: C ? a.valueFormatter(n[a.name]) : a.placeholder })
523
- }
524
- );
525
- return /* @__PURE__ */ t(u.Fragment, { children: _ ? /* @__PURE__ */ d(g, { children: [
526
- /* @__PURE__ */ t(v, { sx: { backgroundColor: "background.paper", px: 0 }, children: /* @__PURE__ */ d(
527
- N,
528
- {
529
- onClick: () => {
530
- f(a), s(!0), a?.event && o(a.event, { account_guid: n.guid });
531
- },
532
- children: [
533
- x,
534
- /* @__PURE__ */ t(I, { name: "chevron_right" })
535
- ]
536
- }
537
- ) }),
538
- /* @__PURE__ */ t(M, { sx: { ml: D ? 0 : 24 } })
539
- ] }) : C && /* @__PURE__ */ d(g, { children: [
540
- /* @__PURE__ */ t(v, { sx: { backgroundColor: "background.paper", px: 24 }, children: x }),
541
- /* @__PURE__ */ t(M, { sx: { ml: D ? 0 : 24 } })
542
- ] }) }, a.name);
543
- }),
544
- l && r && /* @__PURE__ */ t(
545
- Wt,
546
- {
547
- field: r,
548
- isOpen: l,
549
- onClose: () => s(!1)
550
- }
551
- )
552
- ] });
553
- }, Vt = S($t), zt = () => {
554
- const { onEvent: e } = O();
555
- return u.useEffect(() => e(k.ACCOUNT_DETAILS_VIEW), []), /* @__PURE__ */ d($, { children: [
556
- /* @__PURE__ */ t(Vt, {}),
557
- /* @__PURE__ */ t(Ft, {}),
558
- /* @__PURE__ */ t(Pt, {})
559
- ] });
560
- }, Ht = S(zt), Gt = ({ setTabValue: e }) => {
561
- const [o, n] = u.useState(!1), { selectedMember: c } = E(), { accounts: i, connect: _ } = y(), l = c.connection_status && Q.includes(c.connection_status);
562
- if (u.useEffect(() => {
563
- l && e(1);
564
- }, [l]), !l) return;
565
- const s = tt(c, _);
566
- return /* @__PURE__ */ d(g, { children: [
567
- /* @__PURE__ */ t(
568
- wt,
569
- {
570
- sx: {
571
- mb: 16,
572
- mt: 24,
573
- mx: 24
574
- },
575
- children: /* @__PURE__ */ d(
576
- Et,
577
- {
578
- icon: /* @__PURE__ */ t(q, { filled: !0 }),
579
- severity: "error",
580
- sx: {
581
- borderLeft: 5,
582
- borderTopLeftRadius: 6,
583
- borderBottomLeftRadius: 6,
584
- borderColor: "error.main",
585
- color: "text.primary",
586
- "&.MuiPaper-root": {
587
- backgroundColor: "background.paper"
588
- }
589
- },
590
- children: [
591
- s.title && /* @__PURE__ */ t(yt, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: s.title }),
592
- /* @__PURE__ */ t(T, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children: s.main }),
593
- s.cta && /* @__PURE__ */ t(
594
- xt,
595
- {
596
- onClick: () => n(!0),
597
- sx: { fontSize: 15, fontWeight: 600, ml: 0 },
598
- children: s.cta
599
- }
600
- )
601
- ]
602
- }
603
- )
604
- }
605
- ),
606
- o && /* @__PURE__ */ t(
607
- Z,
608
- {
609
- loadWidgetProps: { current_member_guid: c.guid },
610
- onClose: () => n(!1),
611
- showConnectWidget: o,
612
- title: i.manage_connection
613
- }
614
- )
615
- ] });
616
- }, Bt = S(Gt), Kt = () => {
617
- const [e, o] = u.useState(""), { onEvent: n } = O(), { selectedAccount: c } = E(), { accounts: i } = y(), { isTransactionDataLoaded: _, loadTransactionData: l, setFilter: s, sortedTransactions: r } = X();
618
- u.useEffect(() => {
619
- _ || l().finally();
620
- }, []);
621
- const f = u.useMemo(
622
- () => r.find((b) => b.guid === e),
623
- [e, r]
624
- );
625
- return u.useEffect(() => {
626
- s({
627
- dateRange: { start: It(Mt(), 90), end: kt() },
628
- accounts: [c.guid]
629
- });
630
- }, [c]), u.useEffect(() => n(k.ACCOUNT_DETAILS_VIEW_TRANSACTIONS), []), /* @__PURE__ */ d(g, { children: [
631
- /* @__PURE__ */ t(vt, { onClick: o }),
632
- f && /* @__PURE__ */ t(
633
- J,
634
- {
635
- ariaLabelClose: i.close_drawer,
636
- isOpen: !!e,
637
- onClose: () => o(""),
638
- title: i.transaction_drawer_title,
639
- children: /* @__PURE__ */ t(Lt, { transaction: f })
640
- }
641
- )
642
- ] });
643
- }, jt = S(Kt), Yt = () => {
644
- const [e, o] = u.useState(0), { accounts: n } = y();
645
- return /* @__PURE__ */ d(g, { children: [
646
- /* @__PURE__ */ t(Bt, { setTabValue: o }),
647
- /* @__PURE__ */ d(
648
- nt,
649
- {
650
- "aria-label": n.transactions_and_details_aria,
651
- centered: !0,
652
- onChange: (c, i) => o(i),
653
- textColor: "primary",
654
- value: e,
655
- variant: "fullWidth",
656
- children: [
657
- /* @__PURE__ */ t(
658
- H,
659
- {
660
- "aria-controls": "transaction-details-tabpanel-0",
661
- id: "transaction-details-tab-0",
662
- label: n.transactions
663
- }
664
- ),
665
- /* @__PURE__ */ t(
666
- H,
667
- {
668
- "aria-controls": "account-details-tabpanel-1",
669
- id: "account-details-tab-1",
670
- label: n.account_details
671
- }
672
- )
673
- ]
674
- }
675
- ),
676
- /* @__PURE__ */ t(j, { index: 0, name: "transaction-details", value: e, children: /* @__PURE__ */ t(jt, {}) }),
677
- /* @__PURE__ */ t(j, { index: 1, name: "account-details", value: e, children: /* @__PURE__ */ t(Ht, {}) })
678
- ] });
679
- }, He = S(Yt);
680
- export {
681
- He as A,
682
- Nt as u
683
- };