@mx-cartographer/experiences 6.26.18-alpha.mega4 → 6.26.18-alpha.sms1

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 (97) hide show
  1. package/dist/common/context/hooks.d.ts +13 -13
  2. package/dist/help/components/content/section/index.d.ts +15 -15
  3. package/dist/index.d.ts +22 -0
  4. package/dist/index.es.js +30335 -0
  5. package/dist/index.es.js.map +1 -0
  6. package/package.json +3 -155
  7. package/dist/Account-DM32_5k9.mjs +0 -30
  8. package/dist/AccountDetailsContent-B_qRSB8l.mjs +0 -677
  9. package/dist/AccountDetailsHeader-CAm6ADMq.mjs +0 -119
  10. package/dist/AccountFields-Bb4pds0q.mjs +0 -135
  11. package/dist/AccountListItem-G7iAesaO.mjs +0 -90
  12. package/dist/AccountStore-RSanus_m.mjs +0 -230
  13. package/dist/Accounts-BfAQRG8R.mjs +0 -9
  14. package/dist/BeatApi-DLu87ijw.mjs +0 -21
  15. package/dist/BeatStore-By4aGoRM.mjs +0 -81
  16. package/dist/BudgetUtil-DcqclhiQ.mjs +0 -101
  17. package/dist/CashflowStore-D9Dpuz7X.mjs +0 -91
  18. package/dist/Category-5S6uwuXz.mjs +0 -301
  19. package/dist/CategorySelectorDrawer-DgrePTRg.mjs +0 -397
  20. package/dist/CategoryStore-B5EW6I1d.mjs +0 -183
  21. package/dist/CategoryUtil-DRyruNgi.mjs +0 -78
  22. package/dist/ConnectDrawer-DPnfeIfn.mjs +0 -508
  23. package/dist/ConnectionsDrawer-BCzpuNsK.mjs +0 -52
  24. package/dist/CurrencyInput-DzsPiUsU.mjs +0 -83
  25. package/dist/CurrencyText-YUhH2caW.mjs +0 -20
  26. package/dist/DateUtil-BcuH7ErC.mjs +0 -48
  27. package/dist/DebtsStore-C6VcBnpG.mjs +0 -60
  28. package/dist/Dialog-CWW597AF.mjs +0 -123
  29. package/dist/Donut-1UMNcG67.mjs +0 -57
  30. package/dist/Drawer-kEE73B87.mjs +0 -113
  31. package/dist/EmptyState-Dcb-o2tl.mjs +0 -55
  32. package/dist/Fetch-CkFKy79O.mjs +0 -116
  33. package/dist/FinstrongStore-mkALvztw.mjs +0 -101
  34. package/dist/GoalStore-DyCr4wNc.mjs +0 -263
  35. package/dist/HeaderCell-DjuifqHJ.mjs +0 -6
  36. package/dist/Help-DhcC-C05.mjs +0 -320
  37. package/dist/Help-toqAK5eD.mjs +0 -3173
  38. package/dist/IconBacking-B9oC6uL2.mjs +0 -39
  39. package/dist/InvestmentUtil-jOyOgzIB.mjs +0 -134
  40. package/dist/LineChart-CQWu5KoO.mjs +0 -403
  41. package/dist/ListItemAction-Df3OPMOW.mjs +0 -69
  42. package/dist/Loader-Dp1P2gNw.mjs +0 -14
  43. package/dist/Localization-2MODESHW.mjs +0 -30
  44. package/dist/ManageIncome-BVt_XQbo.mjs +0 -535
  45. package/dist/MerchantStore-DVH-QOf0.mjs +0 -37
  46. package/dist/MicroWidgetContainer-DaLW43tE.mjs +0 -45
  47. package/dist/MiniWidgetContainer-BcNPxZt2.mjs +0 -39
  48. package/dist/NetWorthStore-DE8CQBMM.mjs +0 -150
  49. package/dist/Notification-AMGWM1Al.mjs +0 -78
  50. package/dist/NotificationSettings-CPZN0l8X.mjs +0 -667
  51. package/dist/NotificationStore-DHtSGySy.mjs +0 -67
  52. package/dist/NumberFormatting-CtWHhyBX.mjs +0 -40
  53. package/dist/OriginalBalanceAction-s9sUxofR.mjs +0 -115
  54. package/dist/RecurringSettings-DIEsympT.mjs +0 -57
  55. package/dist/RecurringTransactionsStore-BKLD3OWo.mjs +0 -263
  56. package/dist/RepeatingTransaction-BPWfaB3f.mjs +0 -282
  57. package/dist/SearchBox-B2_zLv8-.mjs +0 -42
  58. package/dist/SettingsStore-CE7jDVFL.mjs +0 -265
  59. package/dist/SingleSegmentDonut-BgbLgwHi.mjs +0 -69
  60. package/dist/SpendingData-ByFCw95X.mjs +0 -53
  61. package/dist/StatusBar-BK_uYHAB.mjs +0 -30
  62. package/dist/TabContentContainer-j01JYR_7.mjs +0 -21
  63. package/dist/Transaction-C-5-Iuab.mjs +0 -312
  64. package/dist/TransactionApi-DbbcjI2L.mjs +0 -86
  65. package/dist/TransactionDetails-B5qfs9Zh.mjs +0 -1283
  66. package/dist/TransactionStore-BWi6_2Ny.mjs +0 -669
  67. package/dist/TrendsStore-Borh98aN.mjs +0 -448
  68. package/dist/ViewMoreMicroCard-CAPFNz-J.mjs +0 -1959
  69. package/dist/WidgetContainer-CmGNZW0M.mjs +0 -548
  70. package/dist/accounts/index.es.js +0 -752
  71. package/dist/analytics/index.es.js +0 -171
  72. package/dist/budgets/index.es.js +0 -1070
  73. package/dist/cashflow/index.es.js +0 -1098
  74. package/dist/categories/index.es.js +0 -9
  75. package/dist/common/index.es.js +0 -1451
  76. package/dist/dashboard/index.es.js +0 -181
  77. package/dist/debts/index.es.js +0 -1460
  78. package/dist/exportTransactionsToCSV-j4g8bdVZ.mjs +0 -47
  79. package/dist/finstrong/index.es.js +0 -1455
  80. package/dist/goals/index.es.js +0 -1209
  81. package/dist/help/index.es.js +0 -14
  82. package/dist/hooks-ClhFlg78.mjs +0 -71
  83. package/dist/insights/index.d.ts +0 -1
  84. package/dist/insights/index.es.js +0 -4
  85. package/dist/investments/index.es.js +0 -1638
  86. package/dist/merchants/index.es.js +0 -79
  87. package/dist/microinsights/index.es.js +0 -16
  88. package/dist/networth/index.es.js +0 -542
  89. package/dist/notifications/index.es.js +0 -192
  90. package/dist/recurringtransactions/index.es.js +0 -879
  91. package/dist/settings/index.es.js +0 -879
  92. package/dist/spending/index.es.js +0 -570
  93. package/dist/transactions/index.es.js +0 -587
  94. package/dist/trends/index.es.js +0 -1103
  95. package/dist/useCombineEvents-DaDBSR_1.mjs +0 -92
  96. package/dist/useDimensions-27p2evRx.mjs +0 -36
  97. package/dist/useScreenSize-B6JyS_Lj.mjs +0 -36
