@mx-cartographer/experiences 8.0.0-alpha.bb4 → 8.0.0-alpha.mega2

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 (154) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/dist/{Account-B4CDD-zq.mjs → Account-CvR2-dSR.mjs} +1 -1
  3. package/dist/AccountDetailsContent-CitErkuS.mjs +686 -0
  4. package/dist/{AccountDetailsHeader-DRjFuyJT.mjs → AccountDetailsHeader-BkG3MNYo.mjs} +19 -19
  5. package/dist/{AccountFields-Cl4KHoSj.mjs → AccountFields-zCMqet85.mjs} +10 -12
  6. package/dist/AccountListItem-DHrz8Mml.mjs +90 -0
  7. package/dist/{AccountStore-HbVblv86.mjs → AccountStore-LgfBcYMe.mjs} +101 -75
  8. package/dist/Accounts-Bzy1_REQ.mjs +9 -0
  9. package/dist/{BudgetUtil-Jv8h9H9l.mjs → BudgetUtil-BmZXkL0C.mjs} +32 -32
  10. package/dist/{CashflowStore-CA190BPF.mjs → CashflowStore-D9Dpuz7X.mjs} +25 -18
  11. package/dist/{Category-Ccoew_sA.mjs → Category-CevNQ03n.mjs} +2 -2
  12. package/dist/{CategorySelectorDrawer-Dl006GKy.mjs → CategorySelectorDrawer-B-I3kajA.mjs} +27 -27
  13. package/dist/CategoryStore-CA3tS1BO.mjs +186 -0
  14. package/dist/CategoryUtil-DUM8NuGO.mjs +78 -0
  15. package/dist/{ConnectDrawer-DVp54lUH.mjs → ConnectDrawer-BkvlItWx.mjs} +55 -56
  16. package/dist/{ConnectionsDrawer-Dsc04-4Z.mjs → ConnectionsDrawer-VmuVFHbL.mjs} +5 -5
  17. package/dist/CurrencyInput-itK0R3wV.mjs +85 -0
  18. package/dist/{DateUtil-CDPZw_-m.mjs → DateUtil-CBdcsyuk.mjs} +1 -1
  19. package/dist/{DebtsStore-pL63fmdT.mjs → DebtsStore-Bq-aPy-5.mjs} +3 -3
  20. package/dist/{Dialog-CDV0kKxj.mjs → Dialog-BPTr3qHE.mjs} +24 -24
  21. package/dist/Drawer-By9V-B5L.mjs +178 -0
  22. package/dist/{ExportCsvAction-QhQK4_FU.mjs → ExportCsvAction-Cglo8Mca.mjs} +4 -4
  23. package/dist/{FinstrongStore-BGf36b0z.mjs → FinstrongStore-BIrX0Xg2.mjs} +56 -56
  24. package/dist/{GoalStore-C1-w3Y1E.mjs → GoalStore-1P19goZ7.mjs} +111 -151
  25. package/dist/HeaderCell-DjuifqHJ.mjs +6 -0
  26. package/dist/{Help-c-zHlDbv.mjs → Help-DhcC-C05.mjs} +8 -8
  27. package/dist/{Help-DBfsTkAi.mjs → Help-Ea3BlXQp.mjs} +146 -125
  28. package/dist/{IconBacking-DgT8DCeh.mjs → IconBacking-B9oC6uL2.mjs} +11 -11
  29. package/dist/LineChart-BF4QA-Lx.mjs +580 -0
  30. package/dist/{ListItemAction-BNCWQAN_.mjs → ListItemAction-BxTkF6Tz.mjs} +2 -2
  31. package/dist/Loader-DUaFpDGv.mjs +24 -0
  32. package/dist/{ManageIncome-8EsStyIQ.mjs → ManageIncome-CaoQl609.mjs} +142 -142
  33. package/dist/MicroWidgetContainer-r6mtxRer.mjs +52 -0
  34. package/dist/MiniWidgetContainer-Bg02sF1Y.mjs +71 -0
  35. package/dist/{NetWorthStore-Bti6u-d9.mjs → NetWorthStore-rC0q7P7t.mjs} +4 -4
  36. package/dist/NotificationSettings-uzM8tCoH.mjs +674 -0
  37. package/dist/{NotificationStore-Ck2KdNmT.mjs → NotificationStore-CDX_kqHa.mjs} +14 -22
  38. package/dist/{OriginalBalanceAction-2Y_3U_mg.mjs → OriginalBalanceAction-C6jdS4ws.mjs} +9 -9
  39. package/dist/{RecurringSettings-DAncu--R.mjs → RecurringSettings-B4ybrS0B.mjs} +17 -17
  40. package/dist/{RecurringTransactions-CxcSL1dY.mjs → RecurringTransactions-BqijW_8S.mjs} +79 -79
  41. package/dist/{RecurringTransactionsStore-CNFxyGB6.mjs → RecurringTransactionsStore-BhBUVm9a.mjs} +81 -91
  42. package/dist/{ResponsiveButton-Cn6-R7ue.mjs → ResponsiveButton-DZFp78fJ.mjs} +10 -10
  43. package/dist/SearchBox-B2_zLv8-.mjs +42 -0
  44. package/dist/{SettingsStore-BASMQSIp.mjs → SettingsStore-krIRNwHK.mjs} +1 -1
  45. package/dist/{SingleSegmentDonut-7Uy6VEld.mjs → SingleSegmentDonut-BgbLgwHi.mjs} +6 -6
  46. package/dist/SpendingData-DQ1b9uqq.mjs +53 -0
  47. package/dist/{SpendingLegend-6FqtMcBV.mjs → SpendingLegend-CDO060GT.mjs} +65 -65
  48. package/dist/{StatusBar-CPfSXe80.mjs → StatusBar-BK_uYHAB.mjs} +6 -6
  49. package/dist/{TabContentContainer-CnMXkVqr.mjs → TabContentContainer-j01JYR_7.mjs} +8 -8
  50. package/dist/TransactionDetails-m5PddMQn.mjs +1380 -0
  51. package/dist/TransactionStore-PRlwE-TF.mjs +677 -0
  52. package/dist/TrendsStore-yO7qYv97.mjs +186 -0
  53. package/dist/{User-BklmOUSd.mjs → User-Cnlegl1N.mjs} +107 -107
  54. package/dist/{ViewMoreMicroCard-DAkyNRlD.mjs → ViewMoreMicroCard-DwR0v_ll.mjs} +211 -205
  55. package/dist/{WidgetContainer-CDh9fjpR.mjs → WidgetContainer-CoFDmQRE.mjs} +36 -36
  56. package/dist/accounts/index.es.js +200 -197
  57. package/dist/accounts/stores/AccountStore.d.ts +22 -25
  58. package/dist/accounts/utils/Accounts.d.ts +1 -2
  59. package/dist/analytics/index.es.js +27 -27
  60. package/dist/budgets/components/AddBudgets.d.ts +2 -1
  61. package/dist/budgets/index.es.js +703 -669
  62. package/dist/budgets/store/BudgetsStore.d.ts +0 -1
  63. package/dist/cashflow/index.es.js +420 -404
  64. package/dist/categories/index.es.js +2 -2
  65. package/dist/categories/stores/CategoryStore.d.ts +3 -6
  66. package/dist/categories/util/CategoryUtil.d.ts +2 -3
  67. package/dist/common/components/ErrorBoundary.d.ts +1 -1
  68. package/dist/common/components/Loader.d.ts +2 -1
  69. package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +1 -1
  70. package/dist/common/components/barchart/Bar.d.ts +25 -0
  71. package/dist/common/components/barchart/BarChart.d.ts +34 -0
  72. package/dist/common/components/barchart/BarColumn.d.ts +37 -0
  73. package/dist/common/components/barchart/Legend.d.ts +8 -0
  74. package/dist/common/components/barchart/Util.d.ts +42 -0
  75. package/dist/common/components/barchart/index.d.ts +1 -0
  76. package/dist/common/components/charts/linechart/CustomMark.d.ts +1 -1
  77. package/dist/common/components/charts/linechart/CustomTooltip.d.ts +6 -1
  78. package/dist/common/components/charts/stackedlinechart/CustomPointTooltip.d.ts +5 -2
  79. package/dist/common/components/index.d.ts +1 -0
  80. package/dist/common/hooks/index.d.ts +2 -0
  81. package/dist/common/hooks/useAriaLive.d.ts +1 -1
  82. package/dist/common/hooks/usePrevious.d.ts +2 -0
  83. package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
  84. package/dist/common/index.es.js +712 -436
  85. package/dist/common/stores/AppDataStore.d.ts +1 -3
  86. package/dist/common/stores/GlobalCopyStore.d.ts +1 -0
  87. package/dist/common/stores/GlobalStore.d.ts +3 -3
  88. package/dist/common/stores/GlobalUiStore.d.ts +2 -3
  89. package/dist/common/stores/UserStore.d.ts +2 -3
  90. package/dist/common/types/Account.d.ts +6 -9
  91. package/dist/common/types/localization/TransactionsCopy.d.ts +1 -0
  92. package/dist/common/utils/Theme.d.ts +3 -1
  93. package/dist/dashboard/index.es.js +93 -91
  94. package/dist/debts/components/DebtsChart.d.ts +2 -1
  95. package/dist/debts/index.es.js +529 -527
  96. package/dist/{exportTransactionsToCSV-BgV_wTLT.mjs → exportTransactionsToCSV-DuAaI5XA.mjs} +3 -3
  97. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +4 -5
  98. package/dist/finstrong/index.es.js +876 -867
  99. package/dist/goals/index.es.js +526 -525
  100. package/dist/goals/stores/GoalStore.d.ts +4 -17
  101. package/dist/help/components/content/BottomImageContent.d.ts +1 -1
  102. package/dist/help/components/content/LeftImageContent.d.ts +1 -1
  103. package/dist/help/components/content/RightImageContent.d.ts +1 -1
  104. package/dist/help/components/content/TopImageContent.d.ts +1 -1
  105. package/dist/help/index.es.js +13 -9
  106. package/dist/{hooks-C41HAxM5.mjs → hooks-ZMp65DFz.mjs} +11 -11
  107. package/dist/investments/index.es.js +534 -531
  108. package/dist/investments/stores/HoldingStore.d.ts +0 -1
  109. package/dist/merchants/index.es.js +8 -8
  110. package/dist/microinsights/MicroCardTemplate.d.ts +16 -0
  111. package/dist/microinsights/index.d.ts +1 -0
  112. package/dist/microinsights/index.es.js +101 -14
  113. package/dist/networth/components/NetWorthChange.d.ts +1 -3
  114. package/dist/networth/index.es.js +284 -285
  115. package/dist/notifications/index.es.js +95 -94
  116. package/dist/notifications/stores/NotificationStore.d.ts +1 -3
  117. package/dist/recurringtransactions/index.es.js +582 -562
  118. package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +2 -4
  119. package/dist/settings/index.es.js +340 -337
  120. package/dist/spending/index.es.js +281 -268
  121. package/dist/transactions/components/shared/transactionlist/DateRow.d.ts +7 -0
  122. package/dist/transactions/index.es.js +253 -255
  123. package/dist/transactions/stores/TransactionStore.d.ts +77 -21
  124. package/dist/transactions/stores/UiStore.d.ts +2 -0
  125. package/dist/trends/components/TrendsTable.d.ts +0 -2
  126. package/dist/trends/index.es.js +838 -793
  127. package/dist/trends/utils/TrendsData.d.ts +1 -0
  128. package/dist/{useAccountDisplayName-CcIp09Xc.mjs → useAccountDisplayName-B7iXTNM8.mjs} +2 -2
  129. package/dist/{useCombineEvents-kNzLTWCp.mjs → useCombineEvents-CRwX-qWE.mjs} +2 -2
  130. package/dist/{useInsightsEnabled-CNjP5cfR.mjs → useInsightsEnabled-B7dxpDrX.mjs} +1 -1
  131. package/dist/{useScreenSize-B5afALev.mjs → useScreenSize-B6JyS_Lj.mjs} +1 -1
  132. package/dist/useWidgetLoadTimer-hIOioiKx.mjs +19 -0
  133. package/package.json +57 -52
  134. package/dist/AccountDetailsContent-adZTkM52.mjs +0 -683
  135. package/dist/AccountListItem-wgmlex-_.mjs +0 -90
  136. package/dist/Accounts-CRUehOiy.mjs +0 -27
  137. package/dist/CategoryStore-MUwRWH9e.mjs +0 -176
  138. package/dist/CategoryUtil-DfVKKkRf.mjs +0 -80
  139. package/dist/CurrencyInput-D1cjbdCI.mjs +0 -85
  140. package/dist/Drawer-BF40nbsH.mjs +0 -163
  141. package/dist/HeaderCell-P8w6CmfO.mjs +0 -6
  142. package/dist/LineChart-C1PxNf7P.mjs +0 -581
  143. package/dist/Loader-Ckqi9Rx6.mjs +0 -21
  144. package/dist/MicroWidgetContainer-BGpNl5ZS.mjs +0 -45
  145. package/dist/MiniWidgetContainer-CKzf_Ira.mjs +0 -56
  146. package/dist/NotificationSettings-B74rQVYC.mjs +0 -672
  147. package/dist/SearchBox-B7km148n.mjs +0 -39
  148. package/dist/SkeletonLoader-BaNboJjD.mjs +0 -38
  149. package/dist/SpendingData-DPQ96k3x.mjs +0 -55
  150. package/dist/TransactionDetails-Bn0qY5Hw.mjs +0 -1336
  151. package/dist/TransactionStore-DbwAutwC.mjs +0 -671
  152. package/dist/TrendsStore-_mRaFUdf.mjs +0 -182
  153. package/dist/common/components/SkeletonLoader.d.ts +0 -7
  154. package/dist/recurringtransactions/components/MicroWidgetContent.d.ts +0 -3
