@mx-cartographer/experiences 9.0.0-ram1-bug-alpha-testing → 9.0.0-ram2-bug-alpha-testing

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.
@@ -0,0 +1,55 @@
1
+ import { addMonths as _ } from "date-fns/addMonths";
2
+ import { isBefore as u } from "date-fns/isBefore";
3
+ import { startOfMonth as d } from "date-fns/startOfMonth";
4
+ import { subMonths as y } from "date-fns/subMonths";
5
+ import { endOfMonth as M } from "date-fns/endOfMonth";
6
+ import { C as n, P as i } from "./Category-DEKZGLYe.mjs";
7
+ import { f as T, D as m } from "./DateFormats-HudZ3Bjs.mjs";
8
+ const g = (e) => (e.top_level_category_guid === n.INCOME || e.category_guid === n.INCOME) && !f(e), O = (e) => !g(e) && !p(e), N = (e) => i.includes(e.top_level_category_guid) || i.includes(e.category_guid), p = (e) => e.top_level_category_guid === n.TRANSFER || e.category_guid === n.TRANSFER, f = (e) => e.top_level_category_guid === n.INVESTMENTS || e.category_guid === n.INVESTMENTS, C = (e) => e.filter((o) => o.category_guid === o.top_level_category_guid), F = (e, o) => {
9
+ if (o === 0) return 0;
10
+ const a = (e - o) / o;
11
+ return isNaN(a) ? 0 : a;
12
+ }, c = (e, o) => {
13
+ const a = [];
14
+ let t = d(o?.start ?? y(/* @__PURE__ */ new Date(), 5));
15
+ const s = o?.end ?? /* @__PURE__ */ new Date();
16
+ for (; u(t, s); )
17
+ a.push({
18
+ x: T(t, m.MONTH_SHORT),
19
+ y: e.filter((r) => r.year === t.getFullYear() && r.month === t.getMonth() + 1).reduce((r, l) => r + l.total, 0)
20
+ }), t = _(t, 1);
21
+ return a;
22
+ }, w = (e, o) => {
23
+ const a = e.filter(g);
24
+ return c(a, o).map((t) => ({ ...t, y: Math.abs(t.y) }));
25
+ }, A = (e, o) => {
26
+ const a = e.filter(N);
27
+ return c(a, o).map((t) => ({ ...t, y: Math.abs(t.y) }));
28
+ }, b = (e, o) => {
29
+ const a = e.filter(
30
+ (t) => !g(t) && !p(t) && !f(t) && t.top_level_category_guid !== n.INCOME && t.top_level_category_guid !== n.TRANSFER && t.top_level_category_guid !== n.INVESTMENTS
31
+ );
32
+ return c(a, o);
33
+ }, x = (e) => {
34
+ const o = [], a = e.filter(
35
+ (r) => r.top_level_category_guid !== n.INCOME && r.top_level_category_guid !== n.TRANSFER && r.total > 0
36
+ );
37
+ let t = d(y(/* @__PURE__ */ new Date(), 5));
38
+ const s = M(/* @__PURE__ */ new Date());
39
+ for (; u(t, s); )
40
+ o.push({
41
+ x: T(t, m.MONTH_SHORT),
42
+ y: a.filter((r) => r.year === t.getFullYear() && r.month === t.getMonth() + 1).reduce((r, l) => r + l.total, 0)
43
+ }), t = _(t, 1);
44
+ return o;
45
+ };
46
+ export {
47
+ A as a,
48
+ b,
49
+ C as c,
50
+ O as d,
51
+ x as e,
52
+ F as f,
53
+ w as g,
54
+ g as i
55
+ };
@@ -13,7 +13,7 @@ import { f as a1 } from "../NumberFormatting--XMeeBfr.mjs";
13
13
  import { useTheme as p1, alpha as x1 } from "@mui/material/styles";
14
14
  import { u as R, A as w1 } from "../AccountDetailsHeader-DIysk_4w.mjs";
15
15
  import { L as R1 } from "../LineChart-CejWS_rh.mjs";
16
- import { g as S1, a as T1, b as D1 } from "../SpendingData-xyRoRDHv.mjs";
16
+ import { g as S1, a as T1, b as D1 } from "../SpendingData-BD3WTtu2.mjs";
17
17
  import { l as E1, u as A, d as E, g as k, h as _1, a as L1, b as G } from "../hooks-BaO_gOI6.mjs";
18
18
  import { A as I, g as f, N as f1 } from "../Account-BaJmiJAG.mjs";
