@mx-cartographer/experiences 7.0.2 → 7.0.4

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.
@@ -1,57 +0,0 @@
1
- import { jsxs as o, jsx as n } from "react/jsx-runtime";
2
- import p from "react";
3
- import { observer as d } from "mobx-react-lite";
4
- import R from "@mui/material/Box";
5
- import g from "@mui/material/Tab";
6
- import T from "@mui/material/Tabs";
7
- import b from "@mui/material/Divider";
8
- import f from "@mui/material/List";
9
- import { R as h, A as C, M as E } from "./ManageIncome-B6kmMN_z.mjs";
10
- import { u as l, h as S, e as u } from "./hooks-02T565vf.mjs";
11
- import { R as A, F as v } from "./RepeatingTransaction-BPWfaB3f.mjs";
12
- import { A as m } from "./WidgetContainer-BG-fdDOf.mjs";
13
- const x = d(() => {
14
- const { recurring: r } = l(), { repeatingTransactions: i } = S(), { onEvent: a } = u(), t = (e) => {
15
- a(m.RECURRING_TRANSACTIONS_CLICK_EXPENSE, {
16
- repeating_transaction_guid: e.guid
17
- });
18
- }, c = () => {
19
- a(m.RECURRING_TRANSACTIONS_CLICK_ADD_EXPENSE);
20
- }, s = i.filter(
21
- (e) => e.repeating_transaction_type !== A.Income && (e.transactions.length > 0 || e.recurrence_type === v.EveryYear)
22
- );
23
- return /* @__PURE__ */ o(f, { sx: { bgcolor: "background.paper" }, children: [
24
- s.map((e, _) => /* @__PURE__ */ o(p.Fragment, { children: [
25
- /* @__PURE__ */ n(h, { onClick: t, repeatingTransaction: e }),
26
- /* @__PURE__ */ n(b, { variant: _ < s.length - 1 ? "inset" : "fullWidth" })
27
- ] }, e.guid)),
28
- /* @__PURE__ */ n(C, { label: r.add_expense, onAddRecurringTransaction: c })
29
- ] });
30
- }), O = d(() => {
31
- const [r, i] = p.useState(0), { onEvent: a } = u(), { recurring: t } = l();
32
- return /* @__PURE__ */ o(R, { bgcolor: "background.default", height: "100%", children: [
33
- /* @__PURE__ */ o(
34
- T,
35
- {
36
- onChange: (s, e) => {
37
- i(e), a(
38
- e === 0 ? "recurring_transactions_widget_manage_expenses" : "recurring_transactions_widget_edit_income"
39
- );
40
- },
41
- sx: { bgcolor: "background.paper" },
42
- value: r,
43
- variant: "fullWidth",
44
- children: [
45
- /* @__PURE__ */ n(g, { label: t.manage_expenses }),
46
- /* @__PURE__ */ n(g, { label: t.manage_income })
47
- ]
48
- }
49
- ),
50
- r === 0 && /* @__PURE__ */ n(x, {}),
51
- r === 1 && /* @__PURE__ */ n(E, {})
52
- ] });
53
- });
54
- export {
55
- x as M,
56
- O as R
57
- };
@@ -1,282 +0,0 @@
1
- import { jsxs as O, Fragment as Y, jsx as d } from "react/jsx-runtime";
2
- import B from "@mui/material/Avatar";
3
- import M from "@mui/material/ListItem";
4
- import P from "@mui/material/ListItemAvatar";
5
- import L from "@mui/material/ListItemButton";
6
- import U from "@mui/material/ListItemText";
7
- import { Icon as w, IconWeight as G } from "@mxenabled/mxui";
8
- import S from "@mui/material/ListItemIcon";
9
- import C from "@mui/material/MenuItem";
10
- import $ from "@mui/material/TextField";
11
- import { ExpandMore as j } from "@mxenabled/mx-icons";
12
- import { addDays as W } from "date-fns/addDays";
13
- import { addMonths as z } from "date-fns/addMonths";
14
- import { addQuarters as Q } from "date-fns/addQuarters";
15
- import { addYears as K } from "date-fns/addYears";
16
- import { formatISO as H } from "date-fns/formatISO";
17
- import { fromUnixTime as V } from "date-fns/fromUnixTime";
18
- import { getUnixTime as y } from "date-fns/getUnixTime";
19
- import { isAfter as l } from "date-fns/isAfter";
20
- import { isBefore as u } from "date-fns/isBefore";
21
- import { isSameDay as X } from "date-fns/isSameDay";
22
- import { nextDay as k } from "date-fns/nextDay";
23
- import { parseISO as J } from "date-fns/parseISO";
24
- import { setDate as E } from "date-fns/setDate";
25
- import { startOfToday as g } from "date-fns/startOfToday";
26
- import { subDays as p } from "date-fns/subDays";
27
- import { subMonths as Z } from "date-fns/subMonths";
28
- import { subQuarters as A } from "date-fns/subQuarters";
29
- import { subYears as T } from "date-fns/subYears";
30
- import { lastDayOfMonth as q } from "date-fns/lastDayOfMonth";
31
- import { setDayOfYear as F } from "date-fns/setDayOfYear";
32
- import { g as R, a as ee, b as te, c as re, d as oe, e as ae, f as ne } from "./DateUtil-BcuH7ErC.mjs";
33
- import { b as I } from "./NumberFormatting-CtWHhyBX.mjs";
34
- import { f as x, D as v } from "./Dialog-CWW597AF.mjs";
35
- import { b as h } from "./Localization-2MODESHW.mjs";
36
- const se = ({ iconName: e, label: o, onClick: t, value: n }) => {
37
- const a = /* @__PURE__ */ O(Y, { children: [
38
- /* @__PURE__ */ d(P, { children: /* @__PURE__ */ d(B, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ d(w, { name: e, sx: { color: "text.primary" }, weight: G.Dark }) }) }),
39
- /* @__PURE__ */ d(
40
- U,
41
- {
42
- primary: o,
43
- primaryTypographyProps: { variant: "XSmall" },
44
- secondary: n,
45
- secondaryTypographyProps: { color: "text.default", variant: "Body", fontWeight: 600 }
46
- }
47
- )
48
- ] });
49
- return t ? /* @__PURE__ */ d(M, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ O(L, { onClick: t, children: [
50
- a,
51
- /* @__PURE__ */ d(S, { children: /* @__PURE__ */ d(w, { name: "chevron_right", size: 24 }) })
52
- ] }) }) : /* @__PURE__ */ d(M, { disableGutters: !1, disablePadding: !1, children: a });
53
- }, Fe = se, Re = ({ label: e, onChange: o, options: t, value: n }) => /* @__PURE__ */ d(
54
- $,
55
- {
56
- InputLabelProps: { shrink: !0 },
57
- SelectProps: {
58
- IconComponent: (r) => /* @__PURE__ */ d(j, { size: 20, sx: { mr: 4 }, ...r })
59
- },
60
- defaultValue: 0,
61
- label: e,
62
- onChange: (r) => {
63
- o(Number(r.target.value));
64
- },
65
- select: !0,
66
- value: n,
67
- variant: "outlined",
68
- children: t.map((r) => /* @__PURE__ */ d(C, { value: r.id, children: r.label }, r.id))
69
- }
70
- ), ce = (e) => {
71
- if (!e) return "";
72
- let o = e.user_name || e.feed_name || "";
73
- return e.account_number && (o = `${o} *${e.account_number}`), o;
74
- }, ie = (e, o) => {
75
- const t = [], n = e.transactions.find(
76
- (m) => m.repeating_transaction_guid === e.guid
77
- );
78
- if (!n) return [];
79
- const a = J(e.predicted_occurs_on), r = {
80
- accountGuid: e.account?.guid || "",
81
- amount: e.amount,
82
- categoryGuid: n.category_guid || "",
83
- expectedDate: a,
84
- frequency: e.recurrence_type,
85
- institutionGuid: e.account?.institution_guid || "",
86
- institutionName: ce(e.account),
87
- merchantGuid: e.merchant_guid,
88
- name: e.description,
89
- recurrenceDay: e.recurrence_day,
90
- repeatingTransactionGuid: e.guid,
91
- secondRecurrenceDay: e.second_recurrence_day,
92
- status: f.Upcoming,
93
- type: e.repeating_transaction_type === N.Income ? b.Income : b.Expense,
94
- transaction: void 0
95
- }, i = o.start, c = o.end;
96
- switch (e.recurrence_type) {
97
- case s.EveryWeek:
98
- t.push(...ue(r, i, c));
99
- break;
100
- case s.EveryOtherWeek:
101
- t.push(...de(r, i, c));
102
- break;
103
- case s.TwiceAMonth:
104
- t.push(...me(r, i));
105
- break;
106
- case s.EveryMonth:
107
- t.push(...he(r, i));
108
- break;
109
- case s.EveryOtherMonth:
110
- t.push(...le(r, i, c));
111
- break;
112
- case s.EveryQuarter:
113
- t.push(...fe(r, i, c));
114
- break;
115
- case s.EveryOtherQuarter:
116
- t.push(...ye(r, i, c));
117
- break;
118
- case s.EveryYear:
119
- t.push(...pe(r, i, c));
120
- break;
121
- }
122
- for (const m of t) {
123
- const D = e.transactions.find(
124
- (_) => _.repeating_transaction_guid === e.guid && _.date > y(p(m.expectedDate, 5)) && _.date < y(W(m.expectedDate, 5))
125
- );
126
- D ? (m.transaction = D, m.status = f.Paid, m.occurredOnDate = V(D.date)) : u(m.expectedDate, p(g(), 3)) && (m.status = f.Missed);
127
- }
128
- return t;
129
- }, ue = (e, o, t) => {
130
- const n = [];
131
- let a = k(o, e.recurrenceDay);
132
- for (; u(a, t); )
133
- n.push({ ...e, expectedDate: a }), a = k(a, e.recurrenceDay);
134
- return n;
135
- }, de = (e, o, t) => {
136
- const n = [], a = e.expectedDate;
137
- if (u(a, t)) {
138
- let r = p(a, 14);
139
- for (; l(r, o) || X(r, o); )
140
- n.push({ ...e, expectedDate: r }), r = p(r, 14);
141
- for (r = a; l(r, o) && u(r, t); )
142
- n.push({ ...e, expectedDate: r }), r = W(r, 14);
143
- }
144
- return n;
145
- }, me = (e, o) => {
146
- const t = [], n = E(o, e.recurrenceDay), a = e.secondRecurrenceDay && e.secondRecurrenceDay < 28 ? E(o, e.secondRecurrenceDay) : q(o);
147
- return t.push({ ...e, expectedDate: n }), t.push({ ...e, expectedDate: a }), t;
148
- }, he = (e, o) => {
149
- const t = [], n = E(o, e.recurrenceDay);
150
- return t.push({ ...e, expectedDate: n }), t;
151
- }, le = (e, o, t) => {
152
- const n = [], a = e.expectedDate;
153
- let r = u(a, t) ? a : Z(a, 2);
154
- for (; u(r, t); )
155
- l(r, o) && n.push({ ...e, expectedDate: r }), r = z(r, 2);
156
- return n;
157
- }, fe = (e, o, t) => {
158
- const n = [], a = e.expectedDate;
159
- let r = u(a, t) ? a : A(a, 1);
160
- for (; u(r, t); )
161
- l(r, o) && n.push({ ...e, expectedDate: r }), r = Q(r, 1);
162
- return n;
163
- }, ye = (e, o, t) => {
164
- const n = [], a = e.expectedDate;
165
- let r = u(a, t) ? a : A(a, 2);
166
- for (; u(r, t); )
167
- l(r, o) && n.push({ ...e, expectedDate: r }), r = Q(r, 2);
168
- return n;
169
- }, pe = (e, o, t) => {
170
- const n = [], a = e.expectedDate;
171
- let r = u(a, t) ? a : T(a, 1);
172
- for (; u(r, t); )
173
- l(r, o) && n.push({ ...e, expectedDate: r }), r = K(r, 1);
174
- return n;
175
- }, et = (e, o) => {
176
- const t = [];
177
- for (const n of e) {
178
- const a = ie(n, o);
179
- t.push(...a);
180
- }
181
- return t.sort(
182
- (n, a) => y(n.occurredOnDate || n.expectedDate) - y(a.occurredOnDate || a.expectedDate)
183
- );
184
- }, tt = (e, o, t) => {
185
- const n = [];
186
- for (const a of o) {
187
- const r = t.filter(
188
- (i) => i.repeating_transaction_guid === a.guid
189
- );
190
- t.length > 0 && n.push({
191
- ...a,
192
- account: e.find((i) => i.guid === a.account_guid),
193
- transactions: r
194
- });
195
- }
196
- return n;
197
- }, rt = (e) => e.reduce((o, t) => {
198
- const n = H(t.expectedDate, { representation: "date" }), a = o.find(
199
- (r) => r.date.toString() === t.expectedDate.toString()
200
- );
201
- return a ? a.recurrences.push(t) : o.push({
202
- date: t.expectedDate,
203
- id: `date-${n}`,
204
- recurrences: [t]
205
- }), o;
206
- }, []), ot = (e, o, t) => {
207
- const n = k(g(), o.recurrence_day), a = F(g(), o.recurrence_day), r = I(o.recurrence_day), i = o.second_recurrence_day ? I(o.second_recurrence_day) : "";
208
- let c = t ? h(e.monthly_ordinal, r) : e.monthly;
209
- switch (o.recurrence_type) {
210
- case s.EveryQuarter:
211
- c = t ? h(e.quarterly_ordinal, r) : e.quarterly;
212
- break;
213
- case s.EveryWeek:
214
- c = t ? h(
215
- e.weekly_ordinal,
216
- x(n, v.DAY_OF_WEEK)
217
- ) : e.weekly;
218
- break;
219
- case s.EveryYear:
220
- c = t ? h(
221
- e.anually_ordinal,
222
- x(a, v.MONTH_DAY)
223
- ) : e.anually;
224
- break;
225
- case s.EveryOtherWeek:
226
- c = t ? h(
227
- e.every_other_week_ordinal,
228
- x(n, v.DAY_OF_WEEK)
229
- ) : e.every_other_week;
230
- break;
231
- case s.EveryOtherMonth:
232
- c = t ? h(e.every_other_month_ordinal, r) : e.every_other_month;
233
- break;
234
- case s.EveryOtherQuarter:
235
- c = t ? h(e.every_other_quarter_ordinal, r) : e.every_other_quarter;
236
- break;
237
- case s.TwiceAMonth:
238
- c = t ? h(e.twice_a_month_ordinal, r, i) : e.twice_a_month;
239
- break;
240
- }
241
- return c;
242
- }, at = (e, o) => {
243
- let t = o;
244
- switch (e) {
245
- case s.EveryWeek:
246
- t = ne(o);
247
- break;
248
- case s.EveryOtherWeek:
249
- t = ae(o);
250
- break;
251
- case s.EveryMonth:
252
- t = oe(o);
253
- break;
254
- case s.EveryOtherMonth:
255
- t = re(o);
256
- break;
257
- case s.EveryQuarter:
258
- t = te(o);
259
- break;
260
- case s.EveryOtherQuarter:
261
- t = ee(o);
262
- break;
263
- case s.EveryYear:
264
- t = R(o);
265
- break;
266
- }
267
- return t;
268
- };
269
- var s = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.EveryWeek = 1] = "EveryWeek", e[e.EveryOtherWeek = 2] = "EveryOtherWeek", e[e.EveryMonth = 3] = "EveryMonth", e[e.EveryOtherMonth = 4] = "EveryOtherMonth", e[e.EveryQuarter = 5] = "EveryQuarter", e[e.EveryOtherQuarter = 6] = "EveryOtherQuarter", e[e.EveryYear = 7] = "EveryYear", e[e.TwiceAMonth = 8] = "TwiceAMonth", e))(s || {}), f = /* @__PURE__ */ ((e) => (e[e.Paid = 0] = "Paid", e[e.Missed = 1] = "Missed", e[e.Upcoming = 2] = "Upcoming", e))(f || {}), b = /* @__PURE__ */ ((e) => (e[e.Expense = 0] = "Expense", e[e.Income = 1] = "Income", e))(b || {}), N = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Subscription = 1] = "Subscription", e[e.Bill = 2] = "Bill", e[e.Income = 3] = "Income", e[e.Transfer = 4] = "Transfer", e))(N || {});
270
- export {
271
- Fe as D,
272
- s as F,
273
- N as R,
274
- Re as S,
275
- f as a,
276
- et as b,
277
- b as c,
278
- tt as d,
279
- at as e,
280
- rt as f,
281
- ot as g
282
- };