@@ -1,677 +0,0 @@
1
- import { jsxs as d, Fragment as g, jsx as t } from "react/jsx-runtime";
2
- import _ from "react";
3
- import { observer as b } 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 S, Icon as k, 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 D } from "./AccountDetailsHeader-CAm6ADMq.mjs";
15
- import { c as z, u as E, g as O, n as X } from "./hooks-ClhFlg78.mjs";
16
- import { A as at } from "./AccountListItem-G7iAesaO.mjs";
17
- import { A as I } from "./WidgetContainer-CmGNZW0M.mjs";
18
- import { a as V, f as B, D as j } from "./Dialog-CWW597AF.mjs";
19
- import { b as h } from "./Localization-2MODESHW.mjs";
20
- import { D as J } from "./Drawer-kEE73B87.mjs";
21
- import ct from "@mui/icons-material/CheckCircleRounded";
22
- import q from "@mui/icons-material/Error";
23
- import st from "@mui/icons-material/LanguageRounded";
24
- import R from "@mui/material/ListItemAvatar";
25
- import it from "@mui/material/Stack";
26
- import rt from "@mui/material/styles/useTheme";
27
- import { k as m, N as Q, j as Z, F as P } from "./ConnectDrawer-DPnfeIfn.mjs";
28
- import { fromUnixTime as lt } from "date-fns/fromUnixTime";
29
- import { isToday as dt } from "date-fns/isToday";
30
- import { isYesterday as ut } from "date-fns/isYesterday";
31
- import { I as F } from "./IconBacking-B9oC6uL2.mjs";
32
- import { addMonths as _t } from "date-fns/addMonths";
33
- import { alpha as mt } from "@mui/material/styles";
34
- import { AdapterDateFns as pt } from "@mui/x-date-pickers/AdapterDateFnsV3";
35
- import { DateCalendar as ht } from "@mui/x-date-pickers/DateCalendar";
36
- import gt from "@mui/material/FormControl";
37
- import Ct from "@mui/material/InputLabel";
38
- import { LocalizationProvider as ft } from "@mui/x-date-pickers-pro";
39
- import At from "@mui/material/MenuItem";
40
- import bt from "@mui/material/Select";
41
- import Tt from "@mui/material/TextField";
42
- import { C as St } from "./CurrencyInput-DzsPiUsU.mjs";
43
- import { a as Dt } from "./AccountFields-Bb4pds0q.mjs";
44
- import Et from "@mui/material/Alert";
45
- import yt from "@mui/material/AlertTitle";
46
- import xt from "@mui/material/Link";
47
- import wt from "@mui/material/Paper";
48
- import { subDays as It, startOfToday as kt, endOfToday as Mt } from "date-fns";
49
- import { T as vt, a as Lt } from "./TransactionDetails-B5qfs9Zh.mjs";
50
- import { T as K } from "./TabContentContainer-j01JYR_7.mjs";
51
- const U = ({
52
- children: e,
53
- isLast: o = !1,
54
- onClick: n,
55
- primaryText: c,
56
- secondaryText: i
57
- }) => /* @__PURE__ */ d(g, { children: [
58
- /* @__PURE__ */ t(v, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ d(N, { onClick: n, children: [
59
- /* @__PURE__ */ t(w, { primary: c, secondary: i }),
60
- e
61
- ] }) }),
62
- /* @__PURE__ */ t(M, { sx: { ml: o ? 0 : 24 } })
63
- ] }), Nt = () => {
64
- const { accounts: e } = z(), { selectedAccount: o, selectedMember: n } = D();
65
- return e.filter(
66
- (c) => c.member_guid === n.guid && n.successfully_aggregated_at && c.guid !== o.guid
67
- );
68
- }, Ot = () => {
69
- const [e, o] = _.useState(!1), [n, c] = _.useState(!1), [i, u] = _.useState(!1), [l, s] = _.useState({}), { selectedAccount: r } = D(), { mergeAccounts: y, updateAccount: T } = z(), { accounts: a } = E(), C = Nt(), { onEvent: A } = O(), { modifyTransactionByAccountGuid: x } = X(), L = async (f) => {
70
- await T({
71
- ...r,
72
- ...f
73
- }), "is_closed" in f && f.is_closed !== r.is_closed && x(r.guid, { accountIsClosed: f.is_closed });
74
- }, p = () => {
75
- y([r.guid, l.guid]).finally(
76
- () => c(!1)
77
- );
78
- };
79
- return /* @__PURE__ */ d(g, { children: [
80
- /* @__PURE__ */ t(Y, { sx: { backgroundColor: "transparent", mb: 4, mt: 12, mx: 8 }, children: /* @__PURE__ */ t(S, { bold: !0, component: "h2", variant: "XSmall", children: a.actions }) }),
81
- /* @__PURE__ */ t(
82
- U,
83
- {
84
- onClick: () => {
85
- L({ is_hidden: !r.is_hidden }), A(I.ACCOUNT_DETAILS_CLICK_HIDE, { account_guid: r.guid });
86
- },
87
- primaryText: r.is_hidden ? a.unhide_account : a.hide_Account,
88
- secondaryText: r.is_hidden ? a.include_this_account : a.exclude_this_account,
89
- children: /* @__PURE__ */ t(ot, { checked: r.is_hidden })
90
- }
91
- ),
92
- /* @__PURE__ */ t(
93
- U,
94
- {
95
- onClick: () => {
96
- o(!0), A(I.ACCOUNT_DETAILS_CLICK_MARK_CLOSED, {
97
- account_guid: r.guid
98
- });
99
- },
100
- primaryText: r.is_closed ? a.mark_as_open : a.mark_as_closed,
101
- secondaryText: r.is_closed ? a.this_will_set_the_closed_account : a.this_will_set_the_account_balance_to_0,
102
- children: /* @__PURE__ */ t(k, { name: "chevron_right" })
103
- }
104
- ),
105
- C.length > 0 && /* @__PURE__ */ t(
106
- U,
107
- {
108
- isLast: !0,
109
- onClick: () => {
110
- c(!0), A(I.ACCOUNT_DETAILS_CLICK_MARK_DUPLICATE, {
111
- account_guid: r.guid
112
- });
113
- },
114
- primaryText: a.mark_as_duplicate,
115
- secondaryText: a.if_a_connected_account_is_showing_up_twice,
116
- children: /* @__PURE__ */ t(k, { name: "chevron_right" })
117
- }
118
- ),
119
- /* @__PURE__ */ t(
120
- V,
121
- {
122
- copy: {
123
- close_aria: a.close_modal,
124
- title: r.is_closed ? a.confirm_mark_as_open : a.confirm_mark_closed
125
- },
126
- isOpen: e,
127
- onClose: () => {
128
- o(!1);
129
- },
130
- onPrimaryAction: () => L({ is_closed: !r.is_closed }),
131
- children: h(
132
- r.is_closed ? a.this_will_resume_updating_the_balance : a.this_will_set_the_balance_of_your_account,
133
- r.name
134
- )
135
- }
136
- ),
137
- /* @__PURE__ */ t(
138
- J,
139
- {
140
- ariaLabelClose: a.close_drawer,
141
- isOpen: n,
142
- onClose: () => c(!1),
143
- title: a.mark_as_duplicate,
144
- children: /* @__PURE__ */ t($, { children: C.map((f) => {
145
- const et = C.indexOf(f) === C.length - 1;
146
- return /* @__PURE__ */ d(_.Fragment, { children: [
147
- /* @__PURE__ */ t(
148
- at,
149
- {
150
- account: f,
151
- onRowClick: () => {
152
- u(!0), s(f);
153
- }
154
- }
155
- ),
156
- /* @__PURE__ */ t($, { sx: { ml: et ? 0 : 24 } })
157
- ] }, f.guid);
158
- }) })
159
- }
160
- ),
161
- i && /* @__PURE__ */ d(
162
- V,
163
- {
164
- copy: {
165
- close_aria: a.close_modal,
166
- title: a.confirm_merge
167
- },
168
- isOpen: i,
169
- onClose: () => u(!1),
170
- onPrimaryAction: p,
171
- children: [
172
- h(
173
- a.this_means_accounts_will_be_merged,
174
- r.name,
175
- l.name
176
- ),
177
- /* @__PURE__ */ t(S, { color: "error", sx: { mt: 24 }, children: a.this_action_cannot_be_undone })
178
- ]
179
- }
180
- )
181
- ] });
182
- }, Rt = b(Ot), tt = (e, o) => {
183
- const { connection_messages: n } = o;
184
- switch (e.connection_status) {
185
- case m.CHALLENGED:
186
- return {
187
- cta: n.challenged_cta,
188
- main: h(
189
- n.challenged_connection_description,
190
- e.name
191
- ),
192
- statusName: o.connection_statuses[e.connection_status],
193
- title: n.challenged_connection_title
194
- };
195
- case m.CLOSED:
196
- return {
197
- main: n.closed_connection_description,
198
- statusName: o.connection_statuses[e.connection_status],
199
- title: n.closed_connection_title
200
- };
201
- case m.DEGRADED:
202
- return {
203
- main: n.degraded_connection_description,
204
- statusName: o.connection_statuses[e.connection_status],
205
- title: n.degraded_connection_title
206
- };
207
- case m.DELAYED:
208
- return {
209
- main: h(
210
- n.delayed_connection_description,
211
- e.name
212
- ),
213
- statusName: o.connection_statuses[e.connection_status],
214
- title: n.delayed_connection_title
215
- };
216
- case m.DENIED:
217
- return {
218
- cta: n.denied_cta,
219
- main: h(
220
- n.denied_connection_description,
221
- e.name
222
- ),
223
- statusName: o.connection_statuses[e.connection_status],
224
- title: n.denied_connection_title
225
- };
226
- case m.DISABLED:
227
- return {
228
- main: n.disabled_connection_description,
229
- statusName: o.connection_statuses[e.connection_status],
230
- title: n.disabled_connection_title
231
- };
232
- case m.DISCONNECTED:
233
- return {
234
- main: h(
235
- n.disconnected_connection_description,
236
- e.name
237
- ),
238
- statusName: o.connection_statuses[e.connection_status],
239
- title: n.disconnected_connection_title
240
- };
241
- case m.DISCONTINUED:
242
- return {
243
- main: n.discontinued_connection_description,
244
- statusName: o.connection_statuses[e.connection_status],
245
- title: n.discontinued_connection_title
246
- };
247
- case m.EXPIRED:
248
- return {
249
- cta: n.expired_cta,
250
- main: n.expired_connection_description,
251
- statusName: o.connection_statuses[e.connection_status],
252
- title: n.expired_connection_title
253
- };
254
- case m.FAILED:
255
- return {
256
- main: h(
257
- n.failed_connection_description,
258
- e.name
259
- ),
260
- statusName: o.connection_statuses[e.connection_status],
261
- title: n.failed_connection_title
262
- };
263
- case m.IMPAIRED:
264
- return {
265
- cta: n.impaired_cta,
266
- main: h(
267
- n.impaired_connection_description,
268
- e.name
269
- ),
270
- statusName: o.connection_statuses[e.connection_status],
271
- title: n.impaired_connection_title
272
- };
273
- case m.IMPEDED:
274
- return {
275
- main: h(
276
- n.impeded_connection_description,
277
- e.name,
278
- e.name
279
- ),
280
- statusName: o.connection_statuses[e.connection_status],
281
- title: n.impeded_connection_title
282
- };
283
- case m.IMPORTED:
284
- return {
285
- cta: n.imported_cta,
286
- main: h(
287
- n.imported_connection_description,
288
- e.name
289
- ),
290
- statusName: o.connection_statuses[e.connection_status],
291
- title: n.imported_connection_title
292
- };
293
- case m.LOCKED:
294
- return {
295
- cta: n.locked_cta,
296
- main: h(
297
- n.locked_connection_description,
298
- e.name
299
- ),
300
- statusName: o.connection_statuses[e.connection_status],
301
- title: n.locked_connection_title
302
- };
303
- case m.PREVENTED:
304
- return {
305
- cta: n.prevented_cta,
306
- main: n.prevented_connection_description,
307
- statusName: o.connection_statuses[e.connection_status],
308
- title: n.prevented_connection_title
309
- };
310
- case m.REJECTED:
311
- return {
312
- cta: n.rejected_cta,
313
- main: n.rejected_connection_description,
314
- statusName: o.connection_statuses[e.connection_status],
315
- title: n.rejected_connection_title
316
- };
317
- default: {
318
- const c = () => {
319
- const i = e.successfully_aggregated_at ? lt(e.successfully_aggregated_at) : void 0, u = i && B(i, j.TIME_STAMP_HOUR_MINUTE);
320
- if (u)
321
- return dt(i) ? h(o.last_updated_at, o.today, u) : ut(i) ? h(o.last_updated_at, o.yesterday, u) : h(
322
- o.last_updated_at,
323
- B(i, j.MONTH_DAY_YEAR),
324
- u
325
- );
326
- };
327
- return {
328
- statusName: o.connection_statuses[6],
329
- // Connected
330
- title: c()
331
- };
332
- }
333
- }
334
- }, W = {
335
- color: "background.default",
336
- fontSize: 20,
337
- gridRow: 1,
338
- gridColumn: 1,
339
- zIndex: 2
340
- }, Pt = () => {
341
- const [e, o] = _.useState(!1), {
342
- palette: { mode: n }
343
- } = rt(), { selectedMember: c } = D(), { accounts: i, connect: u } = E(), l = tt(c, u), s = Q.includes(c.connection_status) ? {
344
- color: "error.main",
345
- ctaCopy: l.cta ?? "",
346
- icon: /* @__PURE__ */ t(q, { sx: { ...W } }),
347
- mainMessage: l.statusName,
348
- secondaryMessage: `${l.title}.`
349
- } : {
350
- color: "success.main",
351
- icon: /* @__PURE__ */ t(ct, { sx: { ...W } }),
352
- mainMessage: l.statusName,
353
- secondaryMessage: l.title
354
- };
355
- return /* @__PURE__ */ d(g, { children: [
356
- /* @__PURE__ */ t(Y, { sx: { mb: 4, mt: 12, mx: 8 }, children: /* @__PURE__ */ t(S, { bold: !0, component: "h2", variant: "XSmall", children: i.connection_status }) }),
357
- /* @__PURE__ */ t(v, { sx: { backgroundColor: "background.paper" }, children: c.is_manual || !s.ctaCopy ? /* @__PURE__ */ d(it, { alignItems: "center", direction: "row", px: 24, py: 12, children: [
358
- /* @__PURE__ */ t(R, { children: /* @__PURE__ */ t(F, { backingSx: { backgroundColor: s.color, borderRadius: 1 }, size: 32, children: s.icon }) }),
359
- /* @__PURE__ */ t(w, { primary: s.mainMessage, secondary: s.secondaryMessage })
360
- ] }) : /* @__PURE__ */ d(N, { onClick: () => o(!0), children: [
361
- /* @__PURE__ */ t(R, { children: /* @__PURE__ */ t(F, { backingSx: { backgroundColor: s.color, borderRadius: 1 }, size: 32, children: s.icon }) }),
362
- /* @__PURE__ */ t(
363
- w,
364
- {
365
- primary: s.mainMessage,
366
- secondary: s.secondaryMessage && /* @__PURE__ */ d(g, { children: [
367
- s.secondaryMessage,
368
- " ",
369
- /* @__PURE__ */ t(S, { bold: !0, sx: { color: "action.active" }, variant: "XSmall", children: s.ctaCopy })
370
- ] })
371
- }
372
- ),
373
- /* @__PURE__ */ t(k, { name: "chevron_right" })
374
- ] }) }),
375
- /* @__PURE__ */ t(M, { sx: { ml: c.is_manual || !c.institution_url ? 0 : 24 } }),
376
- !c.is_manual && c.institution_url && /* @__PURE__ */ d(g, { children: [
377
- /* @__PURE__ */ t(v, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ d(N, { component: "a", href: c.institution_url, target: "_blank", children: [
378
- /* @__PURE__ */ t(R, { children: /* @__PURE__ */ t(
379
- F,
380
- {
381
- backingSx: {
382
- backgroundColor: n === G.LIGHT ? "grey.300" : "grey.700",
383
- borderRadius: 1
384
- },
385
- size: 32,
386
- children: /* @__PURE__ */ t(
387
- st,
388
- {
389
- sx: {
390
- ...W,
391
- color: n === G.LIGHT ? "grey.900" : "common.white"
392
- }
393
- }
394
- )
395
- }
396
- ) }),
397
- /* @__PURE__ */ t(w, { primary: c.name, secondary: c.institution_url }),
398
- /* @__PURE__ */ t(k, { name: "launch" })
399
- ] }) }),
400
- /* @__PURE__ */ t(M, {})
401
- ] }),
402
- e && /* @__PURE__ */ t(
403
- Z,
404
- {
405
- loadWidgetProps: { current_member_guid: c.guid },
406
- onClose: () => o(!1),
407
- showConnectWidget: e,
408
- title: i.manage_connection
409
- }
410
- )
411
- ] });
412
- }, Ft = b(Pt), Ut = ({ field: e, isOpen: o, onClose: n }) => {
413
- const { updateAccount: c } = z(), { selectedAccount: i } = D(), { accounts: u } = E(), [l, s] = _.useState(i[e.name]), [r, y] = _.useState(""), [T, a] = _.useState(!0), C = () => {
414
- s(""), y(""), n();
415
- }, A = () => {
416
- switch (e.type) {
417
- case P.Select:
418
- return /* @__PURE__ */ d(gt, { fullWidth: !0, children: [
419
- /* @__PURE__ */ t(Ct, { id: `${e.label}-select-label`, children: e.label }),
420
- /* @__PURE__ */ t(
421
- bt,
422
- {
423
- id: `${e.label}-select`,
424
- inputProps: {
425
- sx: {
426
- backgroundColor: "background.paper"
427
- }
428
- },
429
- label: e.label,
430
- labelId: `${e.label}-select-label`,
431
- onChange: (p) => s(p.target.value),
432
- placeholder: e.placeholder,
433
- value: l,
434
- children: e.options?.map((p) => /* @__PURE__ */ t(At, { value: p.value, children: p.label }, p.value))
435
- }
436
- )
437
- ] });
438
- case P.Currency:
439
- return /* @__PURE__ */ t(
440
- St,
441
- {
442
- amount: l || "",
443
- fullWidth: !0,
444
- label: e.label,
445
- placeholder: e.placeholder,
446
- setAmount: s,
447
- setHasValidInput: a
448
- }
449
- );
450
- case P.Date:
451
- return /* @__PURE__ */ t(ft, { dateAdapter: pt, children: /* @__PURE__ */ t(
452
- ht,
453
- {
454
- maxDate: _t(/* @__PURE__ */ new Date(), 1),
455
- minDate: /* @__PURE__ */ new Date(),
456
- onChange: (p) => {
457
- i[e.name] && Number(i[e.name]) <= 31 ? s(p.getDate()) : s(p);
458
- },
459
- sx: {
460
- "& .MuiPickersDay-today": {
461
- color: "primary.lighter"
462
- },
463
- "& .MuiPickersArrowSwitcher-button": {
464
- color: "primary.lighter",
465
- "&:hover": {
466
- backgroundColor: (p) => mt(p.palette.primary.light, 0.1)
467
- }
468
- }
469
- },
470
- views: ["day"]
471
- }
472
- ) });
473
- default:
474
- return /* @__PURE__ */ t(
475
- Tt,
476
- {
477
- defaultValue: i[e.name],
478
- error: !!r,
479
- fullWidth: !0,
480
- helperText: r,
481
- onChange: L,
482
- placeholder: e.placeholder
483
- }
484
- );
485
- }
486
- }, x = () => {
487
- i[e.name] !== l && c({
488
- ...i,
489
- [e.name]: l
490
- }), C();
491
- }, L = (p) => {
492
- s(p.target.value), e.validation && y(e.validation(p.target.value));
493
- };
494
- return /* @__PURE__ */ t(
495
- V,
496
- {
497
- copy: {
498
- close_aria: u.close_aria,
499
- title: h(u.edit_field, e.label)
500
- },
501
- disablePrimaryButton: !!r || !T,
502
- isOpen: o,
503
- onClose: C,
504
- onPrimaryAction: x,
505
- primaryText: u.save,
506
- children: A()
507
- }
508
- );
509
- }, Wt = b(Ut), $t = () => {
510
- const e = window.app?.config, { onEvent: o } = O(), { selectedAccount: n } = D(), { accounts: c } = E(), i = Dt(n, c), u = n.member_is_managed_by_user || !n.member_is_managed_by_user && e.enable_renaming_home_accounts, [l, s] = _.useState(!1), [r, y] = _.useState(i[0]), T = i.filter(
511
- (a) => u || n[a.name] || n[a.name] === 0
512
- );
513
- return /* @__PURE__ */ d(g, { children: [
514
- T.map((a) => {
515
- const C = n[a.name] || n[a.name] === 0, A = T.indexOf(a) === T.length - 1, x = /* @__PURE__ */ t(
516
- w,
517
- {
518
- disableTypography: !0,
519
- primary: /* @__PURE__ */ t(S, { sx: { fontSize: 11 }, children: a.label }),
520
- secondary: /* @__PURE__ */ t(S, { bold: !0, sx: { fontSize: 15 }, children: C ? a.valueFormatter(n[a.name]) : a.placeholder })
521
- }
522
- );
523
- return /* @__PURE__ */ t(_.Fragment, { children: u ? /* @__PURE__ */ d(g, { children: [
524
- /* @__PURE__ */ t(v, { sx: { backgroundColor: "background.paper", px: 0 }, children: /* @__PURE__ */ d(
525
- N,
526
- {
527
- onClick: () => {
528
- y(a), s(!0), a?.event && o(a.event, { account_guid: n.guid });
529
- },
530
- children: [
531
- x,
532
- /* @__PURE__ */ t(k, { name: "chevron_right" })
533
- ]
534
- }
535
- ) }),
536
- /* @__PURE__ */ t(M, { sx: { ml: A ? 0 : 24 } })
537
- ] }) : C && /* @__PURE__ */ d(g, { children: [
538
- /* @__PURE__ */ t(v, { sx: { backgroundColor: "background.paper", px: 24 }, children: x }),
539
- /* @__PURE__ */ t(M, { sx: { ml: A ? 0 : 24 } })
540
- ] }) }, a.name);
541
- }),
542
- l && r && /* @__PURE__ */ t(
543
- Wt,
544
- {
545
- field: r,
546
- isOpen: l,
547
- onClose: () => s(!1)
548
- }
549
- )
550
- ] });
551
- }, Vt = b($t), zt = () => {
552
- const { onEvent: e } = O();
553
- return _.useEffect(() => e(I.ACCOUNT_DETAILS_VIEW), []), /* @__PURE__ */ d($, { children: [
554
- /* @__PURE__ */ t(Vt, {}),
555
- /* @__PURE__ */ t(Ft, {}),
556
- /* @__PURE__ */ t(Rt, {})
557
- ] });
558
- }, Ht = b(zt), Gt = ({ setTabValue: e }) => {
559
- const [o, n] = _.useState(!1), { selectedMember: c } = D(), { accounts: i, connect: u } = E(), l = c.connection_status && Q.includes(c.connection_status);
560
- if (_.useEffect(() => {
561
- l && e(1);
562
- }, [l]), !l) return;
563
- const s = tt(c, u);
564
- return /* @__PURE__ */ d(g, { children: [
565
- /* @__PURE__ */ t(
566
- wt,
567
- {
568
- sx: {
569
- mb: 16,
570
- mt: 24,
571
- mx: 24
572
- },
573
- children: /* @__PURE__ */ d(
574
- Et,
575
- {
576
- icon: /* @__PURE__ */ t(q, {}),
577
- severity: "error",
578
- sx: {
579
- borderLeft: 5,
580
- borderTopLeftRadius: 6,
581
- borderBottomLeftRadius: 6,
582
- borderColor: "error.main",
583
- color: "text.primary",
584
- "&.MuiPaper-root": {
585
- backgroundColor: "background.paper"
586
- }
587
- },
588
- children: [
589
- s.title && /* @__PURE__ */ t(yt, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: s.title }),
590
- /* @__PURE__ */ t(S, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children: s.main }),
591
- s.cta && /* @__PURE__ */ t(
592
- xt,
593
- {
594
- onClick: () => n(!0),
595
- sx: { fontSize: 15, fontWeight: 600, ml: 0 },
596
- children: s.cta
597
- }
598
- )
599
- ]
600
- }
601
- )
602
- }
603
- ),
604
- o && /* @__PURE__ */ t(
605
- Z,
606
- {
607
- loadWidgetProps: { current_member_guid: c.guid },
608
- onClose: () => n(!1),
609
- showConnectWidget: o,
610
- title: i.manage_connection
611
- }
612
- )
613
- ] });
614
- }, Bt = b(Gt), jt = () => {
615
- const [e, o] = _.useState(""), { onEvent: n } = O(), { selectedAccount: c } = D(), { accounts: i } = E(), { setFilter: u, sortedTransactions: l } = X(), s = _.useMemo(
616
- () => l.find((r) => r.guid === e),
617
- [e, l]
618
- );
619
- return _.useEffect(() => {
620
- u({
621
- dateRange: { start: It(kt(), 90), end: Mt() },
622
- accounts: [c.guid]
623
- });
624
- }, [c]), _.useEffect(() => n(I.ACCOUNT_DETAILS_VIEW_TRANSACTIONS), []), /* @__PURE__ */ d(g, { children: [
625
- /* @__PURE__ */ t(vt, { onClick: o }),
626
- s && /* @__PURE__ */ t(
627
- J,
628
- {
629
- ariaLabelClose: i.close_drawer,
630
- isOpen: !!e,
631
- onClose: () => o(""),
632
- title: i.transaction_drawer_title,
633
- children: /* @__PURE__ */ t(Lt, { transaction: s })
634
- }
635
- )
636
- ] });
637
- }, Kt = b(jt), Yt = () => {
638
- const [e, o] = _.useState(0), { accounts: n } = E();
639
- return /* @__PURE__ */ d(g, { children: [
640
- /* @__PURE__ */ t(Bt, { setTabValue: o }),
641
- /* @__PURE__ */ d(
642
- nt,
643
- {
644
- "aria-label": n.transactions_and_details_aria,
645
- centered: !0,
646
- onChange: (c, i) => o(i),
647
- textColor: "primary",
648
- value: e,
649
- variant: "fullWidth",
650
- children: [
651
- /* @__PURE__ */ t(
652
- H,
653
- {
654
- "aria-controls": "transaction-details-tabpanel-0",
655
- id: "transaction-details-tab-0",
656
- label: n.transactions
657
- }
658
- ),
659
- /* @__PURE__ */ t(
660
- H,
661
- {
662
- "aria-controls": "account-details-tabpanel-1",
663
- id: "account-details-tab-1",
664
- label: n.account_details
665
- }
666
- )
667
- ]
668
- }
669
- ),
670
- /* @__PURE__ */ t(K, { index: 0, name: "transaction-details", value: e, children: /* @__PURE__ */ t(Kt, {}) }),
671
- /* @__PURE__ */ t(K, { index: 1, name: "account-details", value: e, children: /* @__PURE__ */ t(Ht, {}) })
672
- ] });
673
- }, Be = b(Yt);
674
- export {
675
- Be as A,
676
- Nt as u
677
- };