19
19
  import { I as g1, P as H1, S as v1 } from "../Account-BxHMlV9R.mjs";
@@ -24,7 +24,7 @@ import { a as Re, C as $e, b as Nt } from "../Category-DEKZGLYe.mjs";
24
24
  import { f as X, D as G } from "../DateFormats-HudZ3Bjs.mjs";
25
25
  import { f as re, a as Wt } from "../NumberFormatting--XMeeBfr.mjs";
26
26
  import { a as Ke, c as Ot, g as Gt } from "../TrendsUtil-D9z3kIj_.mjs";
27
- import { c as Bt, i as Pt, d as Vt, e as zt, g as at, b as it, f as Ye } from "../SpendingData-xyRoRDHv.mjs";
27
+ import { c as Bt, i as Pt, d as Vt, e as zt, g as at, b as it, f as Ye } from "../SpendingData-BD3WTtu2.mjs";
28
28
  import Ft from "@mui/material/ToggleButton";
29
29
  import $t from "@mui/material/ToggleButtonGroup";
30
30
  import { parseISO as lt } from "date-fns/parseISO";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "9.0.0-ram1-bug-alpha-testing",
3
+ "version": "9.0.0-ram2-bug-alpha-testing",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",
@@ -1,53 +0,0 @@
1
- import { addMonths as u } from "date-fns/addMonths";
2
- import { isBefore as d } from "date-fns/isBefore";
3
- import { startOfMonth as _ } from "date-fns/startOfMonth";
4
- import { subMonths as y } from "date-fns/subMonths";
5
- import { endOfMonth as M } from "date-fns/endOfMonth";
6
- import { C as a, P as l } from "./Category-DEKZGLYe.mjs";
7
- import { f as m, D as T } from "./DateFormats-HudZ3Bjs.mjs";
8
- const i = (e) => (e.top_level_category_guid === a.INCOME || e.category_guid === a.INCOME) && !h(e), C = (e) => !i(e) && !f(e), p = (e) => l.includes(e.top_level_category_guid) || l.includes(e.category_guid), f = (e) => e.top_level_category_guid === a.TRANSFER || e.category_guid === a.TRANSFER, h = (e) => e.top_level_category_guid === a.INVESTMENTS || e.category_guid === a.INVESTMENTS, N = (e) => !i(e) && !p(e) && !f(e) && !h(e), w = (e) => e.filter((r) => r.category_guid === r.top_level_category_guid), F = (e, r) => {
9
- if (r === 0) return 0;
10
- const o = (e - r) / r;
11
- return isNaN(o) ? 0 : o;
12
- }, g = (e, r) => {
13
- const o = [];
14
- let t = _(r?.start ?? y(/* @__PURE__ */ new Date(), 5));
15
- const s = r?.end ?? /* @__PURE__ */ new Date();
16
- for (; d(t, s); )
17
- o.push({
18
- x: m(t, T.MONTH_SHORT),
19
- y: e.filter((n) => n.year === t.getFullYear() && n.month === t.getMonth() + 1).reduce((n, c) => n + c.total, 0)
20
- }), t = u(t, 1);
21
- return o;
22
- }, A = (e, r) => {
23
- const o = e.filter(i);
24
- return g(o, r).map((t) => ({ ...t, y: Math.abs(t.y) }));
25
- }, b = (e, r) => {
26
- const o = e.filter(p);
27
- return g(o, r).map((t) => ({ ...t, y: Math.abs(t.y) }));
28
- }, x = (e, r) => {
29
- const o = e.filter((t) => N(t) && t.total > 0);
30
- return g(o, r);
31
- }, H = (e) => {
32
- const r = [], o = e.filter(
33
- (n) => n.top_level_category_guid !== a.INCOME && n.top_level_category_guid !== a.TRANSFER && n.total > 0
34
- );
35
- let t = _(y(/* @__PURE__ */ new Date(), 5));
36
- const s = M(/* @__PURE__ */ new Date());
37
- for (; d(t, s); )
38
- r.push({
39
- x: m(t, T.MONTH_SHORT),
40
- y: o.filter((n) => n.year === t.getFullYear() && n.month === t.getMonth() + 1).reduce((n, c) => n + c.total, 0)
41
- }), t = u(t, 1);
42
- return r;
43
- };
44
- export {
45
- b as a,
46
- x as b,
47
- w as c,
48
- C as d,
49
- H as e,
50
- F as f,
51
- A as g,
52
- i
53
- };