@mx-cartographer/experiences 6.26.33-alpha.mm0 → 7.0.0-alpha.mega1
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/CHANGELOG.md +2 -3
- package/dist/Account-DY6nxO7y.mjs +30 -0
- package/dist/AccountDetailsContent-DvPs81kL.mjs +677 -0
- package/dist/AccountDetailsHeader-W2U7ZVm_.mjs +119 -0
- package/dist/AccountFields-DAVcbZy5.mjs +135 -0
- package/dist/AccountListItem-DFlbdcmT.mjs +90 -0
- package/dist/AccountStore-CU7qV3vg.mjs +230 -0
- package/dist/Accounts-BLlrQA5m.mjs +9 -0
- package/dist/BeatApi-DLu87ijw.mjs +21 -0
- package/dist/BeatStore-By4aGoRM.mjs +81 -0
- package/dist/BudgetUtil-Ci1TN0J5.mjs +101 -0
- package/dist/CashflowStore-D9Dpuz7X.mjs +91 -0
- package/dist/Category-5S6uwuXz.mjs +301 -0
- package/dist/CategorySelectorDrawer-rHyHHYuh.mjs +397 -0
- package/dist/CategoryStore-B5EW6I1d.mjs +183 -0
- package/dist/CategoryUtil-DRyruNgi.mjs +78 -0
- package/dist/ConnectDrawer-D9cR5phc.mjs +508 -0
- package/dist/ConnectionsDrawer-BzGqljSp.mjs +52 -0
- package/dist/CurrencyInput-D74cemI2.mjs +83 -0
- package/dist/CurrencyText-YUhH2caW.mjs +20 -0
- package/dist/DateUtil-BcuH7ErC.mjs +48 -0
- package/dist/DebtsStore-S0l9kr0r.mjs +60 -0
- package/dist/Dialog-CWW597AF.mjs +123 -0
- package/dist/Donut-1UMNcG67.mjs +57 -0
- package/dist/Drawer-kEE73B87.mjs +113 -0
- package/dist/EmptyState-Dcb-o2tl.mjs +55 -0
- package/dist/Fetch-CkFKy79O.mjs +116 -0
- package/dist/FinstrongStore-mkALvztw.mjs +101 -0
- package/dist/GoalStore-DioeeL-s.mjs +263 -0
- package/dist/HeaderCell-DjuifqHJ.mjs +6 -0
- package/dist/Help-DhcC-C05.mjs +320 -0
- package/dist/Help-DpYRO8oA.mjs +3181 -0
- package/dist/IconBacking-B9oC6uL2.mjs +39 -0
- package/dist/InvestmentUtil-jOyOgzIB.mjs +134 -0
- package/dist/LineChart-CcyX38kK.mjs +499 -0
- package/dist/ListItemAction-BabpYivr.mjs +69 -0
- package/dist/Loader-Dp1P2gNw.mjs +14 -0
- package/dist/Localization-2MODESHW.mjs +30 -0
- package/dist/ManageIncome-ndMuhJMG.mjs +535 -0
- package/dist/MerchantStore-DVH-QOf0.mjs +37 -0
- package/dist/MicroWidgetContainer-CsvHLYKX.mjs +45 -0
- package/dist/MiniWidgetContainer-BoOp-A05.mjs +39 -0
- package/dist/NetWorthStore-PD-RUe09.mjs +150 -0
- package/dist/Notification-AMGWM1Al.mjs +78 -0
- package/dist/NotificationSettings-VhHuMAFU.mjs +667 -0
- package/dist/NotificationStore-DHtSGySy.mjs +67 -0
- package/dist/NumberFormatting-CtWHhyBX.mjs +40 -0
- package/dist/OriginalBalanceAction-D39mx6uE.mjs +115 -0
- package/dist/RecurringSettings-D_HnMYZP.mjs +57 -0
- package/dist/RecurringTransactionsStore-BKLD3OWo.mjs +263 -0
- package/dist/RepeatingTransaction-BPWfaB3f.mjs +282 -0
- package/dist/SearchBox-B2_zLv8-.mjs +42 -0
- package/dist/SettingsStore-CE7jDVFL.mjs +265 -0
- package/dist/SingleSegmentDonut-BgbLgwHi.mjs +69 -0
- package/dist/SpendingData-BkrxzHdr.mjs +55 -0
- package/dist/StatusBar-BK_uYHAB.mjs +30 -0
- package/dist/TabContentContainer-j01JYR_7.mjs +21 -0
- package/dist/Transaction-CA0FW2Ij.mjs +312 -0
- package/dist/TransactionApi-DbbcjI2L.mjs +86 -0
- package/dist/TransactionDetails-WBHFmbxL.mjs +1283 -0
- package/dist/TransactionStore-CeLdmVnC.mjs +669 -0
- package/dist/TrendsStore-BHJUapXF.mjs +487 -0
- package/dist/ViewMoreMicroCard-CAPFNz-J.mjs +1959 -0
- package/dist/WidgetContainer-DWCusxYI.mjs +556 -0
- package/dist/accounts/index.es.js +752 -0
- package/dist/analytics/index.es.js +171 -0
- package/dist/budgets/index.es.js +1075 -0
- package/dist/cashflow/index.es.js +1098 -0
- package/dist/categories/index.es.js +9 -0
- package/dist/common/components/WidgetContainer.d.ts +1 -1
- package/dist/common/components/charts/LineChart.d.ts +0 -1
- package/dist/common/constants/Analytics.d.ts +10 -20
- package/dist/common/context/hooks.d.ts +13 -13
- package/dist/common/index.es.js +1451 -0
- package/dist/dashboard/index.es.js +181 -0
- package/dist/debts/index.es.js +1460 -0
- package/dist/exportTransactionsToCSV-CmwsKl2D.mjs +47 -0
- package/dist/finstrong/index.es.js +1455 -0
- package/dist/goals/index.es.js +1209 -0
- package/dist/help/components/content/section/index.d.ts +15 -15
- package/dist/help/index.es.js +14 -0
- package/dist/hooks-30y_BLwc.mjs +71 -0
- package/dist/index.d.ts +0 -22
- package/dist/insights/index.d.ts +1 -0
- package/dist/insights/index.es.js +4 -0
- package/dist/investments/index.es.js +1638 -0
- package/dist/merchants/index.es.js +79 -0
- package/dist/microinsights/components/carouselheader/CarouselHeader.d.ts +0 -1
- package/dist/microinsights/components/microBeatCarousel/MicroBeatCarousel.d.ts +0 -1
- package/dist/microinsights/index.es.js +16 -0
- package/dist/networth/index.es.js +576 -0
- package/dist/notifications/index.es.js +192 -0
- package/dist/recurringtransactions/index.es.js +879 -0
- package/dist/settings/index.es.js +879 -0
- package/dist/spending/index.es.js +570 -0
- package/dist/transactions/index.es.js +587 -0
- package/dist/trends/index.es.js +1086 -0
- package/dist/useCombineEvents-DaDBSR_1.mjs +92 -0
- package/dist/useDimensions-27p2evRx.mjs +36 -0
- package/dist/useScreenSize-B6JyS_Lj.mjs +36 -0
- package/package.json +155 -3
- package/dist/index.es.js +0 -30564
- package/dist/index.es.js.map +0 -1
- package/dist/trends/constants/TrendsWidget.d.ts +0 -3
@@ -0,0 +1,39 @@
|
|
1
|
+
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
2
|
+
import d from "@mui/material/Box";
|
3
|
+
import m from "@mui/material/Stack";
|
4
|
+
const s = ({
|
5
|
+
backingSx: r,
|
6
|
+
children: i,
|
7
|
+
size: o,
|
8
|
+
sx: c
|
9
|
+
}) => /* @__PURE__ */ n(
|
10
|
+
m,
|
11
|
+
{
|
12
|
+
sx: {
|
13
|
+
display: "grid",
|
14
|
+
placeItems: "center",
|
15
|
+
zIndex: 3,
|
16
|
+
...c
|
17
|
+
},
|
18
|
+
children: [
|
19
|
+
i,
|
20
|
+
/* @__PURE__ */ t(
|
21
|
+
d,
|
22
|
+
{
|
23
|
+
sx: {
|
24
|
+
backgroundColor: "common.white",
|
25
|
+
borderRadius: "50%",
|
26
|
+
height: o,
|
27
|
+
width: o,
|
28
|
+
gridRow: 1,
|
29
|
+
gridColumn: 1,
|
30
|
+
...r
|
31
|
+
}
|
32
|
+
}
|
33
|
+
)
|
34
|
+
]
|
35
|
+
}
|
36
|
+
), x = s;
|
37
|
+
export {
|
38
|
+
x as I
|
39
|
+
};
|
@@ -0,0 +1,134 @@
|
|
1
|
+
import d from "numeral";
|
2
|
+
var m = /* @__PURE__ */ ((t) => (t.Stocks = "stocks", t.Bonds = "bonds", t))(m || {});
|
3
|
+
const V = {
|
4
|
+
UNKNOWN: 0,
|
5
|
+
LARGE_VALUE: 1,
|
6
|
+
LARGE_CORE: 2,
|
7
|
+
LARGE_GROWTH: 3,
|
8
|
+
MID_VALUE: 4,
|
9
|
+
MID_CORE: 5,
|
10
|
+
MID_GROWTH: 6,
|
11
|
+
SMALL_VALUE: 7,
|
12
|
+
SMALL_CORE: 8,
|
13
|
+
SMALL_GROWTH: 9
|
14
|
+
}, L = {
|
15
|
+
0: "UNKNOWN",
|
16
|
+
1: "LARGE_VALUE",
|
17
|
+
2: "LARGE_CORE",
|
18
|
+
3: "LARGE_GROWTH",
|
19
|
+
4: "MID_VALUE",
|
20
|
+
5: "MID_CORE",
|
21
|
+
6: "MID_GROWTH",
|
22
|
+
7: "SMALL_VALUE",
|
23
|
+
8: "SMALL_CORE",
|
24
|
+
9: "SMALL_GROWTH"
|
25
|
+
}, N = {
|
26
|
+
UNKNOWN: 0,
|
27
|
+
HIGH_LIMITED: 1,
|
28
|
+
HIGH_MODERATE: 2,
|
29
|
+
HIGH_EXTENSIVE: 3,
|
30
|
+
MEDIUM_LIMITED: 4,
|
31
|
+
MEDIUM_MODERATE: 5,
|
32
|
+
MEDIUM_EXTENSIVE: 6,
|
33
|
+
LOW_LIMITED: 7,
|
34
|
+
LOW_MODERATE: 8,
|
35
|
+
LOW_EXTENSIVE: 9
|
36
|
+
}, O = {
|
37
|
+
0: "UNKNOWN",
|
38
|
+
1: "HIGH_LIMITED",
|
39
|
+
2: "HIGH_MODERATE",
|
40
|
+
3: "HIGH_EXTENSIVE",
|
41
|
+
4: "MEDIUM_LIMITED",
|
42
|
+
5: "MEDIUM_MODERATE",
|
43
|
+
6: "MEDIUM_EXTENSIVE",
|
44
|
+
7: "LOW_LIMITED",
|
45
|
+
8: "LOW_MODERATE",
|
46
|
+
9: "LOW_EXTENSIVE"
|
47
|
+
}, A = (t, s = 3) => {
|
48
|
+
const a = Object.keys(t).map(Number).filter((e) => e !== 0).sort((e, c) => e - c), o = [];
|
49
|
+
for (let e = 0; e < a.length; e += s)
|
50
|
+
o.push(a.slice(e, e + s).map((c) => t[c]));
|
51
|
+
return o;
|
52
|
+
}, W = A(O), h = A(L), w = (t) => {
|
53
|
+
const s = M(t, g), a = M(t, f), o = (c, i) => {
|
54
|
+
const _ = c.reduce((n, r) => n + T(r), 0), u = c.reduce((n, r) => {
|
55
|
+
const l = i(r);
|
56
|
+
return Object.keys(l).forEach((E) => n[E] = (n[E] || 0) + l[E]), n;
|
57
|
+
}, {});
|
58
|
+
return Object.fromEntries(
|
59
|
+
Object.entries(u).map(([n, r]) => [n, r / _ * 100])
|
60
|
+
);
|
61
|
+
};
|
62
|
+
return {
|
63
|
+
stocks: o(s, D),
|
64
|
+
bonds: o(a, R)
|
65
|
+
};
|
66
|
+
}, S = (t) => {
|
67
|
+
const s = t.filter((e) => !isNaN(e.equity_classification)), a = t.filter((e) => !isNaN(e.fixed_income_classification)), o = (e, c, i) => e.reduce((_, u) => {
|
68
|
+
const n = c(u);
|
69
|
+
return Object.keys(i).forEach((r) => {
|
70
|
+
_[r] = (_[r] || 0) + (n[r] || 0);
|
71
|
+
}), _;
|
72
|
+
}, {});
|
73
|
+
return {
|
74
|
+
stocks: o(s, D, V),
|
75
|
+
bonds: o(a, R, N)
|
76
|
+
};
|
77
|
+
}, H = (t, s) => Object.fromEntries(
|
78
|
+
Object.entries(t).map(([a, o]) => [a, o * s / 100])
|
79
|
+
), R = (t) => G(t, f, O), f = (t) => {
|
80
|
+
const s = t.fixed_income_classification;
|
81
|
+
return {
|
82
|
+
[O[s]]: 100
|
83
|
+
};
|
84
|
+
}, D = (t) => G(t, g, L), g = (t) => {
|
85
|
+
const {
|
86
|
+
large_core_weight: s,
|
87
|
+
large_growth_weight: a,
|
88
|
+
large_value_weight: o,
|
89
|
+
mid_core_weight: e,
|
90
|
+
mid_growth_weight: c,
|
91
|
+
mid_value_weight: i,
|
92
|
+
small_core_weight: _,
|
93
|
+
small_growth_weight: u,
|
94
|
+
small_value_weight: n,
|
95
|
+
unknown_weight: r,
|
96
|
+
equity_classification: l
|
97
|
+
} = t, E = {
|
98
|
+
LARGE_CORE: s ?? 0,
|
99
|
+
LARGE_GROWTH: a ?? 0,
|
100
|
+
LARGE_VALUE: o ?? 0,
|
101
|
+
MID_CORE: e ?? 0,
|
102
|
+
MID_GROWTH: c ?? 0,
|
103
|
+
MID_VALUE: i ?? 0,
|
104
|
+
SMALL_CORE: _ ?? 0,
|
105
|
+
SMALL_GROWTH: u ?? 0,
|
106
|
+
SMALL_VALUE: n ?? 0,
|
107
|
+
UNKNOWN: r ?? 0
|
108
|
+
};
|
109
|
+
return I(E) === 0 && l !== void 0 ? { [L[l]]: 100 } : E;
|
110
|
+
}, G = (t, s, a) => {
|
111
|
+
const o = s(t), e = T(t), c = H(o, e);
|
112
|
+
if (I(c) === 0) {
|
113
|
+
const i = String(
|
114
|
+
t.equity_classification ?? t.fixed_income_classification
|
115
|
+
);
|
116
|
+
if (!(i in a))
|
117
|
+
throw new Error(`Invalid classification key: ${i}`);
|
118
|
+
return { [a[i]]: e };
|
119
|
+
}
|
120
|
+
return c;
|
121
|
+
}, b = (t) => t.split("_").map((s) => s.charAt(0).toUpperCase() + s.slice(1).toLowerCase()).join(" "), p = (t) => t >= 1 ? `${d(t).format("0")}%` : "< 1%", T = (t) => t.calculated_market_value ?? t.market_value, M = (t, s) => t.filter((a) => {
|
122
|
+
const o = s(a), e = I(o);
|
123
|
+
return e > 80 && e < 120;
|
124
|
+
}), C = (t, s) => {
|
125
|
+
const a = s === m.Stocks ? h : W, o = t[s];
|
126
|
+
return !o || !o || Object.keys(o).length === 0 ? a.map((e) => e.map(() => "0%")) : a.map((e) => e.map((c) => p(o[c] ?? 0)));
|
127
|
+
}, I = (t) => Object.values(t).reduce((s, a) => s + a, 0);
|
128
|
+
export {
|
129
|
+
m as A,
|
130
|
+
w as a,
|
131
|
+
S as b,
|
132
|
+
b as f,
|
133
|
+
C as m
|
134
|
+
};
|
@@ -0,0 +1,499 @@
|
|
1
|
+
import { jsxs as i, Fragment as v, jsx as t } from "react/jsx-runtime";
|
2
|
+
import { useTheme as N } from "@mui/material/styles";
|
3
|
+
import { ResponsiveChartContainer as J, ChartsReferenceLine as K, AreaPlot as Z, LinePlot as _, MarkPlot as ee, BarPlot as te, ChartsXAxis as ne, ChartsYAxis as re, ChartsAxisHighlight as ae } from "@mui/x-charts";
|
4
|
+
import ie from "@mui/material/useMediaQuery";
|
5
|
+
import { f as y } from "./NumberFormatting-CtWHhyBX.mjs";
|
6
|
+
import { observer as oe } from "mobx-react-lite";
|
7
|
+
import { Stack as x, Box as I, useTheme as le } from "@mui/material";
|
8
|
+
import { Text as l } from "@mxenabled/mxui";
|
9
|
+
import { u as se } from "./hooks-30y_BLwc.mjs";
|
10
|
+
import { ChartsTooltip as ce } from "@mui/x-charts/ChartsTooltip";
|
11
|
+
const de = (e) => {
|
12
|
+
const a = N(), o = e.showLabel, s = e.style, g = Number(e.x), u = Number(e.y), m = e.handlers?.onMarkClick, f = e.handlers?.onMouseEnter, c = e.handlers?.onMouseLeave, d = ie(a.breakpoints.up("sm")), n = e.valueFormatterString ? y(e.yData[e.dataIndex], e.valueFormatterString) : String(e.yData[e.dataIndex]), h = d ? a.typography.Small?.fontSize : a.typography.XSmall?.fontSize, k = h ? parseFloat(h.toString()) * 0.6 : 8, C = n.length * k + 8 + 8, M = 24, D = g - C / 2, w = u - 30;
|
13
|
+
return /* @__PURE__ */ i(v, { children: [
|
14
|
+
o && /* @__PURE__ */ i(v, { children: [
|
15
|
+
e.labelBackgroundColor && /* @__PURE__ */ t(
|
16
|
+
"rect",
|
17
|
+
{
|
18
|
+
fill: e.labelBackgroundColor,
|
19
|
+
height: M,
|
20
|
+
rx: "3",
|
21
|
+
width: C,
|
22
|
+
x: D,
|
23
|
+
y: w
|
24
|
+
}
|
25
|
+
),
|
26
|
+
/* @__PURE__ */ t(
|
27
|
+
"text",
|
28
|
+
{
|
29
|
+
dominantBaseline: "middle",
|
30
|
+
fill: e.labelFontColor ? e.labelFontColor : a.palette.text.primary,
|
31
|
+
style: {
|
32
|
+
fontSize: e.labelFontSize ? e.labelFontSize : h
|
33
|
+
},
|
34
|
+
textAnchor: "middle",
|
35
|
+
x: g,
|
36
|
+
y: u - 28 + M / 2,
|
37
|
+
children: n
|
38
|
+
}
|
39
|
+
)
|
40
|
+
] }),
|
41
|
+
/* @__PURE__ */ t(
|
42
|
+
"path",
|
43
|
+
{
|
44
|
+
cursor: m ? "pointer" : "unset",
|
45
|
+
d: "M4.514,0A4.514,4.514,0,1,1,-4.514,0A4.514,4.514,0,1,1,4.514,0",
|
46
|
+
height: "20px",
|
47
|
+
onClick: (T) => {
|
48
|
+
m?.(T, e.dataIndex);
|
49
|
+
},
|
50
|
+
onMouseEnter: () => {
|
51
|
+
f?.(e.dataIndex);
|
52
|
+
},
|
53
|
+
onMouseLeave: () => {
|
54
|
+
c?.();
|
55
|
+
},
|
56
|
+
style: {
|
57
|
+
fill: s?.fill ? s.fill : a.palette.background.paper,
|
58
|
+
stroke: s?.stroke ? s.stroke : a.palette.primary.main,
|
59
|
+
strokeWidth: 2,
|
60
|
+
transform: `translate(${e.x}px, ${e.y}px)`,
|
61
|
+
transformOrigin: `${e.x}px, ${e.y}px`,
|
62
|
+
filter: s?.filter ? s.filter : "none"
|
63
|
+
},
|
64
|
+
width: "20px"
|
65
|
+
}
|
66
|
+
)
|
67
|
+
] });
|
68
|
+
}, he = (e) => /* @__PURE__ */ i(v, { children: [
|
69
|
+
/* @__PURE__ */ t("clipPath", { id: e.id, children: /* @__PURE__ */ t("rect", { height: e.height, width: e.width, x: "0", y: "0" }) }),
|
70
|
+
/* @__PURE__ */ t("g", { children: /* @__PURE__ */ t(
|
71
|
+
"path",
|
72
|
+
{
|
73
|
+
cursor: "unset",
|
74
|
+
d: e.d,
|
75
|
+
style: {
|
76
|
+
strokeWidth: 2,
|
77
|
+
strokeLinejoin: "round",
|
78
|
+
fill: "none",
|
79
|
+
stroke: e.lineColor ? e.lineColor : e.stroke,
|
80
|
+
transition: "opacity 0.2s ease-in, stroke 0.2s ease-in",
|
81
|
+
opacity: 1
|
82
|
+
}
|
83
|
+
}
|
84
|
+
) })
|
85
|
+
] }), me = ({
|
86
|
+
label: e,
|
87
|
+
customLegendVariant: a
|
88
|
+
}) => {
|
89
|
+
const o = a || "Small";
|
90
|
+
return typeof e == "string" ? /* @__PURE__ */ t(l, { variant: o, children: e }) : typeof e == "object" && e.amount && e.label ? /* @__PURE__ */ i(v, { children: [
|
91
|
+
/* @__PURE__ */ t(l, { variant: o, children: e.label }),
|
92
|
+
/* @__PURE__ */ t(l, { bold: !0, sx: { marginLeft: 8 }, variant: o, children: y(e.amount, "0,0") })
|
93
|
+
] }) : null;
|
94
|
+
}, ue = ({
|
95
|
+
average: e,
|
96
|
+
customLegendVariant: a,
|
97
|
+
labels: o = [],
|
98
|
+
series: s,
|
99
|
+
style: g,
|
100
|
+
title: u,
|
101
|
+
valueFormatterString: m
|
102
|
+
}) => {
|
103
|
+
const { common: f } = se(), c = a || "Small";
|
104
|
+
return /* @__PURE__ */ i(x, { style: { flexDirection: "row", gap: 24, ...g }, children: [
|
105
|
+
s.map((d, n) => {
|
106
|
+
const h = o[n];
|
107
|
+
return h ? /* @__PURE__ */ i(
|
108
|
+
x,
|
109
|
+
{
|
110
|
+
style: { alignItems: "center", flexDirection: "row", flexWrap: "wrap" },
|
111
|
+
children: [
|
112
|
+
/* @__PURE__ */ t(
|
113
|
+
I,
|
114
|
+
{
|
115
|
+
sx: {
|
116
|
+
width: 10,
|
117
|
+
height: 10,
|
118
|
+
backgroundColor: d.color,
|
119
|
+
marginRight: 8
|
120
|
+
}
|
121
|
+
}
|
122
|
+
),
|
123
|
+
/* @__PURE__ */ t(me, { customLegendVariant: a, label: h })
|
124
|
+
]
|
125
|
+
},
|
126
|
+
n
|
127
|
+
) : null;
|
128
|
+
}),
|
129
|
+
e && /* @__PURE__ */ i(x, { sx: { alignItems: "center", flexDirection: "row" }, children: [
|
130
|
+
/* @__PURE__ */ t(l, { bold: !0, sx: { marginRight: 8 }, variant: c, children: "– –" }),
|
131
|
+
/* @__PURE__ */ i(l, { variant: c, children: [
|
132
|
+
u || f.average,
|
133
|
+
" "
|
134
|
+
] }),
|
135
|
+
/* @__PURE__ */ t(l, { bold: !0, variant: c, children: m ? y(e, m) : e })
|
136
|
+
] })
|
137
|
+
] });
|
138
|
+
}, xe = oe(ue);
|
139
|
+
function fe({
|
140
|
+
customLabels: e,
|
141
|
+
labels: a = [],
|
142
|
+
valueFormatterString: o = "0,0"
|
143
|
+
}) {
|
144
|
+
const s = le();
|
145
|
+
return /* @__PURE__ */ t(
|
146
|
+
ce,
|
147
|
+
{
|
148
|
+
showCrosshair: !0,
|
149
|
+
slots: {
|
150
|
+
axisContent: (g) => {
|
151
|
+
const { axisValue: u, dataIndex: m, series: f } = g, c = m ?? 0;
|
152
|
+
if (e) {
|
153
|
+
const d = e[c]?.[0]?.header || String(u);
|
154
|
+
return /* @__PURE__ */ i(
|
155
|
+
x,
|
156
|
+
{
|
157
|
+
sx: {
|
158
|
+
backgroundColor: s.palette.background.paper,
|
159
|
+
boxShadow: "0 2px 8px 0 rgba(0, 0, 0, 0.12)",
|
160
|
+
flexDirection: "column",
|
161
|
+
alignItems: "flex-start",
|
162
|
+
borderRadius: "4px",
|
163
|
+
width: 250,
|
164
|
+
gap: 8,
|
165
|
+
px: 16,
|
166
|
+
py: 12
|
167
|
+
},
|
168
|
+
children: [
|
169
|
+
/* @__PURE__ */ i(
|
170
|
+
x,
|
171
|
+
{
|
172
|
+
sx: {
|
173
|
+
flexDirection: "row",
|
174
|
+
justifyContent: "space-between",
|
175
|
+
alignItems: "center",
|
176
|
+
alignSelf: "stretch",
|
177
|
+
gap: 8,
|
178
|
+
marginTop: 4
|
179
|
+
},
|
180
|
+
children: [
|
181
|
+
/* @__PURE__ */ t(l, { variant: "H3", children: d }),
|
182
|
+
/* @__PURE__ */ t(l, { bold: !0, variant: "H3", children: y(f[0]?.data[c], o) })
|
183
|
+
]
|
184
|
+
}
|
185
|
+
),
|
186
|
+
e[c]?.some((n) => (typeof n == "string" ? 0 : n.amount) !== 0) ? e[c]?.map((n) => {
|
187
|
+
const h = typeof n == "string" ? n : n.label, k = typeof n == "string" ? 0 : n.amount;
|
188
|
+
return k === 0 ? null : /* @__PURE__ */ i(
|
189
|
+
x,
|
190
|
+
{
|
191
|
+
sx: {
|
192
|
+
flexDirection: "row",
|
193
|
+
justifyContent: "space-between",
|
194
|
+
alignItems: "center",
|
195
|
+
alignSelf: "stretch",
|
196
|
+
gap: 8,
|
197
|
+
marginTop: 4
|
198
|
+
},
|
199
|
+
children: [
|
200
|
+
/* @__PURE__ */ i(
|
201
|
+
x,
|
202
|
+
{
|
203
|
+
sx: {
|
204
|
+
flexDirection: "row",
|
205
|
+
alignItems: "center",
|
206
|
+
gap: 8,
|
207
|
+
flex: 1,
|
208
|
+
minWidth: 0
|
209
|
+
},
|
210
|
+
children: [
|
211
|
+
/* @__PURE__ */ t(
|
212
|
+
I,
|
213
|
+
{
|
214
|
+
sx: {
|
215
|
+
width: "12px",
|
216
|
+
height: "12px",
|
217
|
+
backgroundColor: f[0]?.color,
|
218
|
+
borderRadius: "4px"
|
219
|
+
}
|
220
|
+
}
|
221
|
+
),
|
222
|
+
/* @__PURE__ */ t(l, { variant: "Body", children: h })
|
223
|
+
]
|
224
|
+
}
|
225
|
+
),
|
226
|
+
/* @__PURE__ */ t(l, { bold: !0, variant: "Body", children: y(Math.abs(k), o) })
|
227
|
+
]
|
228
|
+
},
|
229
|
+
h
|
230
|
+
);
|
231
|
+
}) : /* @__PURE__ */ t(l, { variant: "Body", children: "No data" })
|
232
|
+
]
|
233
|
+
}
|
234
|
+
);
|
235
|
+
}
|
236
|
+
return /* @__PURE__ */ i(
|
237
|
+
x,
|
238
|
+
{
|
239
|
+
sx: {
|
240
|
+
backgroundColor: s.palette.background.paper,
|
241
|
+
boxShadow: "0 2px 8px 0 rgba(0, 0, 0, 0.12)",
|
242
|
+
flexDirection: "column",
|
243
|
+
alignItems: "flex-start",
|
244
|
+
borderRadius: "4px",
|
245
|
+
width: 225,
|
246
|
+
gap: 8,
|
247
|
+
px: 16,
|
248
|
+
py: 12
|
249
|
+
},
|
250
|
+
children: [
|
251
|
+
/* @__PURE__ */ t(l, { variant: "H3", children: String(u) }),
|
252
|
+
f.map((d, n) => /* @__PURE__ */ i(
|
253
|
+
x,
|
254
|
+
{
|
255
|
+
sx: {
|
256
|
+
flexDirection: "row",
|
257
|
+
justifyContent: "space-between",
|
258
|
+
alignItems: "center",
|
259
|
+
alignSelf: "stretch",
|
260
|
+
gap: 8,
|
261
|
+
marginTop: 4
|
262
|
+
},
|
263
|
+
children: [
|
264
|
+
/* @__PURE__ */ i(x, { sx: { flexDirection: "row", alignItems: "center", gap: 8 }, children: [
|
265
|
+
/* @__PURE__ */ t(
|
266
|
+
I,
|
267
|
+
{
|
268
|
+
sx: {
|
269
|
+
width: "12px",
|
270
|
+
height: "12px",
|
271
|
+
backgroundColor: d.color,
|
272
|
+
borderRadius: "4px"
|
273
|
+
}
|
274
|
+
}
|
275
|
+
),
|
276
|
+
/* @__PURE__ */ t(l, { variant: "Body", children: typeof a[n] == "string" ? a[n] : a[n]?.label })
|
277
|
+
] }),
|
278
|
+
/* @__PURE__ */ t(l, { bold: !0, variant: "Body", children: y(d.data[c], o) })
|
279
|
+
]
|
280
|
+
},
|
281
|
+
d.id
|
282
|
+
))
|
283
|
+
]
|
284
|
+
}
|
285
|
+
);
|
286
|
+
}
|
287
|
+
},
|
288
|
+
trigger: "axis"
|
289
|
+
}
|
290
|
+
);
|
291
|
+
}
|
292
|
+
const De = ({
|
293
|
+
axisColor: e,
|
294
|
+
baseline: a = "max",
|
295
|
+
colors: o,
|
296
|
+
curveType: s = "linear",
|
297
|
+
customLegendVariant: g,
|
298
|
+
customTooltipLabels: u,
|
299
|
+
datasets: m,
|
300
|
+
height: f,
|
301
|
+
isGraphClippingXAxis: c = !1,
|
302
|
+
labels: d,
|
303
|
+
labelBackgroundColor: n,
|
304
|
+
labelFontColor: h,
|
305
|
+
labelFontSize: k,
|
306
|
+
margin: A,
|
307
|
+
markHandlers: B,
|
308
|
+
markStyles: $,
|
309
|
+
showArea: C = !1,
|
310
|
+
showAverage: M = !1,
|
311
|
+
showAxisHighlight: D = !1,
|
312
|
+
showBars: w = !1,
|
313
|
+
showLegend: T = !1,
|
314
|
+
showMarkLabel: H = !1,
|
315
|
+
showTooltip: E = !1,
|
316
|
+
showXAxis: X = !1,
|
317
|
+
showXAxisTicks: Y = !1,
|
318
|
+
showYAxis: F = !1,
|
319
|
+
showYAxisTicks: G = !1,
|
320
|
+
title: O,
|
321
|
+
useCustomMark: Q = !1,
|
322
|
+
valueFormatterString: p,
|
323
|
+
width: U
|
324
|
+
}) => {
|
325
|
+
const b = N(), V = m.flat().map((r) => r.x), L = m.flat().map((r) => r.y), j = Math.round(L.reduce((r, W) => W + r, 0) / L.length), z = Math.floor(Math.min(...L) / 100) * 100, P = Math.ceil(Math.max(...L) / 100) * 100, R = m.map((r, W) => ({
|
326
|
+
type: w ? "bar" : "line",
|
327
|
+
curve: s,
|
328
|
+
color: w ? b.palette.chart?.chart6 : o[W] ?? b.palette.primary.main,
|
329
|
+
data: r.map((S) => S.y),
|
330
|
+
area: C,
|
331
|
+
baseline: a,
|
332
|
+
showMark: !0,
|
333
|
+
valueFormatter: (S) => p ? y(S || 0, p) : String(S)
|
334
|
+
})), q = {
|
335
|
+
...{
|
336
|
+
top: 60,
|
337
|
+
right: 35,
|
338
|
+
bottom: 50,
|
339
|
+
left: 50
|
340
|
+
},
|
341
|
+
...A
|
342
|
+
};
|
343
|
+
return /* @__PURE__ */ i("div", { style: { position: "relative" }, children: [
|
344
|
+
/* @__PURE__ */ i(
|
345
|
+
J,
|
346
|
+
{
|
347
|
+
height: f,
|
348
|
+
margin: q,
|
349
|
+
series: R,
|
350
|
+
sx: {
|
351
|
+
p: 4,
|
352
|
+
"& .MuiBarLabel-root": {
|
353
|
+
fontSize: 10,
|
354
|
+
fontWeight: 600
|
355
|
+
},
|
356
|
+
"& .MuiAreaElement-root": {
|
357
|
+
opacity: 0.15
|
358
|
+
}
|
359
|
+
},
|
360
|
+
width: U,
|
361
|
+
xAxis: [{ data: V, scaleType: w ? "band" : "point" }],
|
362
|
+
yAxis: [
|
363
|
+
{
|
364
|
+
min: c ? -22 : z,
|
365
|
+
max: P || 100,
|
366
|
+
colorMap: C && R.length < 2 ? {
|
367
|
+
type: "continuous",
|
368
|
+
min: z,
|
369
|
+
max: P,
|
370
|
+
color: [
|
371
|
+
b.palette.background.paper,
|
372
|
+
o[0] ?? b.palette.primary.main
|
373
|
+
]
|
374
|
+
} : void 0,
|
375
|
+
valueFormatter: (r) => p ? y(r, p) : String(r)
|
376
|
+
}
|
377
|
+
],
|
378
|
+
children: [
|
379
|
+
M && /* @__PURE__ */ t(
|
380
|
+
K,
|
381
|
+
{
|
382
|
+
lineStyle: {
|
383
|
+
stroke: n ? b.palette.neutral.main : b.palette.neutral.dark,
|
384
|
+
strokeDasharray: "10, 8",
|
385
|
+
strokeWidth: 2
|
386
|
+
},
|
387
|
+
y: j
|
388
|
+
}
|
389
|
+
),
|
390
|
+
/* @__PURE__ */ t(Z, {}),
|
391
|
+
/* @__PURE__ */ t(
|
392
|
+
_,
|
393
|
+
{
|
394
|
+
slots: {
|
395
|
+
line: (r) => /* @__PURE__ */ t(
|
396
|
+
he,
|
397
|
+
{
|
398
|
+
...r,
|
399
|
+
lineColor: r.ownerState.color ?? b.palette.primary.main
|
400
|
+
}
|
401
|
+
)
|
402
|
+
}
|
403
|
+
}
|
404
|
+
),
|
405
|
+
/* @__PURE__ */ t(
|
406
|
+
ee,
|
407
|
+
{
|
408
|
+
slots: Q ? {
|
409
|
+
mark: (r) => /* @__PURE__ */ t(
|
410
|
+
de,
|
411
|
+
{
|
412
|
+
handlers: B,
|
413
|
+
labelBackgroundColor: n,
|
414
|
+
labelFontColor: h,
|
415
|
+
labelFontSize: k,
|
416
|
+
showLabel: H,
|
417
|
+
style: $?.(r.dataIndex) ?? {},
|
418
|
+
valueFormatterString: p,
|
419
|
+
yData: L,
|
420
|
+
...r
|
421
|
+
}
|
422
|
+
)
|
423
|
+
} : void 0
|
424
|
+
}
|
425
|
+
),
|
426
|
+
/* @__PURE__ */ t(
|
427
|
+
te,
|
428
|
+
{
|
429
|
+
barLabel: (r) => Number(r.value) > 0 ? `$${r.value}` : null,
|
430
|
+
borderRadius: 10
|
431
|
+
}
|
432
|
+
),
|
433
|
+
/* @__PURE__ */ t(
|
434
|
+
ne,
|
435
|
+
{
|
436
|
+
disableLine: !X,
|
437
|
+
disableTicks: !Y,
|
438
|
+
slotProps: e ? {
|
439
|
+
axisLine: {
|
440
|
+
style: {
|
441
|
+
stroke: e
|
442
|
+
}
|
443
|
+
},
|
444
|
+
axisTick: {
|
445
|
+
style: {
|
446
|
+
stroke: e
|
447
|
+
}
|
448
|
+
}
|
449
|
+
} : {}
|
450
|
+
}
|
451
|
+
),
|
452
|
+
/* @__PURE__ */ t(
|
453
|
+
re,
|
454
|
+
{
|
455
|
+
disableLine: !F,
|
456
|
+
disableTicks: !G,
|
457
|
+
slotProps: e ? {
|
458
|
+
axisLine: {
|
459
|
+
style: {
|
460
|
+
stroke: e
|
461
|
+
}
|
462
|
+
},
|
463
|
+
axisTick: {
|
464
|
+
style: {
|
465
|
+
stroke: e
|
466
|
+
}
|
467
|
+
}
|
468
|
+
} : {}
|
469
|
+
}
|
470
|
+
),
|
471
|
+
D && /* @__PURE__ */ t(ae, { x: "line" }),
|
472
|
+
E && /* @__PURE__ */ t(
|
473
|
+
fe,
|
474
|
+
{
|
475
|
+
customLabels: u,
|
476
|
+
labels: d,
|
477
|
+
valueFormatterString: p
|
478
|
+
}
|
479
|
+
)
|
480
|
+
]
|
481
|
+
}
|
482
|
+
),
|
483
|
+
T && /* @__PURE__ */ t(
|
484
|
+
xe,
|
485
|
+
{
|
486
|
+
average: M ? j : void 0,
|
487
|
+
customLegendVariant: g,
|
488
|
+
labels: d,
|
489
|
+
series: R,
|
490
|
+
style: { position: "absolute", top: 16, left: 16 },
|
491
|
+
title: O,
|
492
|
+
valueFormatterString: p
|
493
|
+
}
|
494
|
+
)
|
495
|
+
] });
|
496
|
+
};
|
497
|
+
export {
|
498
|
+
De as L
|
499
|
+
};
|