@@ -0,0 +1,186 @@
1
+ import { jsxs as u, jsx as l } from "react/jsx-runtime";
2
+ import x from "react";
3
+ import S from "@mui/material/ListItem";
4
+ import R from "@mui/material/ListItemButton";
5
+ import D from "@mui/material/ListItemIcon";
6
+ import A from "@mui/material/ListItemText";
7
+ import h from "@mui/material/Stack";
8
+ import { Text as b } from "@mxenabled/mxui";
9
+ import { makeAutoObservable as N } from "mobx";
10
+ import { addSeconds as v } from "date-fns/addSeconds";
11
+ import { differenceInCalendarMonths as w } from "date-fns/differenceInCalendarMonths";
12
+ import { endOfMonth as _ } from "date-fns/endOfMonth";
13
+ import { subMonths as I } from "date-fns/subMonths";
14
+ import { b as E, C, c as f } from "./Category-CevNQ03n.mjs";
15
+ import { f as L, a as M } from "./Dialog-BPTr3qHE.mjs";
16
+ const rt = ({
17
+ onClick: e,
18
+ leftIcon: t,
19
+ rightIcon: o,
20
+ title: r,
21
+ subtitle: n,
22
+ rightContent: a,
23
+ titleBold: i = !0,
24
+ rightContentBold: c = !0
25
+ }) => {
26
+ const g = /* @__PURE__ */ u(x.Fragment, { children: [
27
+ t && /* @__PURE__ */ l(D, { sx: { ml: 0 }, children: t }),
28
+ /* @__PURE__ */ l(A, { children: /* @__PURE__ */ u(
29
+ h,
30
+ {
31
+ sx: {
32
+ alignItems: "center",
33
+ flexDirection: "row",
34
+ marginLeft: 12
35
+ },
36
+ children: [
37
+ /* @__PURE__ */ u(h, { sx: { flex: 1, minWidth: 0 }, children: [
38
+ /* @__PURE__ */ l(b, { bold: i, variant: "body1", children: r }),
39
+ n && /* @__PURE__ */ l(b, { variant: "caption", children: n })
40
+ ] }),
41
+ /* @__PURE__ */ u(h, { sx: { flexDirection: "row", alignItems: "center", gap: 1 }, children: [
42
+ a && /* @__PURE__ */ l(b, { bold: c, display: "flex", variant: "body1", children: a }),
43
+ o && /* @__PURE__ */ l(D, { children: o })
44
+ ] })
45
+ ]
46
+ }
47
+ ) })
48
+ ] });
49
+ return /* @__PURE__ */ l(S, { sx: { bgcolor: "background.paper" }, children: e ? /* @__PURE__ */ l(
50
+ R,
51
+ {
52
+ onClick: e,
53
+ sx: {
54
+ py: 14
55
+ },
56
+ children: g
57
+ }
58
+ ) : /* @__PURE__ */ l(
59
+ h,
60
+ {
61
+ sx: {
62
+ py: 14,
63
+ px: 24,
64
+ width: "100%",
65
+ flexDirection: "row",
66
+ alignItems: "center"
67
+ },
68
+ children: g
69
+ }
70
+ ) });
71
+ }, O = (e) => C[e] ?? C.default, W = (e) => f[e];
72
+ function F(e, t) {
73
+ const o = [], r = new Date(e);
74
+ for (; r <= t; ) {
75
+ const n = r.getFullYear(), a = String(r.getMonth() + 1).padStart(2, "0");
76
+ o.push(+`${n}${a}`), r.setMonth(r.getMonth() + 1);
77
+ }
78
+ return o;
79
+ }
80
+ const G = (e) => e.reduce((t, o) => {
81
+ const r = {
82
+ top_level_category_guid: o.top_level_category_guid,
83
+ category_guid: o.category_guid,
84
+ amount: o.total,
85
+ year_month: o.year_month
86
+ }, { top_level_category_guid: n, category_guid: a } = r;
87
+ return t[a] || (t[a] = []), t[a].push(r), n !== a && (t[n] || (t[n] = []), t[n].push(r)), t;
88
+ }, {}), at = (e, t, o) => {
89
+ const r = G(e), n = F(t, o);
90
+ return Object.entries(r).map(([a, i]) => {
91
+ const c = i[0].top_level_category_guid, g = n.map((m) => {
92
+ const s = i.filter((y) => y.year_month === m).reduce((y, T) => y + Math.abs(T.amount), 0), d = Number(String(m).slice(0, 4)), p = Number(String(m).slice(4));
93
+ return { x: new Date(d, p - 1), y: s };
94
+ }).sort((m, s) => m.x.getTime() - s.x.getTime());
95
+ return {
96
+ top_level_category_guid: c,
97
+ category_guid: a,
98
+ category_name: W(a),
99
+ category_color: O(c),
100
+ dataset: g
101
+ };
102
+ });
103
+ }, nt = (e, t) => {
104
+ const o = typeof e == "string" ? parseFloat(e.replace(/[^0-9.-]+/g, "")) : e, r = typeof t == "string" ? parseFloat(t.replace(/[^0-9.-]+/g, "")) : t;
105
+ return (o || 0) - (r || 0);
106
+ }, st = (e, t) => {
107
+ const o = f[e] || "", r = f[t] || "";
108
+ return o.localeCompare(r);
109
+ }, $ = (e, t) => {
110
+ const o = e.subCategories.filter((a) => a.currentAmount !== 0), r = e.totalMonthlyAmounts.slice(-t), n = (a) => a.substring(0, 3) + " " + a.slice(-4);
111
+ return r.map((a) => {
112
+ const i = n(a.label), c = o.map((s) => {
113
+ const d = s.monthlyAmounts.slice(-t).find((p) => n(p.label) === i);
114
+ return {
115
+ label: s.name,
116
+ amount: Math.abs(d?.amount || 0),
117
+ header: i
118
+ };
119
+ }), g = e.monthlyAmounts.slice(-t).find((s) => n(s.label) === i);
120
+ return [{
121
+ label: e.name,
122
+ amount: Math.abs(g?.amount || 0),
123
+ header: i
124
+ }, ...c].sort((s, d) => d.amount - s.amount);
125
+ });
126
+ }, j = (e, t) => {
127
+ const o = e ? e.totalMonthlyAmounts.slice(-t).map((n) => ({
128
+ x: n.label.substring(0, 3),
129
+ y: Math.abs(n.amount)
130
+ })) : [], r = e ? $(e, t) : [];
131
+ return { monthlyAmounts: o, tooltipLabels: r };
132
+ }, k = (e) => e.slice().filter(
133
+ (t) => t.totalAmount !== 0 && !t.isTransfer && t.guid !== E.INVESTMENTS
134
+ ).sort((t, o) => Math.abs(o.totalAmount) - Math.abs(t.totalAmount));
135
+ class it {
136
+ globalStore;
137
+ selectedCategoryData = null;
138
+ selectedDateRange;
139
+ visibleListLength = 5;
140
+ constructor(t) {
141
+ this.globalStore = t, this.selectedDateRange = {
142
+ start: v(_(I(/* @__PURE__ */ new Date(), 6)), 1),
143
+ end: _(/* @__PURE__ */ new Date())
144
+ }, N(this);
145
+ }
146
+ setSelectedCategoryData = (t) => {
147
+ this.selectedCategoryData = t;
148
+ };
149
+ setSelectedDateRange = (t) => {
150
+ this.selectedDateRange = t;
151
+ };
152
+ setVisibleListLength = (t) => {
153
+ this.visibleListLength = t;
154
+ };
155
+ get sortedDetailedCategoriesWithTransactions() {
156
+ return k(
157
+ this.globalStore.categoryStore.detailedCategoriesWithTransactions
158
+ );
159
+ }
160
+ get selectedDateRangeMonthCount() {
161
+ return w(this.selectedDateRange.end, this.selectedDateRange.start) + 1;
162
+ }
163
+ get selectedDateRangeMonthRange() {
164
+ const t = L(this.selectedDateRange.start, M.MONTH_LONG), o = L(this.selectedDateRange.end, M.MONTH_LONG);
165
+ return `${t} - ${o}`;
166
+ }
167
+ get visibleCategories() {
168
+ return this.sortedDetailedCategoriesWithTransactions.slice(0, this.visibleListLength);
169
+ }
170
+ get collapsedCategories() {
171
+ return this.sortedDetailedCategoriesWithTransactions.slice(this.visibleListLength);
172
+ }
173
+ get categoryDetailsChartData() {
174
+ return j(
175
+ this.selectedCategoryData,
176
+ this.selectedDateRangeMonthCount
177
+ );
178
+ }
179
+ }
180
+ export {
181
+ rt as L,
182
+ it as T,
183
+ nt as a,
184
+ st as c,
185
+ at as g
186
+ };
@@ -1,44 +1,44 @@
1
- import { jsxs as g, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as h, jsx as e } from "react/jsx-runtime";
2
2
  import A from "react";
