@mx-cartographer/experiences 9.7.69 → 9.7.71-alpha-ram-usp-2
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 +16 -0
- package/dist/core/stores/GlobalCopyStore.d.ts +6 -0
- package/dist/core/stores/GlobalCopyStore.es.js +14 -8
- package/dist/core/stores/GlobalCopyStore.es.js.map +1 -1
- package/dist/core/stores/GoalStore.d.ts +1 -1
- package/dist/core/stores/GoalStore.es.js +1 -1
- package/dist/core/stores/GoalStore.es.js.map +1 -1
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +24 -0
- package/dist/goals/GoalsMiniWidget.d.ts +7 -0
- package/dist/goals/{GoalsMicroWidget.es.js → GoalsMiniWidget.es.js} +14 -14
- package/dist/goals/GoalsMiniWidget.es.js.map +1 -0
- package/dist/goals/components/{micro/GoalMicroStatusCard.d.ts → mini/GoalMiniStatusCard.d.ts} +1 -1
- package/dist/goals/components/{micro/GoalMicroStatusCard.es.js → mini/GoalMiniStatusCard.es.js} +2 -2
- package/dist/goals/components/mini/GoalMiniStatusCard.es.js.map +1 -0
- package/dist/goals/components/{micro/GoalsMicroEmptyState.d.ts → mini/GoalsMiniEmptyState.d.ts} +1 -1
- package/dist/goals/components/{micro/GoalsMicroEmptyState.es.js → mini/GoalsMiniEmptyState.es.js} +2 -2
- package/dist/goals/components/mini/GoalsMiniEmptyState.es.js.map +1 -0
- package/dist/goals/index.d.ts +1 -1
- package/dist/goals/index.es.js +4 -4
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.d.ts +6 -0
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js +168 -0
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +11 -11
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js +3 -3
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +92 -59
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.d.ts +9 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js +9 -5
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js +5 -5
- package/dist/insights-v2/components/AccountHeroCard.es.js +7 -5
- package/dist/insights-v2/components/AccountHeroCard.es.js.map +1 -1
- package/dist/insights-v2/components/BaseLayout.es.js +157 -138
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/CtaStatus.d.ts +14 -1
- package/dist/insights-v2/components/CtaStatus.es.js +76 -38
- package/dist/insights-v2/components/CtaStatus.es.js.map +1 -1
- package/dist/insights-v2/components/InsightTransactionRow.d.ts +3 -1
- package/dist/insights-v2/components/InsightTransactionRow.es.js +36 -20
- package/dist/insights-v2/components/InsightTransactionRow.es.js.map +1 -1
- package/dist/insights-v2/components/StatusPill.es.js +12 -11
- package/dist/insights-v2/components/StatusPill.es.js.map +1 -1
- package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.d.ts +4 -0
- package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.es.js +10 -0
- package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.es.js.map +1 -0
- package/dist/insights-v2/components/TransactionListCard.d.ts +5 -1
- package/dist/insights-v2/components/TransactionListCard.es.js +69 -49
- package/dist/insights-v2/components/TransactionListCard.es.js.map +1 -1
- package/dist/insights-v2/components/shared/StatusSnackbar.d.ts +10 -1
- package/dist/insights-v2/components/shared/StatusSnackbar.es.js +27 -11
- package/dist/insights-v2/components/shared/StatusSnackbar.es.js.map +1 -1
- package/dist/insights-v2/components/shared/elevation.d.ts +16 -0
- package/dist/insights-v2/components/shared/elevation.es.js +15 -0
- package/dist/insights-v2/components/shared/elevation.es.js.map +1 -0
- package/dist/insights-v2/ctaActions/ctaConfig.es.js +23 -9
- package/dist/insights-v2/ctaActions/ctaConfig.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/runCtaAction.d.ts +7 -0
- package/dist/insights-v2/ctaActions/runCtaAction.es.js +73 -62
- package/dist/insights-v2/ctaActions/runCtaAction.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/subscriptionAnswer.d.ts +10 -1
- package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js +115 -0
- package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js.map +1 -0
- package/dist/insights-v2/ctaActions/types.d.ts +5 -2
- package/dist/insights-v2/ctaActions/useCtaAction.d.ts +6 -0
- package/dist/insights-v2/ctaActions/useCtaAction.es.js +32 -27
- package/dist/insights-v2/ctaActions/useCtaAction.es.js.map +1 -1
- package/dist/insights-v2/mappings/actionBlocksKey.d.ts +1 -0
- package/dist/insights-v2/mappings/actionBlocksKey.es.js +1 -0
- package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
- package/dist/insights-v2/mappings/blocks.es.js +74 -68
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/dist/microinsights/MicroCardTemplate.es.js +21 -17
- package/dist/microinsights/MicroCardTemplate.es.js.map +1 -1
- package/dist/microinsights/cards/InsightCard.es.js +91 -86
- package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
- package/dist/microinsights/cards/MicroCtaStatus.d.ts +18 -0
- package/dist/microinsights/cards/MicroCtaStatus.es.js +44 -0
- package/dist/microinsights/cards/MicroCtaStatus.es.js.map +1 -0
- package/dist/microinsights/stores/CopyStore.d.ts +4 -1
- package/dist/microinsights/stores/CopyStore.es.js +13 -10
- package/dist/microinsights/stores/CopyStore.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/goals/GoalsMicroWidget.d.ts +0 -7
- package/dist/goals/GoalsMicroWidget.es.js.map +0 -1
- package/dist/goals/components/micro/GoalMicroStatusCard.es.js.map +0 -1
- package/dist/goals/components/micro/GoalsMicroEmptyState.es.js.map +0 -1
|
@@ -9,25 +9,25 @@ import { ANALYTICS_EVENTS_CONFIG as P } from "../../analytics/analyticsEventsCon
|
|
|
9
9
|
import { useAnalyticsEvent as Lt } from "../../analytics/useAnalyticsEvent.es.js";
|
|
10
10
|
import { DoubleBarChart as It } from "../../components/chartblocks/DoubleBarChart.es.js";
|
|
11
11
|
import { toLegendItems as xt } from "../../blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils.es.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
12
|
+
import { getDynamicCtaBasedOnTriggers as Et } from "../util.es.js";
|
|
13
|
+
import { TransactionDrillDown as Rt } from "./TransactionDrillDown.es.js";
|
|
14
|
+
import { getDefaultSelection as Ot, getDrillDownConfig as jt, getFlattenedDataSeries as Ft, resolveDrillDownSubHeader as Gt, splitProjectedTransaction as Ht, toStoreFilter as wt } from "./utils.es.js";
|
|
15
|
+
import { useTransactionHistory as kt } from "./useTransactionHistory.es.js";
|
|
16
16
|
import { TransactionDetailsBlock as Nt } from "../TransactionDetailsBlock/TransactionDetailsBlock.es.js";
|
|
17
17
|
import { useLayoutEffect as Kt, useState as m } from "react";
|
|
18
18
|
import { observer as Mt } from "mobx-react-lite";
|
|
19
19
|
import { Fragment as Pt, jsx as r, jsxs as Vt } from "react/jsx-runtime";
|
|
20
20
|
import { useTheme as zt } from "@mui/material/styles";
|
|
21
21
|
var ge = Mt(({ beat: s }) => {
|
|
22
|
-
const D = zt(), { actionDrawer: B, setActionContext: S } = Ct(), { insights_payload: c } = s, V =
|
|
22
|
+
const D = zt(), { actionDrawer: B, setActionContext: S } = Ct(), { insights_payload: c } = s, V = Et(B, c?.primary_cta, c?.secondary_cta, c?.in_description_cta)?.variant, { top: e, filterMode: u, header: z, colors: U, filterStrategy: W, tipSection: v, subTabAriaLabels: Y, slotData: $, beatTransactions: q } = jt(V ?? ""), { instanceSlotData: a, beatTransactions: g, spendCategoryGuids: L, allAccountGuids: I, categoryName: J, displayedDateRange: f, transactionStore: Q } = kt(s, {
|
|
23
23
|
slotData: $,
|
|
24
24
|
beatTransactions: q
|
|
25
|
-
}), { common: X, insights_feed: n } = _t(), { isCopyLoaded: Z } = Tt(), [tt, x] = m(!1), [et, ot] = m(!1), E = Lt(), { dataSeries: p, chartData: b, comparisonBars: i } =
|
|
25
|
+
}), { common: X, insights_feed: n } = _t(), { isCopyLoaded: Z } = Tt(), [tt, x] = m(!1), [et, ot] = m(!1), E = Lt(), { dataSeries: p, chartData: b, comparisonBars: i } = Ft({
|
|
26
26
|
data: a?.data_series,
|
|
27
27
|
ariaLabel: e === "doubleBar" ? n?.general?.in_month_you_had_a_category_of_amount ?? "_1{month}, _2{category}: _3{amount}" : Bt,
|
|
28
28
|
top: e,
|
|
29
29
|
beatTransactions: g
|
|
30
|
-
}), d = e === "doubleBar", at = e === "tabsOnly", l = d ? i : b, { chartBarIndex: R, subTabIndex: nt } =
|
|
30
|
+
}), d = e === "doubleBar", at = e === "tabsOnly", l = d ? i : b, { chartBarIndex: R, subTabIndex: nt } = Ot({
|
|
31
31
|
chartTabCount: b.length,
|
|
32
32
|
comparisonTabCount: i.length,
|
|
33
33
|
actionDrawer: B,
|
|
@@ -46,7 +46,7 @@ var ge = Mt(({ beat: s }) => {
|
|
|
46
46
|
spendCategoryGuids: L,
|
|
47
47
|
displayedDateRange: f
|
|
48
48
|
}), it = g.map((t) => t.guid).join(","), lt = L.join(","), ct = I.join(","), dt = e === "list" || e === "tabsOnly" || e === "monthTabs" || p.length > 0, j = () => {
|
|
49
|
-
u !== "store" || !dt || Q.setFilter(
|
|
49
|
+
u !== "store" || !dt || Q.setFilter(wt(C(o), {
|
|
50
50
|
allAccountGuids: I,
|
|
51
51
|
displayedDateRange: f
|
|
52
52
|
}));
|
|
@@ -66,14 +66,14 @@ var ge = Mt(({ beat: s }) => {
|
|
|
66
66
|
it,
|
|
67
67
|
e
|
|
68
68
|
]);
|
|
69
|
-
const F =
|
|
69
|
+
const F = Gt(c), y = z?.({
|
|
70
70
|
title: c?.title,
|
|
71
71
|
subHeader: F,
|
|
72
72
|
categoryName: J,
|
|
73
73
|
selectedDate: b[o]?.date ?? void 0
|
|
74
74
|
}), G = U(D, a?.category_guid);
|
|
75
75
|
if (!Z) return /* @__PURE__ */ r(Dt, {});
|
|
76
|
-
const [H, w] = a?.legends ?? [], mt = u === "local" ? (t) => C(t).custom ?? (() => !0) : void 0, { transactions: ut, projectedTransaction: A } =
|
|
76
|
+
const [H, w] = a?.legends ?? [], mt = u === "local" ? (t) => C(t).custom ?? (() => !0) : void 0, { transactions: ut, projectedTransaction: A } = Ht(g), gt = u === "local" ? ut : void 0, k = n.general.projected_amount, pt = A && k && C(o).custom?.(A) ? {
|
|
77
77
|
heading: k,
|
|
78
78
|
transaction: A
|
|
79
79
|
} : void 0, N = (t, h) => {
|
|
@@ -116,7 +116,7 @@ var ge = Mt(({ beat: s }) => {
|
|
|
116
116
|
selectedTabIndex: o,
|
|
117
117
|
trendAmountLabel: w?.label ?? n.general.trend
|
|
118
118
|
}) : /* @__PURE__ */ r(vt, {}) : null;
|
|
119
|
-
return /* @__PURE__ */ Vt(Pt, { children: [/* @__PURE__ */ r(
|
|
119
|
+
return /* @__PURE__ */ Vt(Pt, { children: [/* @__PURE__ */ r(Rt, {
|
|
120
120
|
baseTransactions: gt,
|
|
121
121
|
projectedRow: pt,
|
|
122
122
|
heading: y?.heading,
|
package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useInsightsV2Store as d, useTransactionStore as f } from "../../../common/context/hooks.es.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { getDynamicCtaBasedOnTriggers as g } from "../util.es.js";
|
|
3
|
+
import { getDrillDownConfig as m, guidListOf as p } from "./utils.es.js";
|
|
4
4
|
import l from "react";
|
|
5
5
|
var w = ({ beat: t }) => {
|
|
6
6
|
const { isTransactionDataLoaded: o, loadMissingTransactionData: s, loadTransactionsByGuids: n } = f(), { actionDrawer: r } = d();
|
|
7
7
|
l.useEffect(() => {
|
|
8
|
-
const a = t?.insights_payload, c =
|
|
8
|
+
const a = t?.insights_payload, c = g(r, a?.primary_cta, a?.secondary_cta, a?.in_description_cta)?.variant, { fetchMissingTransactions: e } = m(c ?? ""), i = p(e?.(t));
|
|
9
9
|
(async () => (o || await s(), i && await n(i)))();
|
|
10
10
|
}, []);
|
|
11
11
|
};
|
|
@@ -1,95 +1,128 @@
|
|
|
1
|
-
import { useCategoryStore as
|
|
2
|
-
import { slot as
|
|
3
|
-
import { formatCurrency as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
1
|
+
import { useCategoryStore as F, useGlobalCopyStore as M, useGlobalStore as Z } from "../../../../common/context/hooks.es.js";
|
|
2
|
+
import { slot as a } from "../../../../core/types/Insights.es.js";
|
|
3
|
+
import { formatCurrency as h } from "../../../../core/utils/NumberFormatting.es.js";
|
|
4
|
+
import { useBeatActions as $ } from "../../../beatActions.es.js";
|
|
5
|
+
import { USER_RESPONSE as j, repeatingTransactionOf as D } from "../../../ctaActions/subscriptionAnswer.es.js";
|
|
6
|
+
import { logoFromRef as H } from "../../../components/shared/EntityLogo.es.js";
|
|
7
|
+
import P from "../../../components/LogoFromGuid.es.js";
|
|
8
|
+
import { statusIconName as V, statusIconPalette as x } from "../../../components/statusIcon.es.js";
|
|
9
|
+
import { resolveVariantConfig as q } from "../../resolveVariantConfig.es.js";
|
|
10
|
+
import U from "../../../components/TransactionListCard.es.js";
|
|
11
|
+
import W from "../../../components/StatusMessageCard.es.js";
|
|
12
|
+
import { subscriptionFrequency as Y } from "../../../components/SubscriptionStatus/subscriptionFrequency.es.js";
|
|
13
|
+
import { getLayoutConfig as J, transactionBlockVariant as K } from "./layout.es.js";
|
|
14
|
+
import { observer as Q } from "mobx-react-lite";
|
|
15
|
+
import { CategoryIcon as X, InstitutionLogo as tt, MerchantLogo as ot } from "@mxenabled/mxui";
|
|
16
|
+
import { Icon as b } from "@mxenabled/mx-icons";
|
|
13
17
|
import { jsx as o } from "react/jsx-runtime";
|
|
14
|
-
import { useTheme as
|
|
15
|
-
import
|
|
16
|
-
var
|
|
17
|
-
const
|
|
18
|
+
import { useTheme as rt } from "@mui/material/styles";
|
|
19
|
+
import u from "@mui/material/Box";
|
|
20
|
+
var s = 32, et = Math.round(s * 0.625), nt = 20, v = 32, it = 20, at = ({ icon: e }) => {
|
|
21
|
+
const n = V(e?.guid);
|
|
22
|
+
return n ? /* @__PURE__ */ o(u, {
|
|
23
|
+
"aria-hidden": !0,
|
|
24
|
+
"data-icon": n,
|
|
25
|
+
"data-testid": "subscription-badge",
|
|
26
|
+
sx: {
|
|
27
|
+
alignItems: "center",
|
|
28
|
+
bgcolor: `${x(e?.color)}.main`,
|
|
29
|
+
borderRadius: "50%",
|
|
30
|
+
display: "flex",
|
|
31
|
+
height: v,
|
|
32
|
+
justifyContent: "center",
|
|
33
|
+
width: v
|
|
34
|
+
},
|
|
35
|
+
children: /* @__PURE__ */ o(b, {
|
|
36
|
+
fill: !0,
|
|
37
|
+
name: n,
|
|
38
|
+
size: it,
|
|
39
|
+
sx: { color: `${x(e?.color)}.contrastText` }
|
|
40
|
+
})
|
|
41
|
+
}) : null;
|
|
42
|
+
}, st = (e, n) => {
|
|
43
|
+
const t = H(e.logo, e.primary_text);
|
|
18
44
|
if (t) {
|
|
19
|
-
if (t.logo_name) return /* @__PURE__ */ o(
|
|
45
|
+
if (t.logo_name) return /* @__PURE__ */ o(u, {
|
|
20
46
|
sx: {
|
|
21
47
|
alignItems: "center",
|
|
22
48
|
display: "flex",
|
|
23
|
-
height:
|
|
49
|
+
height: s,
|
|
24
50
|
justifyContent: "center",
|
|
25
|
-
width:
|
|
51
|
+
width: s
|
|
26
52
|
},
|
|
27
|
-
children: /* @__PURE__ */ o(
|
|
53
|
+
children: /* @__PURE__ */ o(b, {
|
|
28
54
|
name: t.logo_name,
|
|
29
|
-
size:
|
|
55
|
+
size: et,
|
|
30
56
|
sx: { color: t.logo_color }
|
|
31
57
|
})
|
|
32
58
|
});
|
|
33
|
-
if (t.merchant_guid) return /* @__PURE__ */ o(
|
|
59
|
+
if (t.merchant_guid) return /* @__PURE__ */ o(ot, {
|
|
34
60
|
alt: t.merchant_name ?? "",
|
|
35
|
-
categoryGuid: t.category_guid ?
|
|
61
|
+
categoryGuid: t.category_guid ? n(t.category_guid) : "",
|
|
36
62
|
merchantGuid: t.merchant_guid,
|
|
37
|
-
size:
|
|
63
|
+
size: s
|
|
38
64
|
});
|
|
39
|
-
if (t.institution_guid) return /* @__PURE__ */ o(
|
|
65
|
+
if (t.institution_guid) return /* @__PURE__ */ o(tt, {
|
|
40
66
|
alt: t.institution_name ?? "",
|
|
41
67
|
institutionGuid: t.institution_guid,
|
|
42
|
-
size:
|
|
68
|
+
size: s
|
|
43
69
|
});
|
|
44
70
|
if (t.category_guid) {
|
|
45
|
-
const
|
|
46
|
-
return /* @__PURE__ */ o(
|
|
47
|
-
"data-testid": `category-icon-${
|
|
71
|
+
const c = n(t.category_guid);
|
|
72
|
+
return /* @__PURE__ */ o(u, {
|
|
73
|
+
"data-testid": `category-icon-${c}`,
|
|
48
74
|
sx: { display: "flex" },
|
|
49
|
-
children: /* @__PURE__ */ o(
|
|
50
|
-
categoryGuid:
|
|
51
|
-
size:
|
|
75
|
+
children: /* @__PURE__ */ o(X, {
|
|
76
|
+
categoryGuid: c,
|
|
77
|
+
size: s
|
|
52
78
|
})
|
|
53
79
|
});
|
|
54
80
|
}
|
|
55
81
|
}
|
|
56
|
-
},
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
82
|
+
}, Tt = Q(({ payload: e }) => {
|
|
83
|
+
const n = rt(), { getTopLevelCategoryGuid: t } = F(), c = Z(), { recurring: I } = M(), { beat: g } = $(), { data: i, variant: S } = e.instance_slot, { answeredBackground: l, background: C, cardVariant: G, elevated: E, followsSubscription: f, showFooter: T, sx: B, showHeader: L, statusMessage: O } = q(J(n), S, K.NoHeader, "TransactionBlock"), m = f && g ? g : void 0, p = m ? D({
|
|
84
|
+
beat: m,
|
|
85
|
+
stores: c
|
|
86
|
+
}) : void 0, _ = p?.user_response === j.CONFIRMED;
|
|
87
|
+
if (O) {
|
|
88
|
+
const r = a(i, "message");
|
|
89
|
+
return typeof r != "string" || !r.trim() ? (console.warn("[TransactionBlock] status_message has no message — rendering nothing."), null) : /* @__PURE__ */ o(W, {
|
|
90
|
+
icon: /* @__PURE__ */ o(u, {
|
|
62
91
|
"aria-hidden": "true",
|
|
63
92
|
sx: { display: "flex" },
|
|
64
|
-
children: /* @__PURE__ */ o(
|
|
65
|
-
logo: i
|
|
66
|
-
size:
|
|
93
|
+
children: /* @__PURE__ */ o(P, {
|
|
94
|
+
logo: a(i, "icon"),
|
|
95
|
+
size: nt
|
|
67
96
|
})
|
|
68
97
|
}),
|
|
69
|
-
message:
|
|
98
|
+
message: r
|
|
70
99
|
});
|
|
71
100
|
}
|
|
72
|
-
const
|
|
73
|
-
if (!Array.isArray(
|
|
74
|
-
const
|
|
75
|
-
label:
|
|
76
|
-
amount:
|
|
77
|
-
} : void 0;
|
|
78
|
-
return /* @__PURE__ */ o(
|
|
79
|
-
background:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
101
|
+
const d = a(i, "series"), y = a(i, "header_text");
|
|
102
|
+
if (!Array.isArray(d) || !d.length) return null;
|
|
103
|
+
const k = L && typeof y == "string" ? y : void 0, R = a(i, "footer_text"), A = a(i, "footer_amount"), z = T ? {
|
|
104
|
+
label: R,
|
|
105
|
+
amount: h(A, "0,0.00")
|
|
106
|
+
} : void 0, N = m ? Y(I, p) : void 0, w = f ? /* @__PURE__ */ o(at, { icon: a(i, _ ? "reviewed_icon" : "icon") }) : void 0;
|
|
107
|
+
return /* @__PURE__ */ o(U, {
|
|
108
|
+
background: _ && l ? l : C,
|
|
109
|
+
badge: w,
|
|
110
|
+
elevated: E,
|
|
111
|
+
footer: z,
|
|
112
|
+
header: k,
|
|
113
|
+
sx: B,
|
|
114
|
+
variant: G,
|
|
115
|
+
rows: d.map((r) => ({
|
|
116
|
+
amount: typeof r.amount == "number" ? h(r.amount, "0,0.00") : "",
|
|
117
|
+
amountCaption: N,
|
|
118
|
+
leading: st(r, t),
|
|
119
|
+
subtitle: r.secondary_text ?? "",
|
|
120
|
+
title: r.primary_text ?? ""
|
|
88
121
|
}))
|
|
89
122
|
});
|
|
90
123
|
});
|
|
91
124
|
export {
|
|
92
|
-
|
|
125
|
+
Tt as TransactionBlock
|
|
93
126
|
};
|
|
94
127
|
|
|
95
128
|
//# sourceMappingURL=TransactionBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport { useTheme } from '@mui/material/styles'\n\nimport { CategoryIcon, InstitutionLogo, MerchantLogo } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { useCategoryStore } from '../../../../common'\nimport { slot } from '../../../../core'\nimport type { InsightsPayload, InstanceSlotRow, LogoRef } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport StatusMessageCard from '../../../components/StatusMessageCard'\nimport TransactionListCard from '../../../components/TransactionListCard'\nimport { logoFromRef } from '../../../components/shared/EntityLogo'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { getLayoutConfig, transactionBlockVariant } from './layout'\n\ninterface TransactionBlockProps {\n payload: InsightsPayload\n beatGuid?: string\n}\n\nconst ROW_LOGO_SIZE = 32\n// Same glyph-to-tile ratio mxui's `CategoryIcon` uses, so a status icon sits like the other logos.\nconst ROW_ICON_SIZE = Math.round(ROW_LOGO_SIZE * 0.625)\nconst STATUS_ICON_SIZE = 20\n\n/**\n * Renders the row's leading logo from its `LogoRef`: a status icon, or an entity guid whose prefix\n * names the entity. An unrecognized prefix renders no logo rather than guessing.\n *\n * `resolveTopLevelCategory`: mxui's `CategoryIcon` only knows the top-level category guids and\n * silently falls back to the Uncategorized icon for a sub-category. The details drawer avoids\n * this by passing `transaction.top_level_category_guid`; the row only has the raw guid, so it is\n * walked up to its parent here (identity until categories load). That applies both to a `CAT-`\n * row logo and to a merchant's `fallback_guid`, which `MerchantLogo` draws through the same\n * `CategoryIcon` when the merchant image fails to load.\n */\nconst renderRowLogo = (row: InstanceSlotRow, resolveTopLevelCategory: (guid: string) => string) => {\n const logo = logoFromRef(row.logo, row.primary_text)\n\n if (!logo) return undefined\n\n if (logo.logo_name) {\n // A fixed box the size of the other logos keeps the row's text column aligned.\n return (\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n height: ROW_LOGO_SIZE,\n justifyContent: 'center',\n width: ROW_LOGO_SIZE,\n }}\n >\n <Icon name={logo.logo_name} size={ROW_ICON_SIZE} sx={{ color: logo.logo_color }} />\n </Box>\n )\n }\n\n if (logo.merchant_guid) {\n return (\n <MerchantLogo\n alt={logo.merchant_name ?? ''}\n categoryGuid={logo.category_guid ? resolveTopLevelCategory(logo.category_guid) : ''}\n merchantGuid={logo.merchant_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.institution_guid) {\n return (\n <InstitutionLogo\n alt={logo.institution_name ?? ''}\n institutionGuid={logo.institution_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.category_guid) {\n const topLevelGuid = resolveTopLevelCategory(logo.category_guid)\n return (\n <Box data-testid={`category-icon-${topLevelGuid}`} sx={{ display: 'flex' }}>\n <CategoryIcon categoryGuid={topLevelGuid} size={ROW_LOGO_SIZE} />\n </Box>\n )\n }\n\n return undefined\n}\n\n/**\n * The `transaction_block`: rows the backend already localized, carried inline on\n * `instance_slot.data.series` (`logo`, `primary_text`, `secondary_text`, `amount`). Only the\n * amount is formatted here, because the contract sends it as a number. `instance_slot.variant`\n * picks the header and slot treatment from `./layout.ts`.\n *\n * This is the full/mini shape. The reduced widgets (micro, embedded) resolve to the row logo\n * alone, carried flat on `data.logo` with no `series`, and are drawn by `CompactInsightCard`.\n *\n * `status_message` draws no rows: `data.message` beside the `data.icon` logo, as a\n * `StatusMessageCard` banner (Uncategorized Transactions V2 `complete`).\n *\n * A header, when the variant shows one, comes from `instance_slot.data.header_text` (the\n * transaction date, or \"{count} transactions\"). It deliberately does *not* come from the first\n * row: on a `with_merchant` card a row's `secondary_text` is the category, so reading it here\n * rendered the category twice and dropped the date entirely.\n *\n * A footer/summary row (Replenish Savings' \"Remaining Balance\") renders under the\n * `with_header_footer` variant, from `data.footer_text` with `data.footer_amount` beside it,\n * formatted like the row amounts (the contract sends it as a number).\n */\nexport const TransactionBlock = observer(({ payload }: TransactionBlockProps) => {\n const theme = useTheme()\n const { getTopLevelCategoryGuid } = useCategoryStore()\n const { data, variant } = payload.instance_slot\n // The plain row is the safe default: it adds nothing a wrong variant could misstate.\n const { background, cardVariant, showFooter, showHeader, statusMessage } = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n transactionBlockVariant.NoHeader,\n 'TransactionBlock',\n )\n\n if (statusMessage) {\n const message = slot<string>(data, 'message')\n if (typeof message !== 'string' || !message.trim()) {\n console.warn('[TransactionBlock] status_message has no message — rendering nothing.')\n return null\n }\n\n // The icon only decorates the message, so it is hidden from the status announcement.\n return (\n <StatusMessageCard\n icon={\n <Box aria-hidden=\"true\" sx={{ display: 'flex' }}>\n <LogoFromGuid logo={slot<LogoRef>(data, 'icon')} size={STATUS_ICON_SIZE} />\n </Box>\n }\n message={message}\n />\n )\n }\n\n const series = slot<InstanceSlotRow[]>(data, 'series')\n const headerText = slot<string>(data, 'header_text')\n\n if (!Array.isArray(series) || !series.length) return null\n\n const header = showHeader && typeof headerText === 'string' ? headerText : undefined\n\n const footerText = slot<string>(data, 'footer_text')\n const footerAmount = slot<number>(data, 'footer_amount')\n const footer = showFooter\n ? {\n label: footerText,\n amount: formatCurrency(footerAmount, '0,0.00'),\n }\n : undefined\n\n return (\n <TransactionListCard\n background={background}\n footer={footer}\n header={header}\n variant={cardVariant}\n rows={series.map((row) => ({\n amount: typeof row.amount === 'number' ? formatCurrency(row.amount, '0,0.00') : '',\n leading: renderRowLogo(row, getTopLevelCategoryGuid),\n subtitle: row.secondary_text ?? '',\n title: row.primary_text ?? '',\n }))}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;AA0BA,IAAM,IAAgB,IAEhB,IAAgB,KAAK,MAAM,IAAgB,KAAK,GAChD,IAAmB,IAanB,IAAA,CAAiB,GAAsB,MAAsD;AACjG,QAAM,IAAO,EAAY,EAAI,MAAM,EAAI,YAAY;AAEnD,MAAK,GAEL;AAAA,QAAI,EAAK,UAEP,QACE,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,YAAY;AAAA,QACZ,SAAS;AAAA,QACT,QAAQ;AAAA,QACR,gBAAgB;AAAA,QAChB,OAAO;AAAA,MACT;AAAA,MAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAM,EAAK;AAAA,QAAW,MAAM;AAAA,QAAe,IAAI,EAAE,OAAO,EAAK,WAAW;AAAA,MAAI,CAAA;AAAA,IAC/E,CAAA;AAIT,QAAI,EAAK,cACP,QACE,gBAAA,EAAC,GAAD;AAAA,MACE,KAAK,EAAK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AAAA,MACvE,CAAA;AAAA,MAEE,SAAA;AAAA,IACV,CAAA;AAAA,EAEL;AAEA,QAAM,IAAS,EAAwB,GAAM,QAAQ,GAC/C,IAAa,EAAa,GAAM,aAAa;AAEnD,MAAI,CAAC,MAAM,QAAQ,CAAM,KAAK,CAAC,EAAO,OAAQ,QAAO;AAErD,QAAM,IAAS,KAAc,OAAO,KAAe,WAAW,IAAa,QAErE,IAAa,EAAa,GAAM,aAAa,GAC7C,IAAe,EAAa,GAAM,eAAe,GACjD,IAAS,IACX;AAAA,IACE,OAAO;AAAA,IACP,QAAQ,EAAe,GAAc,QAAQ;AAAA,EAC/C,IACA;AAEJ,SACE,gBAAA,EAAC,GAAD;AAAA,IACc,YAAA;AAAA,IACJ,QAAA;AAAA,IACA,QAAA;AAAA,IACR,SAAS;AAAA,IACT,MAAM,EAAO,IAAA,CAAK,OAAS;AAAA,MACzB,QAAQ,OAAO,EAAI,UAAW,WAAW,EAAe,EAAI,QAAQ,QAAQ,IAAI;AAAA,MAChF,SAAS,EAAc,GAAK,CAAuB;AAAA,MACnD,UAAU,EAAI,kBAAkB;AAAA,MAChC,OAAO,EAAI,gBAAgB;AAAA,IAC7B,EAAE;AAAA,EACH,CAAA;AAEL,CAAC"}
|
|
1
|
+
{"version":3,"file":"TransactionBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport { useTheme } from '@mui/material/styles'\n\nimport { CategoryIcon, InstitutionLogo, MerchantLogo } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { useCategoryStore, useGlobalCopyStore, useGlobalStore } from '../../../../common'\nimport { slot } from '../../../../core'\nimport type { InsightsPayload, InstanceSlotRow, LogoRef } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport { useBeatActions } from '../../../beatActions'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport StatusMessageCard from '../../../components/StatusMessageCard'\nimport TransactionListCard from '../../../components/TransactionListCard'\nimport { logoFromRef } from '../../../components/shared/EntityLogo'\nimport { statusIconName, statusIconPalette } from '../../../components/statusIcon'\nimport { subscriptionFrequency } from '../../../components/SubscriptionStatus/subscriptionFrequency'\nimport { repeatingTransactionOf, USER_RESPONSE } from '../../../ctaActions/subscriptionAnswer'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { getLayoutConfig, transactionBlockVariant } from './layout'\n\ninterface TransactionBlockProps {\n payload: InsightsPayload\n beatGuid?: string\n}\n\nconst ROW_LOGO_SIZE = 32\n// Same glyph-to-tile ratio mxui's `CategoryIcon` uses, so a status icon sits like the other logos.\nconst ROW_ICON_SIZE = Math.round(ROW_LOGO_SIZE * 0.625)\nconst STATUS_ICON_SIZE = 20\n// Status badge: palette disc, contrastText glyph.\nconst BADGE_SIZE = 32\nconst BADGE_GLYPH_SIZE = 20\n\n/** Status disc from `data.icon` / `data.reviewed_icon`. */\nconst SubscriptionBadge = ({ icon }: { icon?: LogoRef }) => {\n const name = statusIconName(icon?.guid)\n\n if (!name) return null\n\n return (\n <Box\n aria-hidden={true}\n data-icon={name}\n data-testid=\"subscription-badge\"\n sx={{\n alignItems: 'center',\n bgcolor: `${statusIconPalette(icon?.color)}.main`,\n borderRadius: '50%',\n display: 'flex',\n height: BADGE_SIZE,\n justifyContent: 'center',\n width: BADGE_SIZE,\n }}\n >\n <Icon\n fill={true}\n name={name}\n size={BADGE_GLYPH_SIZE}\n sx={{ color: `${statusIconPalette(icon?.color)}.contrastText` }}\n />\n </Box>\n )\n}\n\n/**\n * Renders the row's leading logo from its `LogoRef`: a status icon, or an entity guid whose prefix\n * names the entity. An unrecognized prefix renders no logo rather than guessing.\n *\n * `resolveTopLevelCategory`: mxui's `CategoryIcon` only knows the top-level category guids and\n * silently falls back to the Uncategorized icon for a sub-category. The details drawer avoids\n * this by passing `transaction.top_level_category_guid`; the row only has the raw guid, so it is\n * walked up to its parent here (identity until categories load). That applies both to a `CAT-`\n * row logo and to a merchant's `fallback_guid`, which `MerchantLogo` draws through the same\n * `CategoryIcon` when the merchant image fails to load.\n */\nconst renderRowLogo = (row: InstanceSlotRow, resolveTopLevelCategory: (guid: string) => string) => {\n const logo = logoFromRef(row.logo, row.primary_text)\n\n if (!logo) return undefined\n\n if (logo.logo_name) {\n // A fixed box the size of the other logos keeps the row's text column aligned.\n return (\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n height: ROW_LOGO_SIZE,\n justifyContent: 'center',\n width: ROW_LOGO_SIZE,\n }}\n >\n <Icon name={logo.logo_name} size={ROW_ICON_SIZE} sx={{ color: logo.logo_color }} />\n </Box>\n )\n }\n\n if (logo.merchant_guid) {\n return (\n <MerchantLogo\n alt={logo.merchant_name ?? ''}\n categoryGuid={logo.category_guid ? resolveTopLevelCategory(logo.category_guid) : ''}\n merchantGuid={logo.merchant_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.institution_guid) {\n return (\n <InstitutionLogo\n alt={logo.institution_name ?? ''}\n institutionGuid={logo.institution_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.category_guid) {\n const topLevelGuid = resolveTopLevelCategory(logo.category_guid)\n return (\n <Box data-testid={`category-icon-${topLevelGuid}`} sx={{ display: 'flex' }}>\n <CategoryIcon categoryGuid={topLevelGuid} size={ROW_LOGO_SIZE} />\n </Box>\n )\n }\n\n return undefined\n}\n\n/**\n * The `transaction_block`: rows the backend already localized, carried inline on\n * `instance_slot.data.series` (`logo`, `primary_text`, `secondary_text`, `amount`). Only the\n * amount is formatted here, because the contract sends it as a number. `instance_slot.variant`\n * picks the header and slot treatment from `./layout.ts`.\n *\n * This is the full/mini shape. The reduced widgets (micro, embedded) resolve to the row logo\n * alone, carried flat on `data.logo` with no `series`, and are drawn by `CompactInsightCard`.\n *\n * `status_message` draws no rows: `data.message` beside the `data.icon` logo, as a\n * `StatusMessageCard` banner (Uncategorized Transactions V2 `complete`).\n *\n * A header, when the variant shows one, comes from `instance_slot.data.header_text` (the\n * transaction date, or \"{count} transactions\"). It deliberately does *not* come from the first\n * row: on a `with_merchant` card a row's `secondary_text` is the category, so reading it here\n * rendered the category twice and dropped the date entirely.\n *\n * A footer/summary row (Replenish Savings' \"Remaining Balance\") renders under the\n * `with_header_footer` variant, from `data.footer_text` with `data.footer_amount` beside it,\n * formatted like the row amounts (the contract sends it as a number).\n */\nexport const TransactionBlock = observer(({ payload }: TransactionBlockProps) => {\n const theme = useTheme()\n const { getTopLevelCategoryGuid } = useCategoryStore()\n const stores = useGlobalStore()\n const { recurring: recurringCopy } = useGlobalCopyStore()\n const { beat } = useBeatActions()\n const { data, variant } = payload.instance_slot\n // The plain row is the safe default: it adds nothing a wrong variant could misstate.\n const {\n answeredBackground,\n background,\n cardVariant,\n elevated,\n followsSubscription,\n showFooter,\n sx,\n showHeader,\n statusMessage,\n } = resolveVariantConfig(\n getLayoutConfig(theme),\n variant,\n transactionBlockVariant.NoHeader,\n 'TransactionBlock',\n )\n\n // Follows the live repeating transaction (read-only).\n const tracked = followsSubscription && beat ? beat : undefined\n const repeating = tracked ? repeatingTransactionOf({ beat: tracked, stores }) : undefined\n const subscribed = repeating?.user_response === USER_RESPONSE.CONFIRMED\n\n if (statusMessage) {\n const message = slot<string>(data, 'message')\n if (typeof message !== 'string' || !message.trim()) {\n console.warn('[TransactionBlock] status_message has no message — rendering nothing.')\n return null\n }\n\n // The icon only decorates the message, so it is hidden from the status announcement.\n return (\n <StatusMessageCard\n icon={\n <Box aria-hidden=\"true\" sx={{ display: 'flex' }}>\n <LogoFromGuid logo={slot<LogoRef>(data, 'icon')} size={STATUS_ICON_SIZE} />\n </Box>\n }\n message={message}\n />\n )\n }\n\n const series = slot<InstanceSlotRow[]>(data, 'series')\n const headerText = slot<string>(data, 'header_text')\n\n if (!Array.isArray(series) || !series.length) return null\n\n const header = showHeader && typeof headerText === 'string' ? headerText : undefined\n\n const footerText = slot<string>(data, 'footer_text')\n const footerAmount = slot<number>(data, 'footer_amount')\n const footer = showFooter\n ? {\n label: footerText,\n amount: formatCurrency(footerAmount, '0,0.00'),\n }\n : undefined\n\n const frequency = tracked ? subscriptionFrequency(recurringCopy, repeating) : undefined\n const badge = followsSubscription ? (\n <SubscriptionBadge icon={slot<LogoRef>(data, subscribed ? 'reviewed_icon' : 'icon')} />\n ) : undefined\n\n return (\n <TransactionListCard\n background={subscribed && answeredBackground ? answeredBackground : background}\n badge={badge}\n elevated={elevated}\n footer={footer}\n header={header}\n sx={sx}\n variant={cardVariant}\n rows={series.map((row) => ({\n amount: typeof row.amount === 'number' ? formatCurrency(row.amount, '0,0.00') : '',\n amountCaption: frequency,\n leading: renderRowLogo(row, getTopLevelCategoryGuid),\n subtitle: row.secondary_text ?? '',\n title: row.primary_text ?? '',\n }))}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA8BA,IAAM,IAAgB,IAEhB,KAAgB,KAAK,MAAM,IAAgB,KAAK,GAChD,KAAmB,IAEnB,IAAa,IACb,KAAmB,IAGnB,KAAA,CAAqB,EAAE,MAAA,EAAA,MAA+B;AAC1D,QAAM,IAAO,EAAe,GAAM,IAAI;AAEtC,SAAK,IAGH,gBAAA,EAAC,GAAD;AAAA,IACE,eAAa;AAAA,IACb,aAAW;AAAA,IACX,eAAY;AAAA,IACZ,IAAI;AAAA,MACF,YAAY;AAAA,MACZ,SAAS,GAAG,EAAkB,GAAM,KAAK,CAAA;AAAA,MACzC,cAAc;AAAA,MACd,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,OAAO;AAAA,IACT;AAAA,IAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,MAAM;AAAA,MACA,MAAA;AAAA,MACN,MAAM;AAAA,MACN,IAAI,EAAE,OAAO,GAAG,EAAkB,GAAM,KAAK,CAAA,gBAAiB;AAAA,IAC/D,CAAA;AA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AsB,GAAe,CAAS,IAAI,QACxE,IAAQ,IACZ,gBAAA,EAAC,IAAD,EAAmB,MAAM,EAAc,GAAM,IAAa,kBAAkB,MAAM,EAAI,CAAA,IACpF;AAEJ,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,YAAY,KAAc,IAAqB,IAAqB;AAAA,IAC7D,OAAA;AAAA,IACG,UAAA;AAAA,IACF,QAAA;AAAA,IACA,QAAA;AAAA,IACJ,IAAA;AAAA,IACJ,SAAS;AAAA,IACT,MAAM,EAAO,IAAA,CAAK,OAAS;AAAA,MACzB,QAAQ,OAAO,EAAI,UAAW,WAAW,EAAe,EAAI,QAAQ,QAAQ,IAAI;AAAA,MAChF,eAAe;AAAA,MACf,SAAS,GAAc,GAAK,CAAuB;AAAA,MACnD,UAAU,EAAI,kBAAkB;AAAA,MAChC,OAAO,EAAI,gBAAgB;AAAA,IAC7B,EAAE;AAAA,EACH,CAAA;AAEL,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Theme } from '@mui/material/styles';
|
|
1
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
2
2
|
/**
|
|
3
3
|
* Transaction block variants, keyed by the backend `instance_slot.variant`. All render the same
|
|
4
4
|
* pre-localized rows through `TransactionListCard`; only the header and the slot differ.
|
|
@@ -35,6 +35,14 @@ export interface TransactionLayoutConfig {
|
|
|
35
35
|
background?: string;
|
|
36
36
|
/** Render `data.message` as a `StatusMessageCard` banner instead of the rows. */
|
|
37
37
|
statusMessage?: boolean;
|
|
38
|
+
/** Frequency, badge and answered wash from the live repeating transaction. */
|
|
39
|
+
followsSubscription?: boolean;
|
|
40
|
+
/** Wash once subscribed. */
|
|
41
|
+
answeredBackground?: string;
|
|
42
|
+
/** The rows' card on the wash gets `elevation/1` (needs `background`). */
|
|
43
|
+
elevated?: boolean;
|
|
44
|
+
/** Slot padding override (CSS shorthand). */
|
|
45
|
+
sx?: SxProps;
|
|
38
46
|
}
|
|
39
47
|
/** Per-variant `TransactionListCard` props (mirrors DetailedAccountBlock's `getLayoutConfig`). */
|
|
40
48
|
export declare const getLayoutConfig: (theme: Theme) => Record<TransactionBlockVariant, TransactionLayoutConfig>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WARM_LIME_ACCENT_GRADIENT as r, WARNING_WASH_GRADIENT as t, getPrimaryWashGradient as o } from "../../../components/celebrationGradients.es.js";
|
|
2
2
|
var e = {
|
|
3
3
|
WithHeader: "with_header",
|
|
4
4
|
WithHeaderFooter: "with_header_footer",
|
|
@@ -7,7 +7,7 @@ var e = {
|
|
|
7
7
|
InfoWash: "info_wash",
|
|
8
8
|
WarningWash: "warning_wash",
|
|
9
9
|
StatusMessage: "status_message"
|
|
10
|
-
},
|
|
10
|
+
}, n = (a) => ({
|
|
11
11
|
[e.WithHeader]: { showHeader: !0 },
|
|
12
12
|
[e.WithHeaderFooter]: {
|
|
13
13
|
showHeader: !0,
|
|
@@ -20,11 +20,15 @@ var e = {
|
|
|
20
20
|
},
|
|
21
21
|
[e.InfoWash]: {
|
|
22
22
|
showHeader: !1,
|
|
23
|
-
background:
|
|
23
|
+
background: o(a)
|
|
24
24
|
},
|
|
25
25
|
[e.WarningWash]: {
|
|
26
26
|
showHeader: !1,
|
|
27
|
-
background:
|
|
27
|
+
background: t,
|
|
28
|
+
followsSubscription: !0,
|
|
29
|
+
answeredBackground: r,
|
|
30
|
+
elevated: !0,
|
|
31
|
+
sx: { p: "28px 24px 24px 32px" }
|
|
28
32
|
},
|
|
29
33
|
[e.StatusMessage]: {
|
|
30
34
|
showHeader: !1,
|
|
@@ -32,7 +36,7 @@ var e = {
|
|
|
32
36
|
}
|
|
33
37
|
});
|
|
34
38
|
export {
|
|
35
|
-
|
|
39
|
+
n as getLayoutConfig,
|
|
36
40
|
e as transactionBlockVariant
|
|
37
41
|
};
|
|
38
42
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.ts"],"sourcesContent":["import type { Theme } from '@mui/material/styles'\n\nimport {\n WARNING_WASH_GRADIENT,\n getPrimaryWashGradient,\n} from '../../../components/celebrationGradients'\n\n/**\n * Transaction block variants, keyed by the backend `instance_slot.variant`. All render the same\n * pre-localized rows through `TransactionListCard`; only the header and the slot differ.\n *\n * - `WithHeader` — row under a date header (Fee Detected, Large Transaction).\n * - `WithHeaderFooter` — date header above the rows plus the footer/summary row from\n * `data.footer_text` / `data.footer_amount` (Replenish Savings' \"Remaining Balance\").\n * - `NoHeader` — the row alone (Large Transaction without a merchant).\n * - `UncategorizedTransaction` — filled primary header (\"{count} transactions\").\n * - `InfoWash` — borderless row on the blue slot wash (e.g. Subscription Detected).\n * - `WarningWash` — borderless row on the warning slot wash (e.g. Unexpected\n * Subscription Payment). Treatment names, not beat names, so any beat can reuse the wash.\n * - `StatusMessage` — no rows: an icon + message banner from `data.icon` / `data.message`\n * (Uncategorized Transactions V2 `complete`, \"All Categorized!\").\n */\nexport const transactionBlockVariant = {\n WithHeader: 'with_header',\n WithHeaderFooter: 'with_header_footer',\n NoHeader: 'no_header',\n UncategorizedTransaction: 'uncategorized_transaction',\n InfoWash: 'info_wash',\n WarningWash: 'warning_wash',\n StatusMessage: 'status_message',\n} as const\n\nexport type TransactionBlockVariant =\n (typeof transactionBlockVariant)[keyof typeof transactionBlockVariant]\n\nexport interface TransactionLayoutConfig {\n /** Show `instance_slot.data.header_text` above the rows. */\n showHeader: boolean\n /** Show the `data.footer_text` / `data.footer_amount` summary row beneath the rows. */\n showFooter?: boolean\n /** `TransactionListCard` style: grey utility header, or filled primary header. */\n cardVariant?: 'default' | 'primary'\n /** CSS background for the slot behind the card; the card then renders borderless on paper. */\n background?: string\n /** Render `data.message` as a `StatusMessageCard` banner instead of the rows. */\n statusMessage?: boolean\n}\n\n/** Per-variant `TransactionListCard` props (mirrors DetailedAccountBlock's `getLayoutConfig`). */\nexport const getLayoutConfig = (\n theme: Theme,\n): Record<TransactionBlockVariant, TransactionLayoutConfig> => ({\n [transactionBlockVariant.WithHeader]: { showHeader: true },\n [transactionBlockVariant.WithHeaderFooter]: { showHeader: true, showFooter: true },\n [transactionBlockVariant.NoHeader]: { showHeader: false },\n [transactionBlockVariant.UncategorizedTransaction]: { showHeader: true, cardVariant: 'primary' },\n [transactionBlockVariant.InfoWash]: {\n showHeader: false,\n background: getPrimaryWashGradient(theme),\n },\n [transactionBlockVariant.WarningWash]: {\n showHeader: false,\n background: WARNING_WASH_GRADIENT,\n },\n [transactionBlockVariant.StatusMessage]: { showHeader: false, statusMessage: true },\n})\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.ts"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material/styles'\n\nimport {\n WARM_LIME_ACCENT_GRADIENT,\n WARNING_WASH_GRADIENT,\n getPrimaryWashGradient,\n} from '../../../components/celebrationGradients'\n\n/**\n * Transaction block variants, keyed by the backend `instance_slot.variant`. All render the same\n * pre-localized rows through `TransactionListCard`; only the header and the slot differ.\n *\n * - `WithHeader` — row under a date header (Fee Detected, Large Transaction).\n * - `WithHeaderFooter` — date header above the rows plus the footer/summary row from\n * `data.footer_text` / `data.footer_amount` (Replenish Savings' \"Remaining Balance\").\n * - `NoHeader` — the row alone (Large Transaction without a merchant).\n * - `UncategorizedTransaction` — filled primary header (\"{count} transactions\").\n * - `InfoWash` — borderless row on the blue slot wash (e.g. Subscription Detected).\n * - `WarningWash` — borderless row on the warning slot wash (e.g. Unexpected\n * Subscription Payment). Treatment names, not beat names, so any beat can reuse the wash.\n * - `StatusMessage` — no rows: an icon + message banner from `data.icon` / `data.message`\n * (Uncategorized Transactions V2 `complete`, \"All Categorized!\").\n */\nexport const transactionBlockVariant = {\n WithHeader: 'with_header',\n WithHeaderFooter: 'with_header_footer',\n NoHeader: 'no_header',\n UncategorizedTransaction: 'uncategorized_transaction',\n InfoWash: 'info_wash',\n WarningWash: 'warning_wash',\n StatusMessage: 'status_message',\n} as const\n\nexport type TransactionBlockVariant =\n (typeof transactionBlockVariant)[keyof typeof transactionBlockVariant]\n\nexport interface TransactionLayoutConfig {\n /** Show `instance_slot.data.header_text` above the rows. */\n showHeader: boolean\n /** Show the `data.footer_text` / `data.footer_amount` summary row beneath the rows. */\n showFooter?: boolean\n /** `TransactionListCard` style: grey utility header, or filled primary header. */\n cardVariant?: 'default' | 'primary'\n /** CSS background for the slot behind the card; the card then renders borderless on paper. */\n background?: string\n /** Render `data.message` as a `StatusMessageCard` banner instead of the rows. */\n statusMessage?: boolean\n /** Frequency, badge and answered wash from the live repeating transaction. */\n followsSubscription?: boolean\n /** Wash once subscribed. */\n answeredBackground?: string\n /** The rows' card on the wash gets `elevation/1` (needs `background`). */\n elevated?: boolean\n /** Slot padding override (CSS shorthand). */\n sx?: SxProps\n}\n\n/** Per-variant `TransactionListCard` props (mirrors DetailedAccountBlock's `getLayoutConfig`). */\nexport const getLayoutConfig = (\n theme: Theme,\n): Record<TransactionBlockVariant, TransactionLayoutConfig> => ({\n [transactionBlockVariant.WithHeader]: { showHeader: true },\n [transactionBlockVariant.WithHeaderFooter]: { showHeader: true, showFooter: true },\n [transactionBlockVariant.NoHeader]: { showHeader: false },\n [transactionBlockVariant.UncategorizedTransaction]: { showHeader: true, cardVariant: 'primary' },\n [transactionBlockVariant.InfoWash]: {\n showHeader: false,\n background: getPrimaryWashGradient(theme),\n },\n [transactionBlockVariant.WarningWash]: {\n showHeader: false,\n background: WARNING_WASH_GRADIENT,\n followsSubscription: true,\n // Answered wash.\n answeredBackground: WARM_LIME_ACCENT_GRADIENT,\n // Figma: the row card on the wash is elevation/1.\n elevated: true,\n // Room for the badge.\n sx: { p: '28px 24px 24px 32px' },\n },\n [transactionBlockVariant.StatusMessage]: { showHeader: false, statusMessage: true },\n})\n"],"mappings":";AAuBA,IAAa,IAA0B;AAAA,EACrC,YAAY;AAAA,EACZ,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV,0BAA0B;AAAA,EAC1B,UAAU;AAAA,EACV,aAAa;AAAA,EACb,eAAe;AACjB,GA2Ba,IAAA,CACX,OAC8D;AAAA,EAC7D,CAAA,EAAwB,UAAA,GAAa,EAAE,YAAY,GAAK;AAAA,EACxD,CAAA,EAAwB,gBAAA,GAAmB;AAAA,IAAE,YAAY;AAAA,IAAM,YAAY;AAAA,EAAK;AAAA,EAChF,CAAA,EAAwB,QAAA,GAAW,EAAE,YAAY,GAAM;AAAA,EACvD,CAAA,EAAwB,wBAAA,GAA2B;AAAA,IAAE,YAAY;AAAA,IAAM,aAAa;AAAA,EAAU;AAAA,EAC9F,CAAA,EAAwB,QAAA,GAAW;AAAA,IAClC,YAAY;AAAA,IACZ,YAAY,EAAuB,CAAK;AAAA,EAC1C;AAAA,EACC,CAAA,EAAwB,WAAA,GAAc;AAAA,IACrC,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,qBAAqB;AAAA,IAErB,oBAAoB;AAAA,IAEpB,UAAU;AAAA,IAEV,IAAI,EAAE,GAAG,sBAAsB;AAAA,EACjC;AAAA,EACC,CAAA,EAAwB,aAAA,GAAgB;AAAA,IAAE,YAAY;AAAA,IAAO,eAAe;AAAA,EAAK;AACpF"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ThemedSVGImage as f } from "../../../components/chartblocks/ThemedSVGImage.es.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { CtaStatus as p } from "../../../components/CtaStatus.es.js";
|
|
3
|
+
import { resolveVariantConfig as d } from "../../resolveVariantConfig.es.js";
|
|
4
|
+
import { getLayoutConfig as v } from "./layout.es.js";
|
|
5
5
|
import { EmergencySavingsAccountPicker as h } from "./EmergencySavingsAccountPicker.es.js";
|
|
6
6
|
import s from "@mui/material/Stack";
|
|
7
7
|
import { jsx as o, jsxs as u } from "react/jsx-runtime";
|
|
8
8
|
var V = ({ payload: { instance_slot: m, instance_slot_data: n, widget_type: t }, beatGuid: c }) => {
|
|
9
|
-
const l = t === "mini", a = t === "full", { variant: g, data: e } = m, i =
|
|
9
|
+
const l = t === "mini", a = t === "full", { variant: g, data: e } = m, i = d(v(n?.isCIBC), g, "savings", "SVGImageBlock"), r = typeof e?.saved_label == "string" ? e.saved_label.trim() : "";
|
|
10
10
|
return /* @__PURE__ */ u(s, {
|
|
11
11
|
alignItems: "center",
|
|
12
12
|
sx: { width: "100%" },
|
|
@@ -25,7 +25,7 @@ var V = ({ payload: { instance_slot: m, instance_slot_data: n, widget_type: t },
|
|
|
25
25
|
px: 16,
|
|
26
26
|
width: "100%"
|
|
27
27
|
},
|
|
28
|
-
children: /* @__PURE__ */ o(
|
|
28
|
+
children: /* @__PURE__ */ o(p, {
|
|
29
29
|
icon: "check_circle",
|
|
30
30
|
label: r,
|
|
31
31
|
tone: "success"
|
|
@@ -3,7 +3,7 @@ import r from "@mui/material/Stack";
|
|
|
3
3
|
import { Text as d } from "@mxenabled/mxui";
|
|
4
4
|
import { jsx as t, jsxs as e } from "react/jsx-runtime";
|
|
5
5
|
import i from "@mui/material/Box";
|
|
6
|
-
var v = ({ backdrop: n, backgroundImage: o, bgcolor: s = "primary.lighter", logo: p, name:
|
|
6
|
+
var v = ({ backdrop: n, backgroundImage: o, bgcolor: s = "primary.lighter", logo: p, name: x, nameVariant: c = "body2", status: a, subtitle: l, sx: h }) => /* @__PURE__ */ e(i, {
|
|
7
7
|
sx: {
|
|
8
8
|
alignItems: "center",
|
|
9
9
|
bgcolor: s,
|
|
@@ -62,10 +62,12 @@ var v = ({ backdrop: n, backgroundImage: o, bgcolor: s = "primary.lighter", logo
|
|
|
62
62
|
width: "100%"
|
|
63
63
|
},
|
|
64
64
|
children: [/* @__PURE__ */ t(d, {
|
|
65
|
-
sx: {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
sx: {
|
|
66
|
+
fontWeight: 600,
|
|
67
|
+
textAlign: "center"
|
|
68
|
+
},
|
|
69
|
+
variant: c,
|
|
70
|
+
children: x
|
|
69
71
|
}), l && /* @__PURE__ */ t(d, {
|
|
70
72
|
color: "text.secondary",
|
|
71
73
|
truncate: !0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountHeroCard.es.js","names":[],"sources":["../../../src/insights-v2/components/AccountHeroCard.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { getLogoElevation } from './logoShadow'\n\n// Figma: the logo overhangs the white card's top edge by 25px and the slot pads\n// 16px above that overhang (so `pt = overhang + 16`).\nconst LOGO_OVERHANG = 25\n\ninterface AccountHeroCardProps {\n /** Central account/institution logo, rendered overhanging the card's top edge. */\n logo: ReactNode\n /** Primary line, e.g. \"Epic Bank Checking, *1234\". */\n name: ReactNode\n /** Optional secondary line beneath the name, e.g. \"Checking Account\". */\n subtitle?: ReactNode\n /**\n * Name typography. Figma: Set Up/Switch Direct Deposit use body2 metrics\n * (13px / lh 16, default); Missing Interest Rate uses body1 (15px / lh 20).\n * Both render at weight 600.\n */\n nameVariant?: 'body1' | 'body2'\n /** Status element beneath the text (e.g. a `<StatusPill>`). */\n status?: ReactNode\n /** Decorative backdrop behind the card (e.g. a `<Confetti>` burst). */\n backdrop?: ReactNode\n /** Slot surface color token. Default `primary.lighter` (Figma's tinted slot,\n * theme-aware: light-blue in light mode, navy in dark). */\n bgcolor?: string\n /**\n * Optional decorative wash layered over `bgcolor` (e.g. a celebration\n * gradient). Figma's gradient is ~20% opacity over a white base, so this is a\n * `backgroundImage` on top of `bgcolor`, not a replacement — pass\n * `bgcolor=\"background.paper\"` with it for the complete state.\n */\n backgroundImage?: string\n sx?: SxProps\n}\n\n/**\n * A centered account hero: an overhanging institution logo above a white card\n * with a name, optional subtitle, and a status slot, over a tinted (or\n * gradient + confetti) slot.\n *\n * Figma: Set Up Direct Deposit (default + complete) and Switch Direct Deposit\n * (complete) Content. Scope is the Content section only.\n */\nconst AccountHeroCard = ({\n backdrop,\n backgroundImage,\n bgcolor = 'primary.lighter',\n logo,\n name,\n nameVariant = 'body2',\n status,\n subtitle,\n sx,\n}: AccountHeroCardProps) => (\n <Box\n sx={{\n alignItems: 'center',\n bgcolor,\n ...(backgroundImage && { backgroundImage }),\n display: 'flex',\n flexDirection: 'column',\n pb: 16,\n position: 'relative',\n pt: LOGO_OVERHANG + 16,\n px: 16,\n width: '100%',\n ...sx,\n }}\n >\n {backdrop && (\n <Box aria-hidden={true} sx={{ inset: 0, position: 'absolute', zIndex: 0 }}>\n {backdrop}\n </Box>\n )}\n <Stack\n sx={{\n alignItems: 'center',\n // Theme-aware card surface (white in light, dark surface in dark) — not\n // `common.white`, which stays white and breaks dark mode.\n bgcolor: 'background.paper',\n borderRadius: '8px',\n // Figma: soft card drop-shadow (0 2px 8px rgba(0,0,0,0.12)).\n boxShadow: getLogoElevation,\n gap: 16,\n pb: 16,\n position: 'relative',\n pt: 36,\n px: 16,\n width: '100%',\n zIndex: 1,\n }}\n >\n <Box\n sx={{\n display: 'flex',\n left: '50%',\n position: 'absolute',\n top: -LOGO_OVERHANG,\n transform: 'translateX(-50%)',\n }}\n >\n {logo}\n </Box>\n <Stack sx={{ alignItems: 'center', gap: 12, minWidth: 0, width: '100%' }}>\n <Stack sx={{ alignItems: 'center', minWidth: 0, width: '100%' }}>\n {/* Figma name style: body2 (13/16) or body1 (15/20) metrics at weight\n 600. MXUI `bold` renders 700, so set fontWeight explicitly. */}\n <Text sx={{ fontWeight: 600 }}
|
|
1
|
+
{"version":3,"file":"AccountHeroCard.es.js","names":[],"sources":["../../../src/insights-v2/components/AccountHeroCard.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { getLogoElevation } from './logoShadow'\n\n// Figma: the logo overhangs the white card's top edge by 25px and the slot pads\n// 16px above that overhang (so `pt = overhang + 16`).\nconst LOGO_OVERHANG = 25\n\ninterface AccountHeroCardProps {\n /** Central account/institution logo, rendered overhanging the card's top edge. */\n logo: ReactNode\n /** Primary line, e.g. \"Epic Bank Checking, *1234\". */\n name: ReactNode\n /** Optional secondary line beneath the name, e.g. \"Checking Account\". */\n subtitle?: ReactNode\n /**\n * Name typography. Figma: Set Up/Switch Direct Deposit use body2 metrics\n * (13px / lh 16, default); Missing Interest Rate uses body1 (15px / lh 20).\n * Both render at weight 600.\n */\n nameVariant?: 'body1' | 'body2'\n /** Status element beneath the text (e.g. a `<StatusPill>`). */\n status?: ReactNode\n /** Decorative backdrop behind the card (e.g. a `<Confetti>` burst). */\n backdrop?: ReactNode\n /** Slot surface color token. Default `primary.lighter` (Figma's tinted slot,\n * theme-aware: light-blue in light mode, navy in dark). */\n bgcolor?: string\n /**\n * Optional decorative wash layered over `bgcolor` (e.g. a celebration\n * gradient). Figma's gradient is ~20% opacity over a white base, so this is a\n * `backgroundImage` on top of `bgcolor`, not a replacement — pass\n * `bgcolor=\"background.paper\"` with it for the complete state.\n */\n backgroundImage?: string\n sx?: SxProps\n}\n\n/**\n * A centered account hero: an overhanging institution logo above a white card\n * with a name, optional subtitle, and a status slot, over a tinted (or\n * gradient + confetti) slot.\n *\n * Figma: Set Up Direct Deposit (default + complete) and Switch Direct Deposit\n * (complete) Content. Scope is the Content section only.\n */\nconst AccountHeroCard = ({\n backdrop,\n backgroundImage,\n bgcolor = 'primary.lighter',\n logo,\n name,\n nameVariant = 'body2',\n status,\n subtitle,\n sx,\n}: AccountHeroCardProps) => (\n <Box\n sx={{\n alignItems: 'center',\n bgcolor,\n ...(backgroundImage && { backgroundImage }),\n display: 'flex',\n flexDirection: 'column',\n pb: 16,\n position: 'relative',\n pt: LOGO_OVERHANG + 16,\n px: 16,\n width: '100%',\n ...sx,\n }}\n >\n {backdrop && (\n <Box aria-hidden={true} sx={{ inset: 0, position: 'absolute', zIndex: 0 }}>\n {backdrop}\n </Box>\n )}\n <Stack\n sx={{\n alignItems: 'center',\n // Theme-aware card surface (white in light, dark surface in dark) — not\n // `common.white`, which stays white and breaks dark mode.\n bgcolor: 'background.paper',\n borderRadius: '8px',\n // Figma: soft card drop-shadow (0 2px 8px rgba(0,0,0,0.12)).\n boxShadow: getLogoElevation,\n gap: 16,\n pb: 16,\n position: 'relative',\n pt: 36,\n px: 16,\n width: '100%',\n zIndex: 1,\n }}\n >\n <Box\n sx={{\n display: 'flex',\n left: '50%',\n position: 'absolute',\n top: -LOGO_OVERHANG,\n transform: 'translateX(-50%)',\n }}\n >\n {logo}\n </Box>\n <Stack sx={{ alignItems: 'center', gap: 12, minWidth: 0, width: '100%' }}>\n <Stack sx={{ alignItems: 'center', minWidth: 0, width: '100%' }}>\n {/* Figma name style: body2 (13/16) or body1 (15/20) metrics at weight\n 600. MXUI `bold` renders 700, so set fontWeight explicitly. A long name\n wraps, centred, across the card's width. */}\n <Text sx={{ fontWeight: 600, textAlign: 'center' }} variant={nameVariant}>\n {name}\n </Text>\n {subtitle && (\n <Text color=\"text.secondary\" truncate={true} variant=\"caption\">\n {subtitle}\n </Text>\n )}\n </Stack>\n {/* Center the status regardless of its own alignment (StatusPill\n defaults to `alignSelf: flex-start` for left-aligned contexts). */}\n {status && (\n <Box sx={{ display: 'flex', justifyContent: 'center', width: '100%' }}>{status}</Box>\n )}\n </Stack>\n </Stack>\n </Box>\n)\n\nexport default AccountHeroCard\n"],"mappings":";;;;;AAoDA,IAAM,IAAA,CAAmB,EACvB,UAAA,GACA,iBAAA,GACA,SAAA,IAAU,mBACV,MAAA,GACA,MAAA,GACA,aAAA,IAAc,SACd,QAAA,GACA,UAAA,GACA,IAAA,EAAA,MAEA,gBAAA,EAAC,GAAD;AAAA,EACE,IAAI;AAAA,IACF,YAAY;AAAA,IACZ,SAA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