@mx-cartographer/experiences 7.7.0-alpha.bb7 → 7.7.0-alpha.bb9

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.
@@ -89,7 +89,7 @@ const Tt = ({
89
89
  }
90
90
  ) })
91
91
  ] }), Rt = (t) => {
92
- const r = W(), s = t.showLabel, o = t.style, b = o?.markLabelStyles, x = Number(t.x), h = Number(t.y), u = t.handlers?.onMarkClick, m = t.handlers?.onMouseEnter, c = t.handlers?.onMouseLeave, i = Dt(r.breakpoints.up("sm")), f = t.valueFormatterString ? p(t.yData[t.dataIndex], t.valueFormatterString) : String(t.yData[t.dataIndex]), d = i ? r.typography.Small?.fontSize : r.typography.XSmall?.fontSize, D = 30, T = 24, A = x - D / 2, B = h - 30;
92
+ const r = W(), s = t.showLabel, o = t.style, b = o?.markLabelStyles, x = Number(t.x), h = Number(t.y), u = t.handlers?.onMarkClick, m = t.handlers?.onMouseEnter, c = t.handlers?.onMouseLeave, i = Dt(r.breakpoints.up("sm")), f = t.valueFormatterString ? p(t.yData[t.dataIndex], t.valueFormatterString) : String(t.yData[t.dataIndex]), d = i ? r.typography.Small?.fontSize : r.typography.XSmall?.fontSize, C = 30, T = 24, A = x - C / 2, B = h - 30;
93
93
  return /* @__PURE__ */ a($, { children: [
94
94
  s && /* @__PURE__ */ a($, { children: [
95
95
  t.labelBackgroundColor && /* @__PURE__ */ e(
@@ -98,7 +98,7 @@ const Tt = ({
98
98
  fill: t.labelBackgroundColor,
99
99
  height: T,
100
100
  rx: "3",
101
- width: D,
101
+ width: C,
102
102
  x: A,
103
103
  y: B
104
104
  }
@@ -306,7 +306,7 @@ const _t = ({
306
306
  customLegendBoxSx: i,
307
307
  customTooltipLabels: f,
308
308
  datasets: d,
309
- height: D,
309
+ height: C,
310
310
  isGraphClippingXAxis: T = !1,
311
311
  labels: A,
312
312
  labelBackgroundColor: B,
@@ -337,10 +337,10 @@ const _t = ({
337
337
  width: ct,
338
338
  xAxisScaleType: dt
339
339
  }) => {
340
- const y = W(), ht = d.flat().map((n) => n.x), C = d.flat().map((n) => n.y), O = E || Math.round(C.reduce((n, v) => v + n, 0) / C.length), w = Math.floor(Math.min(...C) / 100) * 100, L = Math.ceil(Math.max(...C) / 100) * 100, I = d.map((n, v) => ({
340
+ const y = W(), ht = d.flat().map((n) => n.x), w = d.flat().map((n) => n.y), O = E || Math.round(w.reduce((n, D) => D + n, 0) / w.length), L = Math.floor(Math.min(...w) / 100) * 100, S = Math.ceil(Math.max(...w) / 100) * 100, I = d.map((n, D) => ({
341
341
  type: N ? "bar" : "line",
342
342
  curve: u,
343
- color: N ? y.palette.chart?.chart6 : h[v] ?? y.palette.primary.main,
343
+ color: N ? y.palette.chart?.chart6 : h[D] ?? y.palette.primary.main,
344
344
  data: n.map((g) => g.y),
345
345
  area: H,
346
346
  baseline: s,
@@ -355,21 +355,22 @@ const _t = ({
355
355
  },
356
356
  ...Q
357
357
  };
358
- let S = J ?? w, R = K ?? L;
358
+ let v = J ?? L, R = K ?? S;
359
359
  if (o === "networthChart") {
360
- const n = L - w, v = n < L * 0.05 ? 0.25 : 0.2, g = Math.max(n * v, L * 0.015);
361
- S = w - g < 0 ? w : w - g, R = L + g;
360
+ const n = S - L, D = n < S * 0.05 ? 0.25 : 0.2, g = Math.max(n * D, S * 0.015);
361
+ v = L - g < 0 ? L : L - g, R = S + g;
362
362
  }
363
363
  const ut = () => {
364
364
  if (o === "creditOverTime")
365
- return X(S, 850, 5);
365
+ return X(v, 850, 5);
366
366
  if (o === "networthChart")
367
- return X(S, R, 5);
367
+ return X(v, R, 5);
368
368
  };
369
369
  return /* @__PURE__ */ a(
370
370
  Y,
371
371
  {
372
372
  sx: {
373
+ height: C || "100%",
373
374
  position: "relative",
374
375
  touchAction: "pan-y",
375
376
  // Allow vertical scrolling
@@ -388,7 +389,7 @@ const _t = ({
388
389
  /* @__PURE__ */ a(
389
390
  xt,
390
391
  {
391
- height: D,
392
+ height: C,
392
393
  margin: mt,
393
394
  series: I,
394
395
  sx: {
@@ -411,11 +412,11 @@ const _t = ({
411
412
  yAxis: [
412
413
  {
413
414
  tickInterval: ut(),
414
- min: T ? -22 : S,
415
+ min: T ? -22 : v,
415
416
  max: R || 100,
416
417
  colorMap: H && I.length < 2 ? {
417
418
  type: "continuous",
418
- min: S,
419
+ min: v,
419
420
  max: R,
420
421
  color: [
421
422
  y.palette.background.paper,
@@ -486,7 +487,7 @@ const _t = ({
486
487
  showMark: tt || n.dataIndex === d[0].length - 1,
487
488
  style: V?.(n.dataIndex) ?? {},
488
489
  valueFormatterString: k,
489
- yData: C,
490
+ yData: w,
490
491
  ...n
491
492
  }
492
493
  )
@@ -11,7 +11,7 @@ import B from "@mui/material/ListSubheader";
11
11
  import W from "@mui/system/Stack";
12
12
  import { useTheme as v1, alpha as A1 } from "@mui/material/styles";
13
13
  import { u as R, A as M1 } from "../AccountDetailsHeader-rT8KbT1M.mjs";
14
- import { L as w1 } from "../LineChart-BF4QA-Lx.mjs";
14
+ import { L as w1 } from "../LineChart-BoML7cMy.mjs";
15
15
  import { g as x1, a as y1, b as b1 } from "../SpendingData-BmL0bwnS.mjs";
16
16
  import { m as S1, u as w, d as k, g as Z, h as C1, b as $, a as R1 } from "../hooks-ZMp65DFz.mjs";
17
17
  import { A as c1, g as L, N as h1 } from "../Account-Cp4uT2pE.mjs";
@@ -14,7 +14,7 @@ import { L as ee } from "../Loader-DUaFpDGv.mjs";
14
14
  import u from "react";
15
15
  import B from "@mui/material/Button";
16
16
  import Y from "@mui/material/Card";
17
- import { L as Ve } from "../LineChart-BF4QA-Lx.mjs";
17
+ import { L as Ve } from "../LineChart-BoML7cMy.mjs";
18
18
  import { C as ft } from "../ConnectionsDrawer-BDpVTTSe.mjs";
19
19
  import { b as re } from "../GlobalAccountFilter-DQCPNc95.mjs";
20
20
  import le from "@mui/material/Tab";
@@ -2,7 +2,7 @@ import { jsx as e, jsxs as r, Fragment as N } from "react/jsx-runtime";
2
2
  import { fromUnixTime as re } from "date-fns/fromUnixTime";
3
3
  import { observer as w } from "mobx-react-lite";
4
4
  import { useTheme as j } from "@mui/material/styles";
5
- import { L as ie } from "../LineChart-BF4QA-Lx.mjs";
5
+ import { L as ie } from "../LineChart-BoML7cMy.mjs";
6
6
  import { p as ae, q as B, u as E, g as $, d as Y, b as q } from "../hooks-ZMp65DFz.mjs";
7
7
  import { u as Z } from "../useScreenSize-B6JyS_Lj.mjs";
8
8
  import { f as se, D as ce } from "../Dialog-B4PI-_bL.mjs";
@@ -1,12 +1,12 @@
1
1
  import { jsxs as y, jsx as e, Fragment as yt } from "react/jsx-runtime";
2
2
  import u, { useRef as _t, useState as Tt, useEffect as bt } from "react";
3
3
  import { observer as R } from "mobx-react-lite";
4
- import { CategoryIcon as De, Text as z, Icon as Se, P as pe, H3 as je, ChevronRightIcon as St } from "@mxenabled/mxui";
4
+ import { CategoryIcon as ve, Text as z, Icon as be, P as pe, H3 as je, ChevronRightIcon as St } from "@mxenabled/mxui";
5
5
  import A from "@mui/material/Box";
6
6
  import w from "@mui/material/Stack";
7
- import we from "@mui/material/Button";
7
+ import Se from "@mui/material/Button";
8
8
  import { addSeconds as Ue } from "date-fns/addSeconds";
9
- import { differenceInCalendarMonths as xe } from "date-fns/differenceInCalendarMonths";
9
+ import { differenceInCalendarMonths as we } from "date-fns/differenceInCalendarMonths";
10
10
  import wt from "numeral";
11
11
  import { useTheme as de } from "@mui/material/styles";
12
12
  import { useItemTooltip as xt, ChartsTooltipContainer as vt } from "@mui/x-charts/ChartsTooltip";
@@ -17,9 +17,9 @@ import Xe from "@mui/material/Card";
17
17
  import Ze from "@mui/material/CardContent";
18
18
  import He from "@mui/material/Divider";
19
19
  import Ge from "@mui/material/Grid";
20
- import { u as k, m as J, g as P, b as Ce, h as Ie, d as Le, v as ye, p as Qe, f as We, a as qe } from "../hooks-ZMp65DFz.mjs";
20
+ import { u as k, m as J, g as P, b as fe, h as De, d as Ie, v as Ce, p as Qe, f as We, a as qe } from "../hooks-ZMp65DFz.mjs";
21
21
  import { b as Je } from "../Localization-2MODESHW.mjs";
22
- import { C as ve } from "../CurrencyText-Dr0EZ7bp.mjs";
22
+ import { C as xe } from "../CurrencyText-Dr0EZ7bp.mjs";
23
23
  import { C as Re, b as Be, c as Lt } from "../Category-CevNQ03n.mjs";
24
24
  import { f as Q, D as V } from "../Dialog-B4PI-_bL.mjs";
25
25
  import { f as ae, a as Et } from "../NumberFormatting-DjTD0t3W.mjs";
@@ -35,9 +35,9 @@ import { H as ke } from "../HeaderCell-DjuifqHJ.mjs";
35
35
  import { A as v, W as st } from "../WidgetContainer-Dd99GYSN.mjs";
36
36
  import { a as rt, T as at } from "../TransactionDetails-D1TZl3jS.mjs";
37
37
  import { D as Ne } from "../Drawer-DV4NTsFg.mjs";
38
- import { u as Ee } from "../useWidgetLoadTimer-hIOioiKx.mjs";
39
- import { L as fe } from "../Loader-DUaFpDGv.mjs";
40
- import { L as Oe } from "../LineChart-BF4QA-Lx.mjs";
38
+ import { u as Le } from "../useWidgetLoadTimer-hIOioiKx.mjs";
39
+ import { L as Ee } from "../Loader-DUaFpDGv.mjs";
40
+ import { L as Oe } from "../LineChart-BoML7cMy.mjs";
41
41
  import { M as Vt } from "../MiniWidgetContainer-98-hKFqm.mjs";
42
42
  import { subMonths as Ft } from "date-fns";
43
43
  import { TrendingUp as Pt, TrendingDown as $t, MultilineChart as zt, ExpandLess as Kt, ExpandMore as Yt } from "@mxenabled/mx-icons";
@@ -65,7 +65,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
65
65
  "aria-label": Je(n.category_icon_label_aria, r),
66
66
  mb: 4,
67
67
  role: "img",
68
- children: /* @__PURE__ */ e(De, { categoryGuid: s })
68
+ children: /* @__PURE__ */ e(ve, { categoryGuid: s })
69
69
  }
70
70
  ),
71
71
  /* @__PURE__ */ e(z, { variant: "Body", children: r })
@@ -102,7 +102,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
102
102
  /* @__PURE__ */ y(A, { alignItems: "center", display: "flex", flexDirection: "column", children: [
103
103
  /* @__PURE__ */ e(ct, { categoryGuid: o, topLevelCategoryGuid: s }),
104
104
  /* @__PURE__ */ e(z, { variant: "Small", children: `${n.length}-month total` }),
105
- /* @__PURE__ */ e(ve, { amount: l, bold: !0, formatString: "0,0", variant: "body2" })
105
+ /* @__PURE__ */ e(xe, { amount: l, bold: !0, formatString: "0,0", variant: "body2" })
106
106
  ] }),
107
107
  /* @__PURE__ */ e(He, { sx: { my: 16, width: "100%" } }),
108
108
  /* @__PURE__ */ e(Ge, { container: !0, children: n.map((p, m) => /* @__PURE__ */ y(u.Fragment, { children: [
@@ -110,7 +110,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
110
110
  /* @__PURE__ */ e(Ge, { item: !0, xs: 4, children: /* @__PURE__ */ y(A, { alignItems: "center", display: "flex", flexDirection: "column", children: [
111
111
  /* @__PURE__ */ e(z, { color: i.palette.text.secondary, variant: "XSmall", children: p.x }),
112
112
  /* @__PURE__ */ e(
113
- ve,
113
+ xe,
114
114
  {
115
115
  amount: p.y,
116
116
  bold: !0,
@@ -144,7 +144,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
144
144
  children: s.map(({ guid: c, top_level_guid: l }) => {
145
145
  const p = n === c, m = Re[c], _ = Re[l], f = m ?? _ ?? Re.default, g = f + "33";
146
146
  return /* @__PURE__ */ y(
147
- we,
147
+ Se,
148
148
  {
149
149
  onClick: () => i(c),
150
150
  onMouseEnter: () => r(c),
@@ -194,7 +194,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
194
194
  return l === void 0 || !p ? null : /* @__PURE__ */ e(Xe, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ e(Ze, { children: /* @__PURE__ */ y(A, { alignItems: "center", display: "flex", flexDirection: "column", children: [
195
195
  /* @__PURE__ */ e(ct, { categoryGuid: o, topLevelCategoryGuid: s }),
196
196
  /* @__PURE__ */ e(z, { color: i.palette.text.secondary, variant: "Small", children: Q(p, V.MONTH_SHORT_YEAR) }),
197
- /* @__PURE__ */ e(ve, { amount: String(l), bold: !0, formatString: "0,0", variant: "Body" })
197
+ /* @__PURE__ */ e(xe, { amount: String(l), bold: !0, formatString: "0,0", variant: "Body" })
198
198
  ] }) }) });
199
199
  }, ho = ({
200
200
  onHoverArea: o,
@@ -220,7 +220,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
220
220
  (a, T) => r.reduce((I, Z) => I + Z.dataset[T]?.y || 0, 0)
221
221
  ) ?? [0], Y = Math.max(...te), ie = Math.max(
222
222
  ...i.flatMap((a) => a.dataset.map((T) => T.y))
223
- ), _e = Math.floor(Math.min(...F) / 100) * 100, ne = Math.ceil(Math.max(Y, ie) / 100) * 100, j = r.map((a, T) => ({
223
+ ), ye = Math.floor(Math.min(...F) / 100) * 100, ne = Math.ceil(Math.max(Y, ie) / 100) * 100, j = r.map((a, T) => ({
224
224
  id: `stacked-${T}`,
225
225
  guid: a.category_guid,
226
226
  top_level_guid: a.top_level_category_guid,
@@ -265,15 +265,15 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
265
265
  const a = X(String(b)).guid;
266
266
  a && t?.(a);
267
267
  }, he = (a) => {
268
- const T = String(a?.seriesId), I = X(T).guid, Z = se.find((ge) => ge.id === T), Te = Z && a?.dataIndex !== void 0, be = Z && a?.dataIndex === void 0;
269
- if (Te)
268
+ const T = String(a?.seriesId), I = X(T).guid, Z = se.find((ge) => ge.id === T), _e = Z && a?.dataIndex !== void 0, Te = Z && a?.dataIndex === void 0;
269
+ if (_e)
270
270
  L({
271
271
  hoveredSeriesId: T,
272
272
  hoveredAreaData: null,
273
273
  isAreaHovered: !1,
274
274
  cursorPos: M
275
275
  }), s?.(I);
276
- else if (be) {
276
+ else if (Te) {
277
277
  const ge = Z?.data.map((Me, Ae) => ({
278
278
  x: ee[Ae],
279
279
  y: Me
@@ -384,7 +384,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
384
384
  ],
385
385
  yAxis: [
386
386
  {
387
- min: _e,
387
+ min: ye,
388
388
  max: ne || 100,
389
389
  valueFormatter: (a) => wt(a).format("0a")
390
390
  }
@@ -437,7 +437,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
437
437
  color: "primary",
438
438
  sx: { width: 56 },
439
439
  value: t,
440
- children: t === "Chart" ? /* @__PURE__ */ e(Se, { name: "table_chart_view" }) : /* @__PURE__ */ e(Se, { name: "format_list_bulleted" })
440
+ children: t === "Chart" ? /* @__PURE__ */ e(be, { name: "table_chart_view" }) : /* @__PURE__ */ e(be, { name: "format_list_bulleted" })
441
441
  },
442
442
  t
443
443
  ))
@@ -475,7 +475,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
475
475
  /* @__PURE__ */ e(z, { variant: r ? "subtitle1" : "body2", children: h })
476
476
  ] });
477
477
  }, go = ({ name: o, topLevelCategoryGuid: s }) => /* @__PURE__ */ y(w, { alignItems: "center", direction: "row", justifyContent: "center", children: [
478
- /* @__PURE__ */ e(A, { "aria-hidden": !0, children: /* @__PURE__ */ e(De, { categoryGuid: s, variant: "twotone" }) }),
478
+ /* @__PURE__ */ e(A, { "aria-hidden": !0, children: /* @__PURE__ */ e(ve, { categoryGuid: s, variant: "twotone" }) }),
479
479
  /* @__PURE__ */ e(z, { sx: { ml: 12 }, variant: "body2", children: o })
480
480
  ] }), mo = (o) => /* @__PURE__ */ e(w, { alignItems: "center", direction: "row", role: "rowheader", tabIndex: o.tabIndex, children: /* @__PURE__ */ e(
481
481
  go,
@@ -486,7 +486,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
486
486
  ) }), Pe = (o) => {
487
487
  const s = o.row.category_guid, n = o.row.top_level_category_guid, t = s === Be.INCOME || n === Be.INCOME, r = o.row[o.field];
488
488
  return /* @__PURE__ */ e(w, { alignItems: "flex-end", direction: "row", tabIndex: o.tabIndex, children: /* @__PURE__ */ e(
489
- ve,
489
+ xe,
490
490
  {
491
491
  amount: t ? Math.abs(r) : r,
492
492
  isIncome: t,
@@ -633,7 +633,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
633
633
  isOpen: n,
634
634
  onClose: t
635
635
  }) => {
636
- const { onEvent: r } = P(), { selectedAccountGuids: i } = Ce(), { common: h } = k(), { setFilter: d, sortedTransactions: c } = Ie(), [l, p] = u.useState(""), m = u.useMemo(
636
+ const { onEvent: r } = P(), { selectedAccountGuids: i } = fe(), { common: h } = k(), { setFilter: d, sortedTransactions: c } = De(), [l, p] = u.useState(""), m = u.useMemo(
637
637
  () => c.find((f) => f.guid === l),
638
638
  [l, c]
639
639
  );
@@ -662,7 +662,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
662
662
  }
663
663
  );
664
664
  }, To = R(_o), bo = ({ onBackClick: o, sx: s }) => {
665
- const { onEvent: n } = P(), { isDesktop: t, isTablet: r, isMobile: i } = q(), { isAccountDataLoaded: h, loadAccountData: d } = Le(), {
665
+ const { onEvent: n } = P(), { isDesktop: t, isTablet: r, isMobile: i } = q(), { isAccountDataLoaded: h, loadAccountData: d } = Ie(), {
666
666
  categoriesLoaded: c,
667
667
  loadCategories: l,
668
668
  loadDateRangeCategoryTotals: p,
@@ -673,8 +673,8 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
673
673
  isTransactionDataLoaded: g,
674
674
  loadTransactionData: C,
675
675
  sortedTransactions: x
676
- } = Ie(), { selectedDateRange: S, setSelectedDateRange: L } = ye(), { isInitialized: b, selectedAccounts: E } = Ce(), { trends: W } = k(), [M, $] = u.useState(!1), [K, H] = u.useState(!1), [O, ee] = u.useState("Chart"), [F, te] = u.useState(""), [Y, ie] = u.useState(window.innerHeight), ne = Y - (i ? 315 : 345);
677
- Ee({
676
+ } = De(), { selectedDateRange: S, setSelectedDateRange: L } = Ce(), { isInitialized: b, selectedAccounts: E } = fe(), { trends: W } = k(), [M, $] = u.useState(!1), [K, H] = u.useState(!1), [O, ee] = u.useState("Chart"), [F, te] = u.useState(""), [Y, ie] = u.useState(window.innerHeight), ne = Y - (i ? 315 : 345);
677
+ Le({
678
678
  widgetName: "TrendsFullWidget",
679
679
  isLoaded: M
680
680
  }), u.useEffect(() => {
@@ -690,7 +690,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
690
690
  }).finally(() => {
691
691
  $(!0), n(v.TRENDS_LOAD_WIDGET, {
692
692
  ...G,
693
- time_period: `${xe(S.end, S.start)}M`
693
+ time_period: `${we(S.end, S.start)}M`
694
694
  });
695
695
  });
696
696
  }, [b, E, S]);
@@ -710,7 +710,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
710
710
  }, [_, F, S]), U = (D, B) => {
711
711
  ee(B ?? O), n(v.TRENDS_CLICK_TOGGLE_VIEW);
712
712
  }, se = (D) => {
713
- const B = Ue(D?.[0], 1), a = D?.[1], T = xe(a, B);
713
+ const B = Ue(D?.[0], 1), a = D?.[1], T = we(a, B);
714
714
  L({ start: B, end: a }), n(v.TRENDS_CLICK_TIME_WINDOW, {
715
715
  time_period: T + "M"
716
716
  });
@@ -727,7 +727,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
727
727
  }, he = (D) => {
728
728
  n(v.TRENDS_HOVER_POINT, { category: D });
729
729
  };
730
- return !b || !M ? /* @__PURE__ */ e(fe, {}) : /* @__PURE__ */ y(
730
+ return !b || !M ? /* @__PURE__ */ e(Ee, {}) : /* @__PURE__ */ y(
731
731
  st,
732
732
  {
733
733
  calendarActions: { onRangeChanged: se },
@@ -765,11 +765,11 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
765
765
  }
766
766
  ),
767
767
  /* @__PURE__ */ y(w, { alignItems: "center", flexDirection: "row", width: "100%", children: [
768
- /* @__PURE__ */ e(A, { flexGrow: 1, children: F && /* @__PURE__ */ y(we, { onClick: () => te(""), sx: { p: 0, pr: 5 }, children: [
769
- /* @__PURE__ */ e(Se, { name: "arrow_back" }),
768
+ /* @__PURE__ */ e(A, { flexGrow: 1, children: F && /* @__PURE__ */ y(Se, { onClick: () => te(""), sx: { p: 0, pr: 5 }, children: [
769
+ /* @__PURE__ */ e(be, { name: "arrow_back" }),
770
770
  W.all_categories
771
771
  ] }) }),
772
- /* @__PURE__ */ e(we, { onClick: () => H(!0), sx: { px: 5 }, children: `${W.view_transactions} (${x.length})` })
772
+ /* @__PURE__ */ e(Se, { onClick: () => H(!0), sx: { px: 5 }, children: `${W.view_transactions} (${x.length})` })
773
773
  ] }),
774
774
  /* @__PURE__ */ y(A, { children: [
775
775
  O === "Chart" && /* @__PURE__ */ e(
@@ -830,26 +830,26 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
830
830
  }
831
831
  );
832
832
  }, wo = R(So), xo = ({ onPrimaryCtaClick: o, sx: s }) => {
833
- const { isAccountDataLoaded: n, loadAccountData: t } = Le(), { loadMonthlyCategoryTotals: r, monthlyTotalsLoaded: i } = J(), { isInitialized: h } = We(), { trends: d } = k(), { selectedAccounts: c } = Ce();
833
+ const { isAccountDataLoaded: n, loadAccountData: t } = Ie(), { loadMonthlyCategoryTotals: r, monthlyTotalsLoaded: i } = J(), { isInitialized: h } = We(), { trends: d } = k(), { selectedAccounts: c } = fe();
834
834
  return u.useEffect(() => {
835
835
  n || t().finally();
836
- }, []), Ee({
836
+ }, []), Le({
837
837
  widgetName: "TrendsMiniWidget",
838
838
  isLoaded: i
839
839
  }), u.useEffect(() => {
840
840
  h && r(c).finally();
841
- }, [h, c]), h ? /* @__PURE__ */ e(
841
+ }, [h, c]), !h && !i ? /* @__PURE__ */ e(Ee, {}) : /* @__PURE__ */ e(
842
842
  Vt,
843
843
  {
844
- contentStyles: { height: "calc(100% - 72px)", ":last-child": { pb: 0 } },
844
+ contentStyles: { height: "calc(100% - 72px)", minHeight: 300, ":last-child": { pb: 0 } },
845
845
  onPrimaryCtaClick: o,
846
846
  primaryCtaLabel: d.primary_cta,
847
847
  subTitle: d.sub_title,
848
848
  sx: { height: "100%", ...s },
849
849
  title: d.mini_title,
850
- children: i ? /* @__PURE__ */ e(wo, {}) : /* @__PURE__ */ e(fe, {})
850
+ children: /* @__PURE__ */ e(wo, {})
851
851
  }
852
- ) : /* @__PURE__ */ e(fe, {});
852
+ );
853
853
  }, zn = R(xo), vo = 70, Ke = ({
854
854
  title: o,
855
855
  totalAmount: s,
@@ -944,15 +944,15 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
944
944
  ] })
945
945
  ] });
946
946
  }), Kn = R(({ onCtaClick: o }) => {
947
- const { isAccountDataLoaded: s, loadAccountData: n, visibleAccounts: t } = Le();
947
+ const { isAccountDataLoaded: s, loadAccountData: n, visibleAccounts: t } = Ie();
948
948
  u.useEffect(() => {
949
949
  s || n().finally();
950
950
  }, []);
951
951
  const { onEvent: r } = P(), { monthlyCategoryTotals: i, loadMonthlyCategoryTotals: h, monthlyTotalsLoaded: d } = J(), c = {
952
952
  start: Ft(/* @__PURE__ */ new Date(), 1),
953
953
  end: /* @__PURE__ */ new Date()
954
- }, { trends: l } = k(), { selectedAccounts: p, isInitialized: m } = Ce();
955
- Ee({
954
+ }, { trends: l } = k(), { selectedAccounts: p, isInitialized: m } = fe();
955
+ Le({
956
956
  widgetName: "TrendsMicroWidget",
957
957
  isLoaded: d
958
958
  }), u.useEffect(() => {
@@ -973,7 +973,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
973
973
  E ? v.TRENDS_CLICK_GET_STARTED : v.TRENDS_CLICK_VIEW_MORE
974
974
  ), o();
975
975
  };
976
- return !d || !m ? /* @__PURE__ */ e(fe, {}) : /* @__PURE__ */ e(
976
+ return !d || !m ? /* @__PURE__ */ e(Ee, {}) : /* @__PURE__ */ e(
977
977
  jt,
978
978
  {
979
979
  className: "mx-trends-microwidget",
@@ -1059,7 +1059,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
1059
1059
  /* @__PURE__ */ e(
1060
1060
  et,
1061
1061
  {
1062
- leftIcon: s ? /* @__PURE__ */ e(De, { categoryGuid: s }) : void 0,
1062
+ leftIcon: s ? /* @__PURE__ */ e(ve, { categoryGuid: s }) : void 0,
1063
1063
  onClick: p,
1064
1064
  rightContent: ae(Math.abs(o), "0,0.00"),
1065
1065
  rightIcon: r ? /* @__PURE__ */ e(St, {}) : void 0,
@@ -1072,7 +1072,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
1072
1072
  }
1073
1073
  ), Lo = R(
1074
1074
  ({ availableHeight: o = 0, onCategoryClick: s }) => {
1075
- const { collapsedCategories: n, visibleCategories: t, setVisibleListLength: r } = ye(), { isLargeDesktop: i, isDesktop: h } = q(), { trends: d } = k(), { onEvent: c } = P(), [l, p] = u.useState(!1), m = h || i;
1075
+ const { collapsedCategories: n, visibleCategories: t, setVisibleListLength: r } = Ce(), { isLargeDesktop: i, isDesktop: h } = q(), { trends: d } = k(), { onEvent: c } = P(), [l, p] = u.useState(!1), m = h || i;
1076
1076
  u.useEffect(() => {
1077
1077
  const g = Math.floor(o / 64) - 1, C = t.length + n.length;
1078
1078
  g !== t.length && (r(m ? Math.max(g, 5) : 5), p(g >= C));
@@ -1145,7 +1145,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
1145
1145
  }, Mo = R(Eo), Ao = R(({ chartLabel: o, chartColor: s }) => {
1146
1146
  const { onEvent: n } = P(), {
1147
1147
  categoryDetailsChartData: { monthlyAmounts: t, tooltipLabels: r }
1148
- } = ye();
1148
+ } = Ce();
1149
1149
  return /* @__PURE__ */ e(w, { sx: { pt: 12, width: "100%" }, children: /* @__PURE__ */ e(
1150
1150
  Oe,
1151
1151
  {
@@ -1176,7 +1176,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
1176
1176
  }
1177
1177
  ) });
1178
1178
  }), Ro = R(({ onClose: o }) => {
1179
- const s = it(), { is_mobile_webview: n } = qe(), { isDesktop: t, isSmallTablet: r, isTablet: i } = q(), { onEvent: h } = P(), { common: d, trends: c } = k(), { selectedCategoryData: l, selectedDateRangeMonthRange: p } = ye(), { sortedTransactions: m } = Ie(), [_, f] = u.useState(null);
1179
+ const s = it(), { is_mobile_webview: n } = qe(), { isDesktop: t, isSmallTablet: r, isTablet: i } = q(), { onEvent: h } = P(), { common: d, trends: c } = k(), { selectedCategoryData: l, selectedDateRangeMonthRange: p } = Ce(), { sortedTransactions: m } = De(), [_, f] = u.useState(null);
1180
1180
  if (!l)
1181
1181
  return null;
1182
1182
  const { guid: g, name: C, is_income: x, totalAmount: S } = l, L = x ? c.category_income : c.category_spending, b = oo(g, s), E = x ? c.income_label : c.spending_label, W = ` ${l.transactions.length === 1 ? c.transaction : c.transactions} (${l.transactions.length})`, M = u.useMemo(
@@ -1199,7 +1199,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
1199
1199
  /* @__PURE__ */ e(
1200
1200
  et,
1201
1201
  {
1202
- leftIcon: /* @__PURE__ */ e(De, { categoryGuid: g }),
1202
+ leftIcon: /* @__PURE__ */ e(ve, { categoryGuid: g }),
1203
1203
  rightContent: ae(Math.abs(S), "0,0.00"),
1204
1204
  subtitle: p,
1205
1205
  title: C
@@ -1316,21 +1316,21 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
1316
1316
  "WeeklyNoSpendDays",
1317
1317
  "WeeklySmallPurchasesSummary"
1318
1318
  ], Go = ({ onBackClick: o, onInsightCardClick: s, sx: n }) => {
1319
- const { onEvent: t } = P(), { config: r } = qe(), { isLargeDesktop: i, isDesktop: h, isMobile: d } = q(), { isAccountDataLoaded: c, loadAccountData: l, visibleAccounts: p } = Le(), {
1319
+ const { onEvent: t } = P(), { config: r } = qe(), { isLargeDesktop: i, isDesktop: h, isMobile: d } = q(), { isAccountDataLoaded: c, loadAccountData: l, visibleAccounts: p } = Ie(), {
1320
1320
  categoriesLoaded: m,
1321
1321
  loadCategories: _,
1322
1322
  loadDateRangeCategoryTotals: f,
1323
1323
  loadMonthlyCategoryTotals: g,
1324
1324
  monthlyCategoryTotals: C
1325
- } = J(), { isTransactionDataLoaded: x, loadTransactionData: S, setFilter: L } = Ie(), { selectedDateRange: b, setSelectedCategoryData: E, setSelectedDateRange: W } = ye(), { isInitialized: M, selectedAccounts: $, selectedAccountGuids: K } = Ce(), { trends: H, connect: O } = k(), { beatStore: ee } = We(), te = so() && r.show_insights_widget_in_master, Y = h || i, [ie, _e] = u.useState(!1), [ne, j] = u.useState(!1), [U, se] = u.useState("Chart"), [re, X] = u.useState(""), [ue, ce] = u.useState(!1), [le, he] = u.useState(window.innerHeight), D = Y ? 56 : 0, B = le - 208, a = le - (te ? 550 + D : 266), [T, I] = u.useState(!1), Z = r.show_connections_widget_in_master ? "buttons" : "no-buttons", Te = u.useMemo(
1325
+ } = J(), { isTransactionDataLoaded: x, loadTransactionData: S, setFilter: L } = De(), { selectedDateRange: b, setSelectedCategoryData: E, setSelectedDateRange: W } = Ce(), { isInitialized: M, selectedAccounts: $, selectedAccountGuids: K } = fe(), { trends: H, connect: O } = k(), { beatStore: ee } = We(), te = so() && r.show_insights_widget_in_master, Y = h || i, [ie, ye] = u.useState(!1), [ne, j] = u.useState(!1), [U, se] = u.useState("Chart"), [re, X] = u.useState(""), [ue, ce] = u.useState(!1), [le, he] = u.useState(window.innerHeight), D = Y ? 56 : 0, B = le - 208, a = le - (te ? 550 + D : 266), [T, I] = u.useState(!1), Z = r.show_connections_widget_in_master ? "buttons" : "no-buttons", _e = u.useMemo(
1326
1326
  () => p && p.length === 0 || C.length === 0,
1327
1327
  [p, C]
1328
1328
  );
1329
- Ee({
1329
+ Le({
1330
1330
  widgetName: "TrendsWidget",
1331
1331
  isLoaded: ie
1332
1332
  });
1333
- const be = u.useMemo(() => ne ? ee.getFilteredBeats({ templates: Oo }) : [], [ne]);
1333
+ const Te = u.useMemo(() => ne ? ee.getFilteredBeats({ templates: Oo }) : [], [ne]);
1334
1334
  u.useEffect(() => {
1335
1335
  const N = () => he(window.innerHeight);
1336
1336
  return window.addEventListener("resize", N), c || l().finally(), m || _().finally(), x || S().finally(), () => window.removeEventListener("resize", N);
@@ -1342,9 +1342,9 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
1342
1342
  b.end
1343
1343
  );
1344
1344
  }).finally(() => {
1345
- _e(!0), t(v.TRENDS_LOAD_WIDGET, {
1345
+ ye(!0), t(v.TRENDS_LOAD_WIDGET, {
1346
1346
  ...G,
1347
- time_period: `${xe(b.end, b.start)}M`
1347
+ time_period: `${we(b.end, b.start)}M`
1348
1348
  });
1349
1349
  }));
1350
1350
  }, [M, $, b]), u.useEffect(() => {
@@ -1373,7 +1373,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
1373
1373
  toggleView: oe
1374
1374
  });
1375
1375
  }, gt = (N) => {
1376
- const oe = Ue(N?.[0], 1), me = N?.[1], Ct = xe(me, oe);
1376
+ const oe = Ue(N?.[0], 1), me = N?.[1], Ct = we(me, oe);
1377
1377
  W({ start: oe, end: me }), t(v.TRENDS_CLICK_TIME_WINDOW, {
1378
1378
  ...G,
1379
1379
  time_period: Ct + "M"
@@ -1388,7 +1388,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
1388
1388
  }, ft = () => {
1389
1389
  X(""), t(v.TRENDS_CLICK_ALL_CATEGORIES, G);
1390
1390
  };
1391
- return !M || !ie ? /* @__PURE__ */ e(fe, {}) : /* @__PURE__ */ y(
1391
+ return !M || !ie ? /* @__PURE__ */ e(Ee, {}) : /* @__PURE__ */ y(
1392
1392
  st,
1393
1393
  {
1394
1394
  calendarActions: { onRangeChanged: gt },
@@ -1399,7 +1399,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
1399
1399
  sx: n,
1400
1400
  title: H.title,
1401
1401
  children: [
1402
- Te && /* @__PURE__ */ e(
1402
+ _e && /* @__PURE__ */ e(
1403
1403
  ro,
1404
1404
  {
1405
1405
  header: H.zero_state_content_header,
@@ -1411,7 +1411,7 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
1411
1411
  variant: Z
1412
1412
  }
1413
1413
  ),
1414
- !Te && /* @__PURE__ */ y(
1414
+ !_e && /* @__PURE__ */ y(
1415
1415
  w,
1416
1416
  {
1417
1417
  sx: {
@@ -1436,8 +1436,8 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
1436
1436
  ]
1437
1437
  }
1438
1438
  ),
1439
- /* @__PURE__ */ e(w, { alignItems: "center", flexDirection: "row", sx: { pb: 8 }, width: "100%", children: /* @__PURE__ */ e(A, { flexGrow: 1, children: re && /* @__PURE__ */ y(we, { onClick: ft, sx: { p: 0, pr: 5 }, children: [
1440
- /* @__PURE__ */ e(Se, { name: "arrow_back" }),
1439
+ /* @__PURE__ */ e(w, { alignItems: "center", flexDirection: "row", sx: { pb: 8 }, width: "100%", children: /* @__PURE__ */ e(A, { flexGrow: 1, children: re && /* @__PURE__ */ y(Se, { onClick: ft, sx: { p: 0, pr: 5 }, children: [
1440
+ /* @__PURE__ */ e(be, { name: "arrow_back" }),
1441
1441
  H.all_categories
1442
1442
  ] }) }) }),
1443
1443
  /* @__PURE__ */ y(w, { flexDirection: Y ? "row" : "column", gap: Y ? 48 : 16, children: [
@@ -1452,10 +1452,10 @@ const ct = ({ categoryGuid: o, topLevelCategoryGuid: s }) => {
1452
1452
  }
1453
1453
  ) }),
1454
1454
  /* @__PURE__ */ y(w, { gap: 16, sx: { width: Y ? "32%" : "100%" }, children: [
1455
- te && ne && be.length > 0 && /* @__PURE__ */ e(
1455
+ te && ne && Te.length > 0 && /* @__PURE__ */ e(
1456
1456
  Mo,
1457
1457
  {
1458
- beats: be,
1458
+ beats: Te,
1459
1459
  onInsightCardClick: s
1460
1460
  }
1461
1461
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "7.7.0-alpha.bb7",
3
+ "version": "7.7.0-alpha.bb9",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",