3
- import { css as R } from "@mxenabled/cssinjs";
3
+ import { css as p } from "@mxenabled/cssinjs";
4
4
  import { addDays as b } from "date-fns/addDays";
5
- import { addMonths as w } from "date-fns/addMonths";
6
- import { eachDayOfInterval as H } from "date-fns/eachDayOfInterval";
7
- import { eachWeekOfInterval as B } from "date-fns/eachWeekOfInterval";
8
- import { endOfMonth as P } from "date-fns/endOfMonth";
9
- import { format as k } from "date-fns/format";
10
- import { isBefore as $ } from "date-fns/isBefore";
11
- import { isSameMonth as U } from "date-fns/isSameMonth";
12
- import { startOfMonth as j } from "date-fns/startOfMonth";
5
+ import { addMonths as B } from "date-fns/addMonths";
6
+ import { eachDayOfInterval as P } from "date-fns/eachDayOfInterval";
7
+ import { eachWeekOfInterval as $ } from "date-fns/eachWeekOfInterval";
8
+ import { endOfMonth as U } from "date-fns/endOfMonth";
9
+ import { format as y } from "date-fns/format";
10
+ import { isBefore as j } from "date-fns/isBefore";
11
+ import { isSameMonth as W } from "date-fns/isSameMonth";
12
+ import { startOfMonth as V } from "date-fns/startOfMonth";
13
13
  import { startOfToday as f } from "date-fns/startOfToday";
