@mx-cartographer/experiences 3.13.5-alpha.mm.4 → 3.13.5-alpha.mm.6
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.
- package/dist/index.es.js +99 -99
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -31,9 +31,9 @@ import { eachDayOfInterval as io } from "date-fns/eachDayOfInterval";
|
|
|
31
31
|
import { eachWeekOfInterval as oo } from "date-fns/eachWeekOfInterval";
|
|
32
32
|
import { endOfMonth as DA } from "date-fns/endOfMonth";
|
|
33
33
|
import { format as kA } from "date-fns/format";
|
|
34
|
-
import { isBefore as
|
|
34
|
+
import { isBefore as mA } from "date-fns/isBefore";
|
|
35
35
|
import { isSameMonth as so } from "date-fns/isSameMonth";
|
|
36
|
-
import { startOfMonth as
|
|
36
|
+
import { startOfMonth as pA } from "date-fns/startOfMonth";
|
|
37
37
|
import { startOfToday as J } from "date-fns/startOfToday";
|
|
38
38
|
import { subMonths as ue } from "date-fns/subMonths";
|
|
39
39
|
import he from "@mui/material/Paper";
|
|
@@ -1681,7 +1681,7 @@ const ec = ({
|
|
|
1681
1681
|
h(e), m(n), e && u(e);
|
|
1682
1682
|
}, [e, n]);
|
|
1683
1683
|
const f = C.useMemo(() => {
|
|
1684
|
-
const L = oo({ start:
|
|
1684
|
+
const L = oo({ start: pA(c), end: DA(c) }), P = [];
|
|
1685
1685
|
for (let x = 0; x < L.length; x++) {
|
|
1686
1686
|
const O = L[x], N = io({ start: O, end: me(O, 6) }), q = [];
|
|
1687
1687
|
for (let B = 0; B < N.length; B++)
|
|
@@ -1695,7 +1695,7 @@ const ec = ({
|
|
|
1695
1695
|
h(L), r?.(L);
|
|
1696
1696
|
return;
|
|
1697
1697
|
}
|
|
1698
|
-
!l || g ? (h(L), m(void 0)) :
|
|
1698
|
+
!l || g ? (h(L), m(void 0)) : mA(L, l) ? (m(l), h(L), a?.(L, l)) : (m(L), a?.(l, L));
|
|
1699
1699
|
}
|
|
1700
1700
|
}, p = () => {
|
|
1701
1701
|
const L = J();
|
|
@@ -2215,8 +2215,8 @@ const ec = ({
|
|
|
2215
2215
|
hoveredAreaData: null,
|
|
2216
2216
|
isAreaHovered: !1,
|
|
2217
2217
|
cursorPos: { x: 0, y: 0 }
|
|
2218
|
-
}), { hoveredSeriesId: y, hoveredAreaData: p, isAreaHovered: S, cursorPos: I } = m, L = S && y && p, P = !L, x = [...a, ...i], O = x[0]
|
|
2219
|
-
(R, AA) => a.reduce((
|
|
2218
|
+
}), { hoveredSeriesId: y, hoveredAreaData: p, isAreaHovered: S, cursorPos: I } = m, L = S && y && p, P = !L, x = [...a, ...i], O = x[0]?.dataset.length ?? 0, N = x.flatMap((R) => R.dataset.map((AA) => AA.x)), q = x.flatMap((R) => R.dataset.map((AA) => AA.y)), B = a[0]?.dataset?.map(
|
|
2219
|
+
(R, AA) => a.reduce((EA, ZA) => EA + ZA.dataset[AA]?.y || 0, 0)
|
|
2220
2220
|
) ?? [0], k = Math.max(...B), X = Math.max(
|
|
2221
2221
|
...i.flatMap((R) => R.dataset.map((AA) => AA.y))
|
|
2222
2222
|
), F = Math.floor(Math.min(...q) / 100) * 100, aA = Math.ceil(Math.max(k, X) / 100) * 100, iA = a.map((R, AA) => ({
|
|
@@ -2225,36 +2225,36 @@ const ec = ({
|
|
|
2225
2225
|
top_level_guid: R.top_level_category_guid,
|
|
2226
2226
|
area: !0,
|
|
2227
2227
|
color: a[AA].category_color ?? c.palette.primary.main,
|
|
2228
|
-
data: R.dataset.map((
|
|
2228
|
+
data: R.dataset.map((EA) => EA.y),
|
|
2229
2229
|
label: a[AA].category_name,
|
|
2230
2230
|
stack: "total",
|
|
2231
2231
|
type: "line",
|
|
2232
2232
|
highlightScope: { highlight: "item" },
|
|
2233
|
-
valueFormatter: (
|
|
2234
|
-
})),
|
|
2233
|
+
valueFormatter: (EA) => Q(EA, "0,0")
|
|
2234
|
+
})), vA = i.map((R, AA) => ({
|
|
2235
2235
|
id: `unstacked-${AA}`,
|
|
2236
2236
|
guid: R.category_guid,
|
|
2237
2237
|
top_level_guid: R.top_level_category_guid,
|
|
2238
2238
|
area: !1,
|
|
2239
2239
|
color: R.category_color,
|
|
2240
|
-
data: R.dataset.map((
|
|
2240
|
+
data: R.dataset.map((EA) => EA.y),
|
|
2241
2241
|
label: R.category_name,
|
|
2242
2242
|
type: "line",
|
|
2243
|
-
valueFormatter: (
|
|
2244
|
-
})), uA = [...iA, ...
|
|
2243
|
+
valueFormatter: (EA) => Q(EA, "0,0")
|
|
2244
|
+
})), uA = [...iA, ...vA], wA = [
|
|
2245
2245
|
...iA.map(({ guid: R, top_level_guid: AA }) => ({
|
|
2246
2246
|
guid: R,
|
|
2247
2247
|
top_level_guid: AA
|
|
2248
2248
|
})),
|
|
2249
|
-
...
|
|
2249
|
+
...vA.map(({ guid: R, top_level_guid: AA }) => ({
|
|
2250
2250
|
guid: R,
|
|
2251
2251
|
top_level_guid: AA
|
|
2252
2252
|
}))
|
|
2253
2253
|
], ce = (R) => {
|
|
2254
|
-
const
|
|
2254
|
+
const EA = R.startsWith("stacked-") ? a[parseInt(R.split("-")[1])] : i[parseInt(R.split("-")[1])];
|
|
2255
2255
|
return {
|
|
2256
|
-
guid:
|
|
2257
|
-
topLevelGuid:
|
|
2256
|
+
guid: EA.category_guid,
|
|
2257
|
+
topLevelGuid: EA.top_level_category_guid
|
|
2258
2258
|
};
|
|
2259
2259
|
}, le = (R) => {
|
|
2260
2260
|
g(R), n?.(R ?? "");
|
|
@@ -2266,8 +2266,8 @@ const ec = ({
|
|
|
2266
2266
|
{
|
|
2267
2267
|
onMouseMove: (R) => {
|
|
2268
2268
|
const AA = R.currentTarget.getBoundingClientRect();
|
|
2269
|
-
f((
|
|
2270
|
-
...
|
|
2269
|
+
f((EA) => ({
|
|
2270
|
+
...EA,
|
|
2271
2271
|
cursorPos: {
|
|
2272
2272
|
x: R.clientX - AA.left,
|
|
2273
2273
|
y: R.clientY - AA.top
|
|
@@ -2289,8 +2289,8 @@ const ec = ({
|
|
|
2289
2289
|
height: o || 400,
|
|
2290
2290
|
margin: { bottom: 50 },
|
|
2291
2291
|
onHighlightChange: (R) => {
|
|
2292
|
-
const AA = R?.seriesId && uA.find((ae) => ae.id === R.seriesId),
|
|
2293
|
-
if (
|
|
2292
|
+
const AA = R?.seriesId && uA.find((ae) => ae.id === R.seriesId), EA = AA && R?.dataIndex !== void 0, ZA = AA && R?.dataIndex === void 0;
|
|
2293
|
+
if (EA)
|
|
2294
2294
|
f({
|
|
2295
2295
|
hoveredSeriesId: String(R.seriesId),
|
|
2296
2296
|
hoveredAreaData: null,
|
|
@@ -2348,10 +2348,10 @@ const ec = ({
|
|
|
2348
2348
|
'& [class*="MuiLineElement-series-unstacked-"]': {
|
|
2349
2349
|
strokeWidth: 3
|
|
2350
2350
|
},
|
|
2351
|
-
...h && iA.reduce((R, AA,
|
|
2352
|
-
const ZA = `.MuiAreaElement-series-stacked-${
|
|
2351
|
+
...h && iA.reduce((R, AA, EA) => {
|
|
2352
|
+
const ZA = `.MuiAreaElement-series-stacked-${EA}`;
|
|
2353
2353
|
return R[ZA] = {
|
|
2354
|
-
opacity: iA[
|
|
2354
|
+
opacity: iA[EA].guid === h ? 0.9 : 0.2
|
|
2355
2355
|
}, R;
|
|
2356
2356
|
}, {})
|
|
2357
2357
|
},
|
|
@@ -2559,7 +2559,7 @@ const ec = ({
|
|
|
2559
2559
|
calendarActions: A,
|
|
2560
2560
|
color: e = "primary",
|
|
2561
2561
|
copy: n,
|
|
2562
|
-
range: r = [
|
|
2562
|
+
range: r = [pA(J()), DA(Me())],
|
|
2563
2563
|
shouldShrinkToIcon: a = !0,
|
|
2564
2564
|
toolTipContent: i = "",
|
|
2565
2565
|
variant: o = "outlined"
|
|
@@ -2579,14 +2579,14 @@ const ec = ({
|
|
|
2579
2579
|
const F = DA(Me());
|
|
2580
2580
|
return [DA(ue(F, x)), F];
|
|
2581
2581
|
}, B = (F) => {
|
|
2582
|
-
const aA = [...h], iA = h[0],
|
|
2582
|
+
const aA = [...h], iA = h[0], vA = h[1], uA = F === "previous";
|
|
2583
2583
|
if (m === n.dateRangePickerCopy.dateRangeThisMonth)
|
|
2584
|
-
aA[0] = uA ? ue(iA, 1) : $A(iA, 1), aA[1] = DA(uA ? ue(
|
|
2584
|
+
aA[0] = uA ? ue(iA, 1) : $A(iA, 1), aA[1] = DA(uA ? ue(vA, 1) : $A(vA, 1));
|
|
2585
2585
|
else if (m === n.dateRangePickerCopy.dateRangeYTD || m === n.dateRangePickerCopy.dateRangeLastYear)
|
|
2586
2586
|
aA[0] = uA ? Er(vr(iA), 1) : Ct(vr(iA), 1), aA[1] = uA ? Er(pr(iA), 1) : Ct(pr(iA), 1);
|
|
2587
2587
|
else {
|
|
2588
|
-
const wA = xo(
|
|
2589
|
-
aA[0] = F === "previous" ? pe(iA, wA) : me(iA, wA), aA[1] = F === "previous" ? pe(
|
|
2588
|
+
const wA = xo(vA, iA);
|
|
2589
|
+
aA[0] = F === "previous" ? pe(iA, wA) : me(iA, wA), aA[1] = F === "previous" ? pe(vA, wA) : me(vA, wA);
|
|
2590
2590
|
}
|
|
2591
2591
|
g(aA), A.onRangeChanged(aA);
|
|
2592
2592
|
}, k = () => {
|
|
@@ -3594,7 +3594,7 @@ class Nc {
|
|
|
3594
3594
|
api = new zr("/", "");
|
|
3595
3595
|
categoryApi = new Bt("/", "");
|
|
3596
3596
|
globalStore;
|
|
3597
|
-
dateRange = { start:
|
|
3597
|
+
dateRange = { start: pA(J()), end: DA(J()) };
|
|
3598
3598
|
budgets = [];
|
|
3599
3599
|
categoryTotals = [];
|
|
3600
3600
|
theme = {};
|
|
@@ -4280,7 +4280,7 @@ const _c = [
|
|
|
4280
4280
|
}, Xc = (A, e, n) => {
|
|
4281
4281
|
const {
|
|
4282
4282
|
accounts: r = [],
|
|
4283
|
-
dateRange: a = { start:
|
|
4283
|
+
dateRange: a = { start: pA(J()), end: Me() },
|
|
4284
4284
|
custom: i = () => !0,
|
|
4285
4285
|
searchTerm: o = ""
|
|
4286
4286
|
} = A;
|
|
@@ -4333,7 +4333,7 @@ const ei = {
|
|
|
4333
4333
|
tags: []
|
|
4334
4334
|
};
|
|
4335
4335
|
let Yc = class {
|
|
4336
|
-
beginDate =
|
|
4336
|
+
beginDate = pA(/* @__PURE__ */ new Date());
|
|
4337
4337
|
endDate = DA(/* @__PURE__ */ new Date());
|
|
4338
4338
|
expandedSplits = [];
|
|
4339
4339
|
isInitialized = !1;
|
|
@@ -4391,7 +4391,7 @@ class Vc {
|
|
|
4391
4391
|
}
|
|
4392
4392
|
initialize = async (e, n) => {
|
|
4393
4393
|
this.api = new Br(e, n), this.beatApi = new Ze(e, n), Promise.all([
|
|
4394
|
-
this.loadAssociatedBeats(
|
|
4394
|
+
this.loadAssociatedBeats(pA(/* @__PURE__ */ new Date())),
|
|
4395
4395
|
this.loadTags(),
|
|
4396
4396
|
this.loadTaggings(),
|
|
4397
4397
|
this.loadTransactionRules(),
|
|
@@ -4497,7 +4497,7 @@ class Vc {
|
|
|
4497
4497
|
}
|
|
4498
4498
|
};
|
|
4499
4499
|
setFilter = (e) => {
|
|
4500
|
-
this.filter = e, e.dateRange &&
|
|
4500
|
+
this.filter = e, e.dateRange && mA(e.dateRange.start, this.cachedStartDate) && this.loadTransactions(e.dateRange.start, Me()).then(() => {
|
|
4501
4501
|
e.dateRange && (this.cachedStartDate = e.dateRange.start);
|
|
4502
4502
|
});
|
|
4503
4503
|
};
|
|
@@ -4629,7 +4629,7 @@ const JA = () => {
|
|
|
4629
4629
|
}, Ar = (A) => {
|
|
4630
4630
|
const e = mt(A);
|
|
4631
4631
|
let n = wn(A, e);
|
|
4632
|
-
for (;
|
|
4632
|
+
for (; mA(n, J()); )
|
|
4633
4633
|
n = Ve(n, 1);
|
|
4634
4634
|
return n;
|
|
4635
4635
|
}, el = (A) => {
|
|
@@ -4637,7 +4637,7 @@ const JA = () => {
|
|
|
4637
4637
|
return Ve(e, 1);
|
|
4638
4638
|
}, kr = (A) => {
|
|
4639
4639
|
let e = Ln(J(), A.getDate());
|
|
4640
|
-
for (;
|
|
4640
|
+
for (; mA(e, J()); )
|
|
4641
4641
|
e = $A(e, 1);
|
|
4642
4642
|
return e;
|
|
4643
4643
|
}, tl = (A) => {
|
|
@@ -4645,7 +4645,7 @@ const JA = () => {
|
|
|
4645
4645
|
return $A(e, 1);
|
|
4646
4646
|
}, ti = (A) => {
|
|
4647
4647
|
let e = _e(A, 1);
|
|
4648
|
-
for (;
|
|
4648
|
+
for (; mA(e, J()); )
|
|
4649
4649
|
e = _e(e, 1);
|
|
4650
4650
|
return e;
|
|
4651
4651
|
}, nl = (A) => {
|
|
@@ -5270,7 +5270,7 @@ const fl = ({
|
|
|
5270
5270
|
}, jr = (A) => {
|
|
5271
5271
|
const e = [], n = J();
|
|
5272
5272
|
for (let r = 0; r < Qr; r++) {
|
|
5273
|
-
const a =
|
|
5273
|
+
const a = pA(ue(n, Qr - r)), o = A.filter(
|
|
5274
5274
|
(s) => s.year_month === Number(kA(a, "yyyyMM"))
|
|
5275
5275
|
).reduce((s, c) => s + c.total, 0);
|
|
5276
5276
|
e.push({
|
|
@@ -5371,7 +5371,7 @@ class Bl {
|
|
|
5371
5371
|
}
|
|
5372
5372
|
};
|
|
5373
5373
|
loadMonthlyCategoryTotals = async (e = this.globalStore.accountStore.accounts, n, r) => {
|
|
5374
|
-
const a = fA(
|
|
5374
|
+
const a = fA(pA(n ?? ue(/* @__PURE__ */ new Date(), 11))), i = fA(DA(r ?? /* @__PURE__ */ new Date()));
|
|
5375
5375
|
try {
|
|
5376
5376
|
const o = await this.api.getMonthlyCategoryTotals(a, i, e);
|
|
5377
5377
|
U(() => {
|
|
@@ -6649,15 +6649,15 @@ const ri = ({ transaction: A }) => {
|
|
|
6649
6649
|
selectedAccounts: X,
|
|
6650
6650
|
setDisplayedDate: F,
|
|
6651
6651
|
setSelectedAccounts: aA
|
|
6652
|
-
} = yA(), [iA,
|
|
6652
|
+
} = yA(), [iA, vA] = C.useState(""), [uA, wA] = C.useState(""), [ce, le] = C.useState(!1), [ze, R] = C.useState(!1), [AA, EA] = C.useState(!1);
|
|
6653
6653
|
C.useEffect(() => {
|
|
6654
6654
|
aA(a);
|
|
6655
6655
|
}, [a]), C.useEffect(() => {
|
|
6656
|
-
const IA =
|
|
6656
|
+
const IA = pA(J()), hr = DA(J());
|
|
6657
6657
|
F(IA, hr), p({
|
|
6658
6658
|
dateRange: { start: IA, end: hr },
|
|
6659
6659
|
accounts: X.map((Ui) => Ui.guid)
|
|
6660
|
-
}),
|
|
6660
|
+
}), EA(!0), N(j.TRANSACTIONS_VIEW);
|
|
6661
6661
|
}, []), C.useEffect(() => {
|
|
6662
6662
|
AA && (p({
|
|
6663
6663
|
...f,
|
|
@@ -6684,12 +6684,12 @@ const ri = ({ transaction: A }) => {
|
|
|
6684
6684
|
...ei,
|
|
6685
6685
|
date: fA(J()),
|
|
6686
6686
|
user_guid: O?.user_guid || ""
|
|
6687
|
-
}),
|
|
6687
|
+
}), vA(
|
|
6688
6688
|
"addTransaction"
|
|
6689
6689
|
/* AddTransaction */
|
|
6690
6690
|
), N(j.TRANSACTIONS_CLICK_ADD)) : (le(!0), N(j.TRANSACTIONS_ADD_MANUAL_ACCOUNT_MODAL));
|
|
6691
6691
|
}, Qi = async () => {
|
|
6692
|
-
Tt && await m(s),
|
|
6692
|
+
Tt && await m(s), vA("");
|
|
6693
6693
|
}, Fi = () => {
|
|
6694
6694
|
le(!1), R(!0);
|
|
6695
6695
|
}, ji = () => {
|
|
@@ -6739,13 +6739,13 @@ const ri = ({ transaction: A }) => {
|
|
|
6739
6739
|
{
|
|
6740
6740
|
height: `calc(${e} - ${Ur}px)`,
|
|
6741
6741
|
onCategoryClick: (IA) => {
|
|
6742
|
-
wA(IA),
|
|
6742
|
+
wA(IA), vA(
|
|
6743
6743
|
"category"
|
|
6744
6744
|
/* Category */
|
|
6745
6745
|
);
|
|
6746
6746
|
},
|
|
6747
6747
|
onRowClick: (IA) => {
|
|
6748
|
-
wA(IA),
|
|
6748
|
+
wA(IA), vA(
|
|
6749
6749
|
"transaction"
|
|
6750
6750
|
/* Transaction */
|
|
6751
6751
|
), N(j.TRANSACTIONS_CLICK_DETAILS, { transaction_guid: IA });
|
|
@@ -6766,7 +6766,7 @@ const ri = ({ transaction: A }) => {
|
|
|
6766
6766
|
{
|
|
6767
6767
|
height: `calc(${e} - ${Ur}px)`,
|
|
6768
6768
|
onClick: (IA) => {
|
|
6769
|
-
wA(IA),
|
|
6769
|
+
wA(IA), vA(
|
|
6770
6770
|
"transaction"
|
|
6771
6771
|
/* Transaction */
|
|
6772
6772
|
);
|
|
@@ -6782,7 +6782,7 @@ const ri = ({ transaction: A }) => {
|
|
|
6782
6782
|
ariaLabelClose: P.close_aria,
|
|
6783
6783
|
isOpen: iA === "transaction",
|
|
6784
6784
|
onClose: () => {
|
|
6785
|
-
ae && !ae.has_been_viewed && L({ ...ae, has_been_viewed: !0 }),
|
|
6785
|
+
ae && !ae.has_been_viewed && L({ ...ae, has_been_viewed: !0 }), vA("");
|
|
6786
6786
|
},
|
|
6787
6787
|
title: x.details_title,
|
|
6788
6788
|
children: ae && /* @__PURE__ */ t(Lt, { transaction: ae })
|
|
@@ -6792,7 +6792,7 @@ const ri = ({ transaction: A }) => {
|
|
|
6792
6792
|
wd,
|
|
6793
6793
|
{
|
|
6794
6794
|
onClose: () => {
|
|
6795
|
-
|
|
6795
|
+
vA(""), wA("");
|
|
6796
6796
|
},
|
|
6797
6797
|
transaction: ae
|
|
6798
6798
|
}
|
|
@@ -6803,7 +6803,7 @@ const ri = ({ transaction: A }) => {
|
|
|
6803
6803
|
ariaLabelClose: P.close_aria,
|
|
6804
6804
|
isOpen: iA === "addTransaction",
|
|
6805
6805
|
isPrimaryDisabled: !Tt,
|
|
6806
|
-
onClose: () =>
|
|
6806
|
+
onClose: () => vA(""),
|
|
6807
6807
|
onPrimaryAction: Qi,
|
|
6808
6808
|
title: x.add_transaction_title,
|
|
6809
6809
|
children: /* @__PURE__ */ t(Ed, {})
|
|
@@ -7538,7 +7538,7 @@ const ri = ({ transaction: A }) => {
|
|
|
7538
7538
|
};
|
|
7539
7539
|
}), s = r.filter(
|
|
7540
7540
|
(l) => Je(TA(l.expected_date), {
|
|
7541
|
-
start:
|
|
7541
|
+
start: pA(J()),
|
|
7542
7542
|
end: me(J(), 30)
|
|
7543
7543
|
})
|
|
7544
7544
|
).filter((l) => {
|
|
@@ -7588,19 +7588,19 @@ const ri = ({ transaction: A }) => {
|
|
|
7588
7588
|
recurrenceDay: e.recurrence_day,
|
|
7589
7589
|
scheduledPaymentGuid: e.guid,
|
|
7590
7590
|
transactionGuid: ""
|
|
7591
|
-
}, c = e.recurrence_day, u = J(), l =
|
|
7591
|
+
}, c = e.recurrence_day, u = J(), l = pA(J()), h = me(J(), 30);
|
|
7592
7592
|
let g = l;
|
|
7593
7593
|
switch (e.recurrence_type) {
|
|
7594
7594
|
case K.EveryWeek:
|
|
7595
|
-
for (g = wn(g, c);
|
|
7595
|
+
for (g = wn(g, c); mA(g, h); )
|
|
7596
7596
|
r.push({
|
|
7597
7597
|
...s,
|
|
7598
7598
|
expectedDate: g
|
|
7599
7599
|
}), g = wn(g, c);
|
|
7600
7600
|
break;
|
|
7601
7601
|
case K.EveryOtherWeek:
|
|
7602
|
-
if (
|
|
7603
|
-
for (g = Ve(o, 2);
|
|
7602
|
+
if (mA(o, l))
|
|
7603
|
+
for (g = Ve(o, 2); mA(g, h); )
|
|
7604
7604
|
ft(g, l) && r.push({
|
|
7605
7605
|
...s,
|
|
7606
7606
|
expectedDate: g
|
|
@@ -7614,7 +7614,7 @@ const ri = ({ transaction: A }) => {
|
|
|
7614
7614
|
...s,
|
|
7615
7615
|
expectedDate: g
|
|
7616
7616
|
}), g = yr(g, 2);
|
|
7617
|
-
for (g = Ve(o, 2);
|
|
7617
|
+
for (g = Ve(o, 2); mA(g, h); )
|
|
7618
7618
|
r.push({
|
|
7619
7619
|
...s,
|
|
7620
7620
|
expectedDate: g
|
|
@@ -7631,37 +7631,37 @@ const ri = ({ transaction: A }) => {
|
|
|
7631
7631
|
});
|
|
7632
7632
|
break;
|
|
7633
7633
|
case K.EveryOtherMonth:
|
|
7634
|
-
|
|
7634
|
+
mA(o, l) ? mA($A(o, 2), h) && r.push({
|
|
7635
7635
|
...s,
|
|
7636
7636
|
expectedDate: $A(o, 2)
|
|
7637
|
-
}) :
|
|
7637
|
+
}) : mA(o, h) && r.push({
|
|
7638
7638
|
...s,
|
|
7639
7639
|
expectedDate: o
|
|
7640
7640
|
});
|
|
7641
7641
|
break;
|
|
7642
7642
|
case K.EveryQuarter:
|
|
7643
|
-
|
|
7643
|
+
mA(o, l) ? mA(_e(o, 1), h) && r.push({
|
|
7644
7644
|
...s,
|
|
7645
7645
|
expectedDate: _e(o, 1)
|
|
7646
|
-
}) :
|
|
7646
|
+
}) : mA(o, h) && r.push({
|
|
7647
7647
|
...s,
|
|
7648
7648
|
expectedDate: o
|
|
7649
7649
|
});
|
|
7650
7650
|
break;
|
|
7651
7651
|
case K.EveryOtherQuarter:
|
|
7652
|
-
|
|
7652
|
+
mA(o, l) ? mA(_e(o, 2), h) && r.push({
|
|
7653
7653
|
...s,
|
|
7654
7654
|
expectedDate: _e(o, 2)
|
|
7655
|
-
}) :
|
|
7655
|
+
}) : mA(o, h) && r.push({
|
|
7656
7656
|
...s,
|
|
7657
7657
|
expectedDate: o
|
|
7658
7658
|
});
|
|
7659
7659
|
break;
|
|
7660
7660
|
case K.EveryYear:
|
|
7661
|
-
|
|
7661
|
+
mA(o, l) ? mA(Ct(o, 1), h) && r.push({
|
|
7662
7662
|
...s,
|
|
7663
7663
|
expectedDate: Ct(o, 1)
|
|
7664
|
-
}) :
|
|
7664
|
+
}) : mA(o, h) && r.push({
|
|
7665
7665
|
...s,
|
|
7666
7666
|
expectedDate: o
|
|
7667
7667
|
});
|
|
@@ -7671,7 +7671,7 @@ const ri = ({ transaction: A }) => {
|
|
|
7671
7671
|
const f = n.find(
|
|
7672
7672
|
(y) => y.scheduled_payment_guid === m.scheduledPaymentGuid && y.date > fA(pe(m.expectedDate, 3)) && y.date < fA(me(m.expectedDate, 3))
|
|
7673
7673
|
);
|
|
7674
|
-
f ? (m.transactionGuid = f.guid, m.occurredOnDate = TA(f.date), m.activityStatus = SA.Paid) :
|
|
7674
|
+
f ? (m.transactionGuid = f.guid, m.occurredOnDate = TA(f.date), m.activityStatus = SA.Paid) : mA(m.expectedDate, pe(u, 3)) && (m.activityStatus = SA.Missed);
|
|
7675
7675
|
}), r;
|
|
7676
7676
|
}, Xd = (A, e, n, r, a) => r.map((i) => {
|
|
7677
7677
|
const o = e.find((h) => h.cashflow_sequence_guid === i.guid), s = n.find((h) => h.cashflow_sequence_guid === i.guid), c = a.find((h) => h.guid === o?.transaction_guid), u = A.find((h) => h.guid === c?.account_guid);
|
|
@@ -7735,16 +7735,16 @@ const ri = ({ transaction: A }) => {
|
|
|
7735
7735
|
A === 1 && /* @__PURE__ */ t(mi, {})
|
|
7736
7736
|
] });
|
|
7737
7737
|
}, pi = b(Fd), it = (A, e) => A + e.amount, Cn = (A) => A.activityType === LA.Income && Je(A.expectedDate, {
|
|
7738
|
-
start:
|
|
7738
|
+
start: pA(J()),
|
|
7739
7739
|
end: DA(J())
|
|
7740
7740
|
}), xt = (A) => A.activityType === LA.Expense && Je(A.expectedDate, {
|
|
7741
|
-
start:
|
|
7741
|
+
start: pA(J()),
|
|
7742
7742
|
end: DA(J())
|
|
7743
7743
|
}), fn = (A) => A.occurredOnDate && Je(A.occurredOnDate, {
|
|
7744
|
-
start:
|
|
7744
|
+
start: pA(/* @__PURE__ */ new Date()),
|
|
7745
7745
|
end: me(J(), 30)
|
|
7746
7746
|
}) || Je(A.expectedDate, {
|
|
7747
|
-
start:
|
|
7747
|
+
start: pA(/* @__PURE__ */ new Date()),
|
|
7748
7748
|
end: me(J(), 30)
|
|
7749
7749
|
}), jd = ({ day: A, outsideCurrentMonth: e, ...n }) => {
|
|
7750
7750
|
const { recurring: r } = D(), { selectedAccountGuids: a } = yA(), { activities: i, setSelectedDay: o } = HA(), c = C.useMemo(
|
|
@@ -7830,7 +7830,7 @@ const ri = ({ transaction: A }) => {
|
|
|
7830
7830
|
Bn,
|
|
7831
7831
|
{
|
|
7832
7832
|
maxDate: DA($A(/* @__PURE__ */ new Date(), 1)),
|
|
7833
|
-
minDate:
|
|
7833
|
+
minDate: pA(/* @__PURE__ */ new Date()),
|
|
7834
7834
|
onMonthChange: i,
|
|
7835
7835
|
showDaysOutsideCurrentMonth: !0,
|
|
7836
7836
|
slots: {
|
|
@@ -8274,7 +8274,7 @@ class iu {
|
|
|
8274
8274
|
loadExpectedEvents = async () => {
|
|
8275
8275
|
try {
|
|
8276
8276
|
const e = await this.cashflowApi.getProjectedCashflowEvents(
|
|
8277
|
-
|
|
8277
|
+
pA(J()),
|
|
8278
8278
|
me(J(), 30)
|
|
8279
8279
|
);
|
|
8280
8280
|
U(() => {
|
|
@@ -8586,7 +8586,7 @@ const fu = ({ activity: A }) => /* @__PURE__ */ d(rA, { children: [
|
|
|
8586
8586
|
),
|
|
8587
8587
|
/* @__PURE__ */ t(G, {})
|
|
8588
8588
|
] });
|
|
8589
|
-
}, Zr = b(mu), $r = (A, e) => (n) => n.accountGuid === A.guid && (kn(n.expectedDate) || ft(n.expectedDate, e.start)) &&
|
|
8589
|
+
}, Zr = b(mu), $r = (A, e) => (n) => n.accountGuid === A.guid && (kn(n.expectedDate) || ft(n.expectedDate, e.start)) && mA(n.expectedDate, e.end), pu = () => {
|
|
8590
8590
|
const { cashflow: A } = D(), { upcomingExpenses: e, upcomingIncome: n } = HA(), { dateRange: r, selectedCashAccounts: a } = tt();
|
|
8591
8591
|
return /* @__PURE__ */ d(w, { children: [
|
|
8592
8592
|
/* @__PURE__ */ d(w, { flexDirection: "row", justifyContent: "space-between", children: [
|
|
@@ -8925,7 +8925,7 @@ const fu = ({ activity: A }) => /* @__PURE__ */ d(rA, { children: [
|
|
|
8925
8925
|
e && /* @__PURE__ */ t(NA, { amount: A, component: "h2", symbol: a, variant: "Small" })
|
|
8926
8926
|
]
|
|
8927
8927
|
}
|
|
8928
|
-
), Aa = (A, e) => (n) => n.accountGuid && A.includes(n.accountGuid) && (kn(n.expectedDate) || ft(n.expectedDate, e.start)) &&
|
|
8928
|
+
), Aa = (A, e) => (n) => n.accountGuid && A.includes(n.accountGuid) && (kn(n.expectedDate) || ft(n.expectedDate, e.start)) && mA(n.expectedDate, e.end), Su = () => {
|
|
8929
8929
|
const [A, e] = C.useState(!1), { availableWidth: n } = wt(), { cashflow: r } = D(), { upcomingExpenses: a, upcomingIncome: i } = HA(), { selectedAccountGuids: o } = yA(), { dateRange: s, selectedCashAccounts: c } = tt(), { userProfile: u } = en(), l = C.useMemo(
|
|
8930
8930
|
() => a.filter(Aa(o, s)),
|
|
8931
8931
|
[s, o, a]
|
|
@@ -9132,7 +9132,7 @@ const fu = ({ activity: A }) => /* @__PURE__ */ d(rA, { children: [
|
|
|
9132
9132
|
), F = !!n.length, aA = async () => {
|
|
9133
9133
|
O(2), c(
|
|
9134
9134
|
// Beginning of the month, 90 days before today
|
|
9135
|
-
|
|
9135
|
+
pA(pe(J(), 90)),
|
|
9136
9136
|
J()
|
|
9137
9137
|
), l({ ...u, custom: vt }), O(3);
|
|
9138
9138
|
}, iA = async () => {
|
|
@@ -9151,7 +9151,7 @@ const fu = ({ activity: A }) => /* @__PURE__ */ d(rA, { children: [
|
|
|
9151
9151
|
}
|
|
9152
9152
|
i();
|
|
9153
9153
|
}
|
|
9154
|
-
},
|
|
9154
|
+
}, vA = !X && m || !X && N.length < 1;
|
|
9155
9155
|
return /* @__PURE__ */ d(
|
|
9156
9156
|
T,
|
|
9157
9157
|
{
|
|
@@ -9213,7 +9213,7 @@ const fu = ({ activity: A }) => /* @__PURE__ */ d(rA, { children: [
|
|
|
9213
9213
|
)
|
|
9214
9214
|
] })
|
|
9215
9215
|
] }),
|
|
9216
|
-
|
|
9216
|
+
vA && /* @__PURE__ */ t(
|
|
9217
9217
|
hi,
|
|
9218
9218
|
{
|
|
9219
9219
|
bgcolor: "background.paper",
|
|
@@ -9396,7 +9396,7 @@ let zu = class {
|
|
|
9396
9396
|
// if there is no income activity
|
|
9397
9397
|
get expensesTilNextIncome() {
|
|
9398
9398
|
return this.upcomingExpenses.filter(
|
|
9399
|
-
(e) =>
|
|
9399
|
+
(e) => mA(e.expectedDate, this.nextIncome?.expectedDate || DA(/* @__PURE__ */ new Date()))
|
|
9400
9400
|
);
|
|
9401
9401
|
}
|
|
9402
9402
|
setNextIncome = (e) => {
|
|
@@ -9441,7 +9441,7 @@ class qu {
|
|
|
9441
9441
|
selectedAccountGuids = this.selectedAccounts.map((e) => e.guid);
|
|
9442
9442
|
displayedDate = /* @__PURE__ */ new Date();
|
|
9443
9443
|
displayedDateRange = {
|
|
9444
|
-
start:
|
|
9444
|
+
start: pA(this.displayedDate),
|
|
9445
9445
|
end: DA(this.displayedDate)
|
|
9446
9446
|
};
|
|
9447
9447
|
constructor(e) {
|
|
@@ -9571,7 +9571,7 @@ const yi = 13, Qu = (A, e) => A.filter((n) => {
|
|
|
9571
9571
|
}), Fu = (A, e) => [...A, ...e], ju = (A) => {
|
|
9572
9572
|
if (A && A.length > 0)
|
|
9573
9573
|
return A[A.length - 1];
|
|
9574
|
-
}, Uu = (A, e) => A.year_month - e.year_month, Wu = () => Array.from({ length: yi }, (A, e) => Math.floor(
|
|
9574
|
+
}, Uu = (A, e) => A.year_month - e.year_month, Wu = () => Array.from({ length: yi }, (A, e) => Math.floor(pA(ue(/* @__PURE__ */ new Date(), e)).getTime() / 1e3)).sort(), Yu = (A, e, n) => !A.length || !e.length ? [] : Wu().reduceRight((a, i) => {
|
|
9575
9575
|
const o = e.filter(
|
|
9576
9576
|
({ year_month: l }) => l === parseInt(kA(TA(i), "yyyyMM"))
|
|
9577
9577
|
), s = A.map((l) => {
|
|
@@ -10682,9 +10682,9 @@ const mn = ({
|
|
|
10682
10682
|
] });
|
|
10683
10683
|
}, N1 = b(P1), ln = (A) => A.top_level_category_guid === v.INCOME || A.category_guid === v.INCOME, M1 = (A) => !ln(A) && !Si(A), Li = (A) => Lr.includes(A.top_level_category_guid) || Lr.includes(A.category_guid), Si = (A) => A.top_level_category_guid === v.TRANSFER || A.category_guid === v.TRANSFER, R1 = (A) => !ln(A) && !Li(A) && !Si(A), H1 = (A) => A.filter((e) => e.category_guid === e.top_level_category_guid), sr = (A, e) => {
|
|
10684
10684
|
const n = [];
|
|
10685
|
-
let r =
|
|
10685
|
+
let r = pA(ue(/* @__PURE__ */ new Date(), 5));
|
|
10686
10686
|
const a = /* @__PURE__ */ new Date();
|
|
10687
|
-
for (;
|
|
10687
|
+
for (; mA(r, a); )
|
|
10688
10688
|
n.push({
|
|
10689
10689
|
x: $(r, Y.MONTH_SHORT),
|
|
10690
10690
|
y: A.filter((i) => i.year === r.getFullYear() && i.month === r.getMonth() + 1).reduce((i, o) => i + o.total, 0)
|
|
@@ -12039,7 +12039,7 @@ const aa = 5, ih = 100, ia = 25, oh = (A) => {
|
|
|
12039
12039
|
O(B), I({
|
|
12040
12040
|
accounts: s,
|
|
12041
12041
|
dateRange: {
|
|
12042
|
-
start:
|
|
12042
|
+
start: pA(/* @__PURE__ */ new Date()),
|
|
12043
12043
|
end: Me()
|
|
12044
12044
|
},
|
|
12045
12045
|
custom: (k) => k.category_guid === B.category_guid || k.top_level_category_guid === B.category_guid
|
|
@@ -14844,22 +14844,22 @@ const St = C.createContext(null), ag = ({
|
|
|
14844
14844
|
onTouchStart: k,
|
|
14845
14845
|
ref: g,
|
|
14846
14846
|
children: [
|
|
14847
|
-
A.map((iA,
|
|
14847
|
+
A.map((iA, vA) => /* @__PURE__ */ t(
|
|
14848
14848
|
fg,
|
|
14849
14849
|
{
|
|
14850
14850
|
ariaLabel: _(
|
|
14851
14851
|
L.card_position_in_carousel_aria,
|
|
14852
|
-
|
|
14852
|
+
vA + 1,
|
|
14853
14853
|
A.length + 1
|
|
14854
14854
|
),
|
|
14855
14855
|
beat: iA,
|
|
14856
|
-
index:
|
|
14857
|
-
isActiveCard:
|
|
14856
|
+
index: vA,
|
|
14857
|
+
isActiveCard: vA === F,
|
|
14858
14858
|
onCardClick: a,
|
|
14859
14859
|
posthog: i,
|
|
14860
14860
|
...X
|
|
14861
14861
|
},
|
|
14862
|
-
`${iA.guid} ${
|
|
14862
|
+
`${iA.guid} ${vA}`
|
|
14863
14863
|
)),
|
|
14864
14864
|
/* @__PURE__ */ t(
|
|
14865
14865
|
Og,
|
|
@@ -15519,7 +15519,7 @@ const St = C.createContext(null), ag = ({
|
|
|
15519
15519
|
C.useEffect(() => {
|
|
15520
15520
|
o(
|
|
15521
15521
|
n,
|
|
15522
|
-
|
|
15522
|
+
pA(/* @__PURE__ */ new Date()),
|
|
15523
15523
|
DA(/* @__PURE__ */ new Date())
|
|
15524
15524
|
).finally();
|
|
15525
15525
|
}, [n]);
|
|
@@ -15862,7 +15862,7 @@ const St = C.createContext(null), ag = ({
|
|
|
15862
15862
|
C.useEffect(() => {
|
|
15863
15863
|
o(n);
|
|
15864
15864
|
}, [n]), C.useEffect(() => {
|
|
15865
|
-
i(
|
|
15865
|
+
i(pA(J()), DA(J())), u(!0), s(j.SPENDING_VIEW);
|
|
15866
15866
|
}, []);
|
|
15867
15867
|
const l = (h) => {
|
|
15868
15868
|
i(h[0], h[1]);
|
|
@@ -15880,7 +15880,7 @@ const St = C.createContext(null), ag = ({
|
|
|
15880
15880
|
}
|
|
15881
15881
|
);
|
|
15882
15882
|
}, M7 = b(Qg), Fg = (A) => xe[A] ?? xe.default, jg = (A) => Ke[A], Ug = (A) => A.reduce((e, n) => {
|
|
15883
|
-
const r =
|
|
15883
|
+
const r = pA(new Date(n.year, n.month - 1)), a = {
|
|
15884
15884
|
top_level_category_guid: n.top_level_category_guid,
|
|
15885
15885
|
category_guid: n.category_guid,
|
|
15886
15886
|
amount: n.total,
|
|
@@ -16020,7 +16020,7 @@ const St = C.createContext(null), ag = ({
|
|
|
16020
16020
|
) });
|
|
16021
16021
|
}, A3 = ({ onBackClick: A, sx: e }) => {
|
|
16022
16022
|
const n = qA(), { onEvent: r } = Z(), { isDesktop: a, isTablet: i, isMobile: o } = KA(), { accounts: s } = PA(), { loadMonthlyCategoryTotals: c, monthlyCategoryTotals: u } = MA(), { isInitialized: l, selectedAccounts: h, setSelectedAccounts: g } = yA(), { trends: m } = D(), f = n.palette.mode === "dark", [y, p] = C.useState(!1), [S, I] = C.useState("Chart"), [L, P] = C.useState(""), [x, O] = C.useState({
|
|
16023
|
-
start:
|
|
16023
|
+
start: pA(ue(/* @__PURE__ */ new Date(), 5)),
|
|
16024
16024
|
end: DA(/* @__PURE__ */ new Date())
|
|
16025
16025
|
}), [N, q] = C.useState(6);
|
|
16026
16026
|
C.useEffect(() => {
|
|
@@ -16031,7 +16031,7 @@ const St = C.createContext(null), ag = ({
|
|
|
16031
16031
|
x.start,
|
|
16032
16032
|
x.end
|
|
16033
16033
|
).finally(() => {
|
|
16034
|
-
h.length > 0
|
|
16034
|
+
p(h.length > 0);
|
|
16035
16035
|
});
|
|
16036
16036
|
}, [l, h, x]);
|
|
16037
16037
|
const B = C.useMemo(
|
|
@@ -16040,10 +16040,10 @@ const St = C.createContext(null), ag = ({
|
|
|
16040
16040
|
), k = C.useMemo(() => {
|
|
16041
16041
|
const R = L.length ? B.filter(
|
|
16042
16042
|
(ZA) => ZA.top_level_category_guid === L || ZA.category_guid === L
|
|
16043
|
-
) : H1(B), AA = R.filter(M1),
|
|
16043
|
+
) : H1(B), AA = R.filter(M1), EA = R.filter(ln);
|
|
16044
16044
|
return {
|
|
16045
16045
|
stackedDatasets: AA,
|
|
16046
|
-
unstackedDatasets:
|
|
16046
|
+
unstackedDatasets: EA
|
|
16047
16047
|
};
|
|
16048
16048
|
}, [B, L]), X = C.useMemo(() => {
|
|
16049
16049
|
const R = Ea(
|
|
@@ -16069,11 +16069,11 @@ const St = C.createContext(null), ag = ({
|
|
|
16069
16069
|
}, [x, o]), aA = (R, AA) => {
|
|
16070
16070
|
I(AA ?? S), r(j.TRENDS_CLICK_TOGGLE);
|
|
16071
16071
|
}, iA = (R) => {
|
|
16072
|
-
const AA = R?.[0],
|
|
16073
|
-
|
|
16072
|
+
const AA = R?.[0], EA = R?.[1], ZA = vs(EA, AA);
|
|
16073
|
+
O({ start: AA, end: EA }), r(j.TRENDS_CLICK_DATE, {
|
|
16074
16074
|
time_period: ZA + "M"
|
|
16075
16075
|
}), q(ZA);
|
|
16076
|
-
},
|
|
16076
|
+
}, vA = () => {
|
|
16077
16077
|
r(j.TRENDS_CLICK_FILTER);
|
|
16078
16078
|
}, uA = (R) => {
|
|
16079
16079
|
P(R);
|
|
@@ -16093,7 +16093,7 @@ const St = C.createContext(null), ag = ({
|
|
|
16093
16093
|
calendarActions: { onRangeChanged: iA },
|
|
16094
16094
|
dateRange: x,
|
|
16095
16095
|
dateRangeVariant: "timeframebuttons",
|
|
16096
|
-
onAccountsFilterClick:
|
|
16096
|
+
onAccountsFilterClick: vA,
|
|
16097
16097
|
onBackClick: A,
|
|
16098
16098
|
sx: e,
|
|
16099
16099
|
title: m.title,
|
|
@@ -16205,9 +16205,9 @@ const St = C.createContext(null), ag = ({
|
|
|
16205
16205
|
const e = [], n = A.filter(
|
|
16206
16206
|
(i) => i.top_level_category_guid !== v.INCOME && i.top_level_category_guid !== v.TRANSFER && i.total > 0
|
|
16207
16207
|
);
|
|
16208
|
-
let r =
|
|
16208
|
+
let r = pA(ue(/* @__PURE__ */ new Date(), 5));
|
|
16209
16209
|
const a = DA(/* @__PURE__ */ new Date());
|
|
16210
|
-
for (;
|
|
16210
|
+
for (; mA(r, a); )
|
|
16211
16211
|
e.push({
|
|
16212
16212
|
x: $(r, Y.MONTH_SHORT),
|
|
16213
16213
|
y: n.filter((i) => i.year === r.getFullYear() && i.month === r.getMonth() + 1).reduce((i, o) => i + o.total, 0)
|