14
- import { subMonths as W } from "date-fns/subMonths";
15
- import S from "@mui/material/Button";
16
- import V from "@mui/material/Paper";
17
- import { H2 as F, Text as y } from "@mxenabled/mxui";
18
- import { ChevronLeft as Y, ChevronRight as z } from "@mxenabled/mx-icons";
19
- import { f as X, a as Z } from "./Dialog-CDV0kKxj.mjs";
14
+ import { subMonths as F } from "date-fns/subMonths";
15
+ import E from "@mui/material/Button";
16
+ import Y from "@mui/material/Paper";
17
+ import { useTokens as v, H2 as z, Text as G } from "@mxenabled/mxui";
18
+ import { ChevronLeft as X, ChevronRight as Z } from "@mxenabled/mx-icons";
19
+ import { f as q, a as J } from "./Dialog-BPTr3qHE.mjs";
20
20
  import { isSameDay as T } from "date-fns/isSameDay";
21
- import { isWithinInterval as q } from "date-fns/isWithinInterval";
22
- import { useTheme as J } from "@mui/material/styles";
23
- import u from "@mui/material/ListItem";
24
- import Q from "@mui/material/ListItemButton";
25
- import { g as nn } from "./hooks-C41HAxM5.mjs";
26
- var an = /* @__PURE__ */ ((n) => (n[n.CREDIT = 1] = "CREDIT", n[n.DEBIT = 2] = "DEBIT", n))(an || {}), tn = /* @__PURE__ */ ((n) => (n[n.POSTED = 1] = "POSTED", n[n.PENDING = 2] = "PENDING", n))(tn || {});
27
- const on = ({ copy: n, date: a, onNextClick: o, onPreviousClick: r }) => {
28
- const i = en();
29
- return /* @__PURE__ */ g("div", { className: `mx-cmn-calendar-header ${i}`, children: [
30
- /* @__PURE__ */ e(F, { className: "mx-cmn-calendar-header-title", variant: "h3", children: X(a, Z.MONTH_YEAR) }),
31
- /* @__PURE__ */ g("div", { className: "mx-cmn-calendar-header-button-container", children: [
32
- /* @__PURE__ */ e(S, { "aria-label": n.prevAria, onClick: r, children: /* @__PURE__ */ e(Y, { size: 24 }) }),
33
- /* @__PURE__ */ e(S, { "aria-label": n.nextAria, onClick: o, children: /* @__PURE__ */ e(z, { size: 24 }) })
21
+ import { isWithinInterval as Q } from "date-fns/isWithinInterval";
22
+ import nn from "@mui/material/styles/useTheme";
23
+ import k from "@mui/material/ListItem";
24
+ import an from "@mui/material/ListItemButton";
25
+ import { g as tn } from "./hooks-ZMp65DFz.mjs";
26
+ var on = /* @__PURE__ */ ((n) => (n[n.CREDIT = 1] = "CREDIT", n[n.DEBIT = 2] = "DEBIT", n))(on || {}), en = /* @__PURE__ */ ((n) => (n[n.POSTED = 1] = "POSTED", n[n.PENDING = 2] = "PENDING", n))(en || {});
27
+ const rn = ({ copy: n, date: a, onNextClick: o, onPreviousClick: r }) => {
28
+ const c = v(), l = cn(c);
29
+ return /* @__PURE__ */ h("div", { className: `mx-cmn-calendar-header ${l}`, children: [
30
+ /* @__PURE__ */ e(z, { className: "mx-cmn-calendar-header-title", variant: "H3", children: q(a, J.MONTH_YEAR) }),
31
+ /* @__PURE__ */ h("div", { className: "mx-cmn-calendar-header-button-container", children: [
32
+ /* @__PURE__ */ e(E, { "aria-label": n.prevAria, onClick: r, children: /* @__PURE__ */ e(X, { size: 24 }) }),
33
+ /* @__PURE__ */ e(E, { "aria-label": n.nextAria, onClick: o, children: /* @__PURE__ */ e(Z, { size: 24 }) })
34
34
  ] })
35
35
  ] });
36
- }, en = () => R({
36
+ }, cn = (n) => p({
37
37
  alignItems: "center",
38
38
  display: "flex",
39
- marginBottom: 16,
40
- marginRight: -16,
41
- paddingLeft: 8,
39
+ marginBottom: n.Spacing.Medium,
40
+ marginRight: -n.Spacing.Medium,
41
+ paddingLeft: n.Spacing.XSmall,
42
42
  "& .mx-cmn-calendar-header-title": {
43
43
  flexGrow: 1
44
44
  },
@@ -46,44 +46,44 @@ const on = ({ copy: n, date: a, onNextClick: o, onPreviousClick: r }) => {
46
46
  display: "flex",
47
47
  gap: 4
48
48
  }
49
- }), rn = ({ beginDate: n, date: a, endDate: o, isInMonth: r, onClick: i }) => {
50
- const C = J(), L = cn(C), c = n && o && q(a, { start: n, end: o }) && !T(a, n) && !T(a, o), N = n && o && T(n, a) && !T(n, o), l = o && n && T(o, a) && !T(n, o), s = n && T(n, a) || o && T(o, a), O = T(a, f());
49
+ }), sn = ({ beginDate: n, date: a, endDate: o, isInMonth: r, onClick: c }) => {
50
+ const l = nn(), S = Tn(l), g = n && o && Q(a, { start: n, end: o }) && !T(a, n) && !T(a, o), s = n && o && T(n, a) && !T(n, o), N = o && n && T(o, a) && !T(n, o), i = n && T(n, a) || o && T(o, a), C = T(a, f());
51
51
  return /* @__PURE__ */ e(
52
52
  "div",
53
53
  {
54
54
  className: `
55
55
  mx-cmn-calendar-day
56
- ${L}
56
+ ${S}
57
57
  ${r ? "" : "mx-cmn-out-of-month"}
58
- ${c ? "mx-cmn-date-interval" : ""}
58
+ ${g ? "mx-cmn-date-interval" : ""}
59
59
  `,
60
60
  children: /* @__PURE__ */ e(
61
- S,
61
+ E,
62
62
  {
63
63
  className: `
64
64
  mx-cmn-calendar-day-button
65
- ${N ? "mx-cmn-range-start" : ""}
66
- ${l ? "mx-cmn-range-end" : ""}
65
+ ${s ? "mx-cmn-range-start" : ""}
66
+ ${N ? "mx-cmn-range-end" : ""}
67
67
  `,
68
- color: s ? "primary" : "secondary",
69
- onClick: () => i(a),
70
- variant: s ? "contained" : "text",
68
+ color: i ? "primary" : "secondary",
69
+ onClick: () => c(a),
70
+ variant: i ? "contained" : "text",
71
71
  children: /* @__PURE__ */ e(
72
- y,
72
+ G,
73
73
  {
74
74
  className: `
75
75
  mx-cmn-calendar-day-text
76
- ${s ? "mx-cmn-day-selected" : ""}
77
- ${O ? "mx-cmn-today" : ""}`,
78
- variant: "body2",
79
- children: k(a, "d")
76
+ ${i ? "mx-cmn-day-selected" : ""}
77
+ ${C ? "mx-cmn-today" : ""}`,
78
+ variant: "Small",
79
+ children: y(a, "d")
80
80
  }
81
81
  )
82
82
  }
83
83
  )
84
84
  }
85
85
  );
86
- }, cn = (n) => R({
86
+ }, Tn = (n) => p({
87
87
  height: I,
88
88
  width: I,
89
89
  display: "flex",
@@ -128,72 +128,72 @@ const on = ({ copy: n, date: a, onNextClick: o, onPreviousClick: r }) => {
128
128
  paddingBottom: 5
129
129
  }
130
130
  }
131
- }), sn = 340, I = 44;
132
- var Tn = /* @__PURE__ */ ((n) => (n.None = "None", n.Single = "Single", n.Range = "Range", n))(Tn || {});
133
- const bn = ({
131
+ }), ln = 340, I = 44;
132
+ var Cn = /* @__PURE__ */ ((n) => (n.None = "None", n.Single = "Single", n.Range = "Range", n))(Cn || {});
133
+ const Nn = ({
134
134
  copy: n,
135
135
  beginDate: a = void 0,
136
136
  endDate: o = void 0,
137
137
  onDateSelected: r,
138
- onRangeSelected: i,
139
- selectionType: C = "Single"
138
+ onRangeSelected: c,
139
+ selectionType: l = "Single"
140
140
  /* Single */
141
141
  }) => {
142
- const L = ln(), [c, N] = A.useState(f), [l, s] = A.useState(a), [O, m] = A.useState(o);
142
+ const S = v(), g = mn(S), [s, N] = A.useState(f), [i, C] = A.useState(a), [R, _] = A.useState(o);
143
143
  A.useEffect(() => {
144
- s(a), m(o), a && N(a);
144
+ C(a), _(o), a && N(a);
145
145
  }, [a, o]);
146
- const p = A.useMemo(() => {
147
- const t = B({ start: j(c), end: P(c) }), _ = [];
146
+ const D = A.useMemo(() => {
147
+ const t = $({ start: V(s), end: U(s) }), m = [];
148
148
  for (let d = 0; d < t.length; d++) {
149
- const E = t[d], D = H({ start: E, end: b(E, 6) }), x = [];
150
- for (let h = 0; h < D.length; h++)
151
- x.push(D[h]);
152
- _.push(x);
149
+ const O = t[d], u = P({ start: O, end: b(O, 6) }), x = [];
150
+ for (let L = 0; L < u.length; L++)
151
+ x.push(u[L]);
152
+ m.push(x);
153
153
  }
154
- return _;
155
- }, [c]), v = (t) => {
156
- if (C !== "None") {
157
- if (C === "Single") {
158
- s(t), r?.(t);
154
+ return m;
155
+ }, [s]), K = (t) => {
156
+ if (l !== "None") {
157
+ if (l === "Single") {
158
+ C(t), r?.(t);
159
159
  return;
160
160
  }
161
- !l || O ? (s(t), m(void 0)) : $(t, l) ? (m(l), s(t), i?.(t, l)) : (m(t), i?.(l, t));
161
+ !i || R ? (C(t), _(void 0)) : j(t, i) ? (_(i), C(t), c?.(t, i)) : (_(t), c?.(i, t));
162
162
  }
163
- }, G = () => {
164
- const t = f();
165
- N(t), C !== "None" && (s(t), C === "Single" ? r?.(t) : (m(t), i?.(t, t)));
166
- }, K = () => {
167
- N(w(c, 1));
168
163
  }, M = () => {
169
- N(W(c, 1));
164
+ const t = f();
165
+ N(t), l !== "None" && (C(t), l === "Single" ? r?.(t) : (_(t), c?.(t, t)));
166
+ }, w = () => {
167
+ N(B(s, 1));
168
+ }, H = () => {
169
+ N(F(s, 1));
170
170
  };
171
- return /* @__PURE__ */ e("div", { className: `mx-cmn-calendar ${L}`, children: /* @__PURE__ */ g(V, { sx: { boxShadow: "none" }, children: [
171
+ return /* @__PURE__ */ e("div", { className: `mx-cmn-calendar ${g}`, children: /* @__PURE__ */ h(Y, { sx: { boxShadow: "none" }, children: [
172
172
  /* @__PURE__ */ e(
173
- on,
173
+ rn,
174
174
  {
175
175
  copy: n,
176
- date: c,
177
- onNextClick: K,
178
- onPreviousClick: M
176
+ date: s,
177
+ onNextClick: w,
178
+ onPreviousClick: H
179
179
  }
180
180
  ),
181
- /* @__PURE__ */ e("div", { className: "mx-cmn-calendar-header-row", children: p[0].map((t, _) => /* @__PURE__ */ e("div", { className: "mx-cmn-calendar-header-cell", children: /* @__PURE__ */ e(y, { bold: !0, variant: "body2", children: k(t, "EEEEE") }) }, _)) }),
182
- p.map((t, _) => /* @__PURE__ */ e("div", { className: "mx-cmn-calendar-week", children: t.map((d, E) => /* @__PURE__ */ e(
183
- rn,
181
+ /* @__PURE__ */ e("div", { className: "mx-cmn-calendar-header-row", children: D[0].map((t, m) => /* @__PURE__ */ e("div", { className: "mx-cmn-calendar-header-cell", children: /* @__PURE__ */ e(G, { bold: !0, variant: "Small", children: y(t, "EEEEE") }) }, m)) }),
182
+ D.map((t, m) => /* @__PURE__ */ e("div", { className: "mx-cmn-calendar-week", children: t.map((d, O) => /* @__PURE__ */ e(
183
+ sn,
184
184
  {
185
- beginDate: l,
185
+ beginDate: i,
186
186
  date: d,
187
- endDate: O,
188
- isInMonth: U(d, c),
189
- onClick: v
187
+ endDate: R,
188
+ isInMonth: W(d, s),
189
+ onClick: K
190
190
  },
191
- E
192
- )) }, `w-${_}`)),
193
- /* @__PURE__ */ e("div", { className: "mx-cmn-calendar-today-container", children: /* @__PURE__ */ e(S, { onClick: G, size: "small", variant: "text", children: n.today }) })
191
+ O
192
+ )) }, `w-${m}`)),
193
+ /* @__PURE__ */ e("div", { className: "mx-cmn-calendar-today-container", children: /* @__PURE__ */ e(E, { onClick: M, size: "small", variant: "text", children: n.today }) })
194
194
  ] }) });
195
- }, ln = () => R({
196
- width: sn,
195
+ }, mn = (n) => p({
196
+ width: ln,
197
197
  "& .MuiPaper-root": {
198
198
  paddingLeft: 24,
199
199
  paddingRight: 24,
@@ -224,7 +224,7 @@ const bn = ({
224
224
  },
225
225
  "& .mx-cmn-calendar-today-container": {
226
226
  display: "block",
227
- marginTop: 16,
227
+ marginTop: n.Spacing.Medium,
228
228
  textAlign: "center",
229
229
  width: "100%",
230
230
  "& > .MuiButton-root": {
@@ -233,23 +233,23 @@ const bn = ({
233
233
  marginRight: "auto"
234
234
  }
235
235
  }
236
- }), wn = ({
236
+ }), Bn = Nn, Pn = ({
237
237
  children: n,
238
238
  clickEventName: a,
239
239
  onClick: o,
240
240
  sx: r = {}
241
241
  }) => {
242
- const { onEvent: i } = nn();
243
- return o ? /* @__PURE__ */ e(u, { sx: { bgcolor: "background.paper", ...r }, children: /* @__PURE__ */ e(
244
- Q,
242
+ const { onEvent: c } = tn();
243
+ return o ? /* @__PURE__ */ e(k, { sx: { bgcolor: "background.paper", ...r }, children: /* @__PURE__ */ e(
244
+ an,
245
245
  {
246
246
  onClick: () => {
247
- a && i(a), o();
247
+ a && c(a), o();
248
248
  },
249
249
  children: n
250
250
  }
251
251
  ) }) : /* @__PURE__ */ e(
252
- u,
252
+ k,
253
253
  {
254
254
  disableGutters: !1,
255
255
  disablePadding: !1,
@@ -257,7 +257,7 @@ const bn = ({
257
257
  children: n
258
258
  }
259
259
  );
260
- }, Hn = {
260
+ }, $n = {
261
261
  ON_TRANSACTION_CATEGORY_CLICK: "onTransactionCategoryClick",
262
262
  ON_TRANSACTION_CATEGORY_CHANGED: "onTransactionCategoryChanged",
263
263
  ON_TRANSACTION_MANUAL_ADD_CLICK: "onTransactionManualAddClick",
@@ -301,13 +301,13 @@ const bn = ({
301
301
  ON_TRANSACTION_UNHIDE_CANCEL_CLICK: "onTransactionUnHideCancelClick",
302
302
  ON_TRANSACTION_UNSPLIT: "onTransactionUnsplit",
303
303
  ON_TRANSACTION_UNSPLIT_CANCEL: "onTransactionUnsplitCancel"
304
- }, Bn = (n, a) => !!n.find((o) => o.feature_name === a)?.is_enabled;
304
+ }, Un = (n, a) => !!n.find((o) => o.feature_name === a)?.is_enabled;
305
305
  export {
306
- bn as C,
307
- wn as L,
308
- Hn as O,
309
- an as T,
310
- tn as a,
311
- Tn as b,
312
- Bn as i
306
+ Bn as C,
307
+ Pn as L,
308
+ $n as O,
309
+ on as T,
310
+ en as a,
311
+ Cn as b,
312
+ Un as i
313
313
  };