@mx-cartographer/experiences 9.6.13 → 9.6.15
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 +18 -0
- package/dist/common/components/CurrencyDialog.d.ts +6 -1
- package/dist/common/components/CurrencyDialog.es.js +24 -23
- package/dist/common/components/CurrencyDialog.es.js.map +1 -1
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +2 -0
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js +3 -3
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js +64 -59
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/ConnectWidgetActionBlock.es.js +17 -11
- package/dist/insights-v2/actionBlocks/ConnectWidgetActionBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +63 -57
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
- package/dist/insights-v2/analytics/analyticsEventsConfig.d.ts +67 -0
- package/dist/insights-v2/analytics/analyticsEventsConfig.es.js +59 -0
- package/dist/insights-v2/analytics/analyticsEventsConfig.es.js.map +1 -0
- package/dist/insights-v2/analytics/index.d.ts +3 -0
- package/dist/insights-v2/analytics/resolveAnalyticsEvent.d.ts +5 -0
- package/dist/insights-v2/analytics/resolveAnalyticsEvent.es.js +19 -0
- package/dist/insights-v2/analytics/resolveAnalyticsEvent.es.js.map +1 -0
- package/dist/insights-v2/analytics/useAnalyticsEvent.d.ts +3 -0
- package/dist/insights-v2/analytics/useAnalyticsEvent.es.js +20 -0
- package/dist/insights-v2/analytics/useAnalyticsEvent.es.js.map +1 -0
- package/dist/insights-v2/beatActions.d.ts +18 -13
- package/dist/insights-v2/beatActions.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js +24 -22
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/DebtsBlock/DebtsBlock.d.ts +16 -12
- package/dist/insights-v2/blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js +67 -46
- package/dist/insights-v2/blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/DebtsBlock/layout.d.ts +17 -0
- package/dist/insights-v2/blocks/ComponentBlocks/DebtsBlock/layout.es.js +24 -0
- package/dist/insights-v2/blocks/ComponentBlocks/DebtsBlock/layout.es.js.map +1 -0
- package/dist/insights-v2/components/BaseLayout.es.js +89 -79
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/TransactionListCard.es.js +15 -14
- package/dist/insights-v2/components/TransactionListCard.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/ctaHandlers.d.ts +1 -6
- package/dist/insights-v2/ctaActions/ctaHandlers.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/index.d.ts +1 -1
- package/dist/insights-v2/ctaActions/runCtaAction.d.ts +20 -5
- package/dist/insights-v2/ctaActions/runCtaAction.es.js +63 -41
- package/dist/insights-v2/ctaActions/runCtaAction.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/types.d.ts +6 -5
- package/dist/insights-v2/index.es.js +84 -84
- package/dist/insights-v2/mappings/blocks.es.js +2 -2
- package/package.json +1 -1
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
import { InsightsPayload } from '../../../../core';
|
|
2
|
-
|
|
2
|
+
export { PAYOFF_STYLE } from './layout';
|
|
3
3
|
interface DebtsBlockProps {
|
|
4
4
|
payload: InsightsPayload;
|
|
5
5
|
beatGuid?: string;
|
|
6
6
|
}
|
|
7
|
-
/** `projected_payoff` look: primary-tinted slot and pill. The card story mirrors it from here. */
|
|
8
|
-
export declare const PAYOFF_STYLE: DebtPayoffCardStyleProps;
|
|
9
7
|
/**
|
|
10
8
|
* Debts component block — the content card for the Debt Payoff Strategies beat.
|
|
9
|
+
* `instance_slot.variant` picks the card from `./layout.ts` through `resolveVariantConfig`, as
|
|
10
|
+
* `AccountBlock` does:
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* the balance (`amount`), `payoff_date`,
|
|
14
|
-
* account/institution fields.
|
|
15
|
-
*
|
|
16
|
-
*
|
|
12
|
+
* - `projected_payoff` — one account on the `DebtPayoffCard`. Its facts arrive flat on
|
|
13
|
+
* `instance_slot` (the shape it shipped with): the balance (`amount`), `payoff_date`,
|
|
14
|
+
* `monthly_payment`, `interest_rate`, plus the shared account/institution fields.
|
|
15
|
+
* - `debt_summary` — the beat's several debt accounts on a `TransactionListCard`, read from
|
|
16
|
+
* `instance_slot.data`: one row per account from `series` (pre-localized `logo`, `primary_text`
|
|
17
|
+
* name, `secondary_text` rate, `amount` balance, in the order sent), an optional `header_text`,
|
|
18
|
+
* and the total owed (`amount`) as the footer. With no rows there is nothing to summarize and the
|
|
19
|
+
* block renders nothing.
|
|
17
20
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
21
|
+
* Captions and payoff row labels come from `insights_feed.debts_block` copy, which ships
|
|
22
|
+
* separately. Each variant needs only its own keys: until they have shipped, the card shows what
|
|
23
|
+
* needs no copy (the account row, the summary rows) but never an unlabelled figure, and warns once
|
|
24
|
+
* per mount so the rollout gap is traceable. A row with no value (or an unparseable date) is
|
|
25
|
+
* dropped rather than rendered blank.
|
|
22
26
|
*/
|
|
23
27
|
declare const DebtsBlock: ({ payload }: DebtsBlockProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
28
|
export default DebtsBlock;
|
|
@@ -1,56 +1,77 @@
|
|
|
1
|
-
import { DATE_FORMATS_INTL as
|
|
2
|
-
import { useGlobalCopyStore as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { DATE_FORMATS_INTL as R, formatDate as k } from "../../../../core/constants/DateFormats.es.js";
|
|
2
|
+
import { useGlobalCopyStore as F } from "../../../../common/context/hooks.es.js";
|
|
3
|
+
import { slot as f } from "../../../../core/types/Insights.es.js";
|
|
4
|
+
import { formatCurrency as i, formatPercentage as N } from "../../../../core/utils/NumberFormatting.es.js";
|
|
5
|
+
import P from "../../../components/LogoFromGuid.es.js";
|
|
6
|
+
import { DepositLogo as B } from "../../../components/ComponentBlocks/DepositLogo.es.js";
|
|
7
|
+
import { resolveVariantConfig as Y } from "../../resolveVariantConfig.es.js";
|
|
8
|
+
import G from "../../../components/DebtPayoffCard.es.js";
|
|
9
|
+
import j from "../../../components/TransactionListCard.es.js";
|
|
10
|
+
import { parseDueDate as I } from "../UpcomingBillBlock/UpcomingBillBlock.es.js";
|
|
11
|
+
import { DEBTS_LAYOUT as H, debtsBlockVariant as M } from "./layout.es.js";
|
|
12
|
+
import V from "react";
|
|
13
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
14
|
+
import { useTheme as z } from "@mui/material/styles";
|
|
15
|
+
var U = 32, W = /* @__PURE__ */ new Set([
|
|
16
16
|
"credit card",
|
|
17
17
|
"credit_card",
|
|
18
18
|
"creditcard"
|
|
19
|
-
]),
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}, [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
19
|
+
]), Z = (t) => W.has((t ?? "").trim().toLowerCase()) ? "credit_card" : "account_balance", $ = (t) => typeof t == "object" && t !== null && typeof t.primary_text == "string", q = (t) => !!t?.balance_label && !!t.payoff_date_label && !!t.monthly_payment_label && !!t.interest_rate_label, ct = ({ payload: t }) => {
|
|
20
|
+
const T = z(), o = F().insights_feed?.debts_block, { instance_slot: u } = t, { data: s, variant: A } = u, _ = Y(H, A, M.ProjectedPayoff, "DebtsBlock"), p = _.card === "summary", e = q(o) ? o : void 0, m = o?.total_balance_label, b = p ? !!m : !!e;
|
|
21
|
+
if (V.useEffect(() => {
|
|
22
|
+
b || console.warn(`debts_block: ${o ? "copy incomplete" : "copy namespace missing"}; rendering without its labelled figures`);
|
|
23
|
+
}, [o, b]), p) {
|
|
24
|
+
const r = f(s, "series"), O = (Array.isArray(r) ? r : []).filter($).map((a) => ({
|
|
25
|
+
amount: typeof a.amount == "number" ? i(a.amount, "0,0.00") : "",
|
|
26
|
+
leading: /* @__PURE__ */ l(P, {
|
|
27
|
+
logo: a.logo,
|
|
28
|
+
size: U
|
|
29
|
+
}),
|
|
30
|
+
subtitle: typeof a.secondary_text == "string" ? a.secondary_text : "",
|
|
31
|
+
title: a.primary_text
|
|
32
|
+
})), L = f(s, "header_text"), c = f(s, "amount");
|
|
33
|
+
return /* @__PURE__ */ l(j, {
|
|
34
|
+
background: T.palette.primary.lighter,
|
|
35
|
+
footer: m && typeof c == "number" && Number.isFinite(c) ? {
|
|
36
|
+
amount: i(c, "0,0.00"),
|
|
37
|
+
label: m
|
|
38
|
+
} : void 0,
|
|
39
|
+
header: typeof L == "string" ? L : void 0,
|
|
40
|
+
rows: O
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
const { account_name: C, account_type: d, amount: y, institution_guid: S, institution_name: x, interest_rate: g, monthly_payment: h, payoff_date: v, status_text: E } = u, n = [];
|
|
44
|
+
if (e) {
|
|
45
|
+
const r = v ? I(v) : null;
|
|
46
|
+
r && n.push({
|
|
47
|
+
label: e.payoff_date_label,
|
|
48
|
+
value: k(r, R.MONTH_SHORT_YEAR)
|
|
49
|
+
}), h != null && n.push({
|
|
50
|
+
label: e.monthly_payment_label,
|
|
51
|
+
value: i(h, "0,0.00")
|
|
52
|
+
}), g != null && n.push({
|
|
53
|
+
label: e.interest_rate_label,
|
|
54
|
+
value: N(g / 100)
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
const D = e !== void 0 && y != null;
|
|
58
|
+
return /* @__PURE__ */ l(G, {
|
|
59
|
+
..._.style,
|
|
60
|
+
balance: D ? i(y, "0,0.00") : void 0,
|
|
61
|
+
balanceLabel: D ? e.balance_label : void 0,
|
|
62
|
+
logo: /* @__PURE__ */ l(B, {
|
|
63
|
+
iconName: Z(d),
|
|
64
|
+
institutionGuid: S ?? "",
|
|
65
|
+
institutionName: x ?? ""
|
|
44
66
|
}),
|
|
45
|
-
name:
|
|
46
|
-
stats:
|
|
47
|
-
statusLabel:
|
|
48
|
-
subtitle:
|
|
67
|
+
name: C,
|
|
68
|
+
stats: n,
|
|
69
|
+
statusLabel: E,
|
|
70
|
+
subtitle: d
|
|
49
71
|
});
|
|
50
72
|
};
|
|
51
73
|
export {
|
|
52
|
-
|
|
53
|
-
B as default
|
|
74
|
+
ct as default
|
|
54
75
|
};
|
|
55
76
|
|
|
56
77
|
//# sourceMappingURL=DebtsBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DebtsBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/DebtsBlock/DebtsBlock.tsx"],"sourcesContent":["import React from 'react'\n\nimport { useGlobalCopyStore } from '../../../../common'\nimport type
|
|
1
|
+
{"version":3,"file":"DebtsBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/DebtsBlock/DebtsBlock.tsx"],"sourcesContent":["import React from 'react'\n\nimport { useTheme } from '@mui/material/styles'\n\nimport { useGlobalCopyStore } from '../../../../common'\nimport { slot, type InsightsPayload, type InstanceSlotRow } from '../../../../core'\nimport { DATE_FORMATS_INTL, formatDate } from '../../../../core/constants'\nimport type { DebtsBlockCopy } from '../../../../core/types/localization/InsightsFeedCopy'\nimport { formatCurrency, formatPercentage } from '../../../../core/utils/NumberFormatting'\n\nimport DepositLogo from '../../../components/ComponentBlocks/DepositLogo'\nimport DebtPayoffCard, { type DebtPayoffStat } from '../../../components/DebtPayoffCard'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\nimport TransactionListCard from '../../../components/TransactionListCard'\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\nimport { parseDueDate } from '../UpcomingBillBlock/UpcomingBillBlock'\n\nimport { DEBTS_LAYOUT, debtsBlockVariant } from './layout'\n\n// The card story reads the block's look from here.\nexport { PAYOFF_STYLE } from './layout'\n\ninterface DebtsBlockProps {\n payload: InsightsPayload\n beatGuid?: string\n}\n\nconst ROW_LOGO_SIZE = 32\n\n/** Account types drawn with the card glyph when there is no institution logo; the rest get the bank. */\nconst CREDIT_CARD_TYPES = new Set(['credit card', 'credit_card', 'creditcard'])\n\nconst iconFor = (accountType?: string) =>\n CREDIT_CARD_TYPES.has((accountType ?? '').trim().toLowerCase())\n ? 'credit_card'\n : 'account_balance'\n\n/** A summary row ditto can draw: an object with a name. Anything else in `series` is skipped. */\nconst isNamedRow = (row: unknown): row is InstanceSlotRow & { primary_text: string } =>\n typeof row === 'object' &&\n row !== null &&\n typeof (row as InstanceSlotRow).primary_text === 'string'\n\n/** Every label the payoff card renders; a partial namespace counts as missing. */\nconst hasAllLabels = (copy?: DebtsBlockCopy): copy is DebtsBlockCopy =>\n !!copy?.balance_label &&\n !!copy.payoff_date_label &&\n !!copy.monthly_payment_label &&\n !!copy.interest_rate_label\n\n/**\n * Debts component block — the content card for the Debt Payoff Strategies beat.\n * `instance_slot.variant` picks the card from `./layout.ts` through `resolveVariantConfig`, as\n * `AccountBlock` does:\n *\n * - `projected_payoff` — one account on the `DebtPayoffCard`. Its facts arrive flat on\n * `instance_slot` (the shape it shipped with): the balance (`amount`), `payoff_date`,\n * `monthly_payment`, `interest_rate`, plus the shared account/institution fields.\n * - `debt_summary` — the beat's several debt accounts on a `TransactionListCard`, read from\n * `instance_slot.data`: one row per account from `series` (pre-localized `logo`, `primary_text`\n * name, `secondary_text` rate, `amount` balance, in the order sent), an optional `header_text`,\n * and the total owed (`amount`) as the footer. With no rows there is nothing to summarize and the\n * block renders nothing.\n *\n * Captions and payoff row labels come from `insights_feed.debts_block` copy, which ships\n * separately. Each variant needs only its own keys: until they have shipped, the card shows what\n * needs no copy (the account row, the summary rows) but never an unlabelled figure, and warns once\n * per mount so the rollout gap is traceable. A row with no value (or an unparseable date) is\n * dropped rather than rendered blank.\n */\nconst DebtsBlock = ({ payload }: DebtsBlockProps) => {\n const theme = useTheme()\n const copy = useGlobalCopyStore().insights_feed?.debts_block\n const { instance_slot } = payload\n const { data, variant } = instance_slot\n\n const layout = resolveVariantConfig(\n DEBTS_LAYOUT,\n variant,\n debtsBlockVariant.ProjectedPayoff,\n 'DebtsBlock',\n )\n const isSummary = layout.card === 'summary'\n\n const labels = hasAllLabels(copy) ? copy : undefined\n const totalLabel = copy?.total_balance_label\n const hasCopy = isSummary ? !!totalLabel : !!labels\n\n React.useEffect(() => {\n if (hasCopy) return\n console.warn(\n `debts_block: ${copy ? 'copy incomplete' : 'copy namespace missing'}; rendering without its labelled figures`,\n )\n }, [copy, hasCopy])\n\n if (isSummary) {\n // `slot()` is an unchecked cast over backend data, so every value is narrowed before use.\n const series = slot<unknown[]>(data, 'series')\n const rows = (Array.isArray(series) ? series : []).filter(isNamedRow).map((row) => ({\n amount: typeof row.amount === 'number' ? formatCurrency(row.amount, '0,0.00') : '',\n leading: <LogoFromGuid logo={row.logo} size={ROW_LOGO_SIZE} />,\n subtitle: typeof row.secondary_text === 'string' ? row.secondary_text : '',\n title: row.primary_text,\n }))\n const header = slot<unknown>(data, 'header_text')\n const total = slot<unknown>(data, 'amount')\n\n return (\n <TransactionListCard\n background={theme.palette.primary.lighter}\n footer={\n totalLabel && typeof total === 'number' && Number.isFinite(total)\n ? { amount: formatCurrency(total, '0,0.00'), label: totalLabel }\n : undefined\n }\n header={typeof header === 'string' ? header : undefined}\n rows={rows}\n />\n )\n }\n\n const {\n account_name,\n account_type,\n amount,\n institution_guid,\n institution_name,\n interest_rate,\n monthly_payment,\n payoff_date,\n status_text,\n } = instance_slot\n\n const stats: DebtPayoffStat[] = []\n if (labels) {\n const payoffDate = payoff_date ? parseDueDate(payoff_date) : null\n if (payoffDate) {\n stats.push({\n label: labels.payoff_date_label,\n value: formatDate(payoffDate, DATE_FORMATS_INTL.MONTH_SHORT_YEAR),\n })\n }\n if (monthly_payment != null) {\n stats.push({\n label: labels.monthly_payment_label,\n value: formatCurrency(monthly_payment, '0,0.00'),\n })\n }\n if (interest_rate != null) {\n // `interest_rate` arrives as a percentage (19.99); Intl's percent style expects a fraction.\n stats.push({\n label: labels.interest_rate_label,\n value: formatPercentage(interest_rate / 100),\n })\n }\n }\n\n const hasBalance = labels !== undefined && amount != null\n\n return (\n <DebtPayoffCard\n {...layout.style}\n balance={hasBalance ? formatCurrency(amount, '0,0.00') : undefined}\n balanceLabel={hasBalance ? labels.balance_label : undefined}\n logo={\n <DepositLogo\n iconName={iconFor(account_type)}\n institutionGuid={institution_guid ?? ''}\n institutionName={institution_name ?? ''}\n />\n }\n name={account_name}\n stats={stats}\n statusLabel={status_text}\n subtitle={account_type}\n />\n )\n}\n\nexport default DebtsBlock\n"],"mappings":"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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DebtPayoffCardStyleProps } from '../../../components/DebtPayoffCard';
|
|
2
|
+
export declare const debtsBlockVariant: {
|
|
3
|
+
/** Debt Payoff Strategies, one account: balance plus projected payoff / monthly payment / rate rows. */
|
|
4
|
+
readonly ProjectedPayoff: "projected_payoff";
|
|
5
|
+
/** Debt Payoff Strategies, several accounts: one row per debt (balance, rate) and the total owed. */
|
|
6
|
+
readonly DebtSummary: "debt_summary";
|
|
7
|
+
};
|
|
8
|
+
export type DebtsBlockVariant = (typeof debtsBlockVariant)[keyof typeof debtsBlockVariant];
|
|
9
|
+
export interface DebtsBlockLayoutConfig {
|
|
10
|
+
/** Which card the variant draws: the single-account payoff card or the multi-account summary list. */
|
|
11
|
+
card: 'payoff' | 'summary';
|
|
12
|
+
/** Payoff card slot + pill tokens. */
|
|
13
|
+
style?: DebtPayoffCardStyleProps;
|
|
14
|
+
}
|
|
15
|
+
/** `projected_payoff` look: primary-tinted slot and pill. The card story mirrors it from here. */
|
|
16
|
+
export declare const PAYOFF_STYLE: DebtPayoffCardStyleProps;
|
|
17
|
+
export declare const DEBTS_LAYOUT: Record<string, DebtsBlockLayoutConfig>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var r = {
|
|
2
|
+
ProjectedPayoff: "projected_payoff",
|
|
3
|
+
DebtSummary: "debt_summary"
|
|
4
|
+
}, e = {
|
|
5
|
+
bgcolor: "primary.lighter",
|
|
6
|
+
pill: {
|
|
7
|
+
bgcolor: "primary.lighter",
|
|
8
|
+
labelColor: "text.primary"
|
|
9
|
+
}
|
|
10
|
+
}, a = {
|
|
11
|
+
card: "payoff",
|
|
12
|
+
style: e
|
|
13
|
+
}, o = {
|
|
14
|
+
[r.ProjectedPayoff]: a,
|
|
15
|
+
[r.DebtSummary]: { card: "summary" },
|
|
16
|
+
default: a
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
o as DEBTS_LAYOUT,
|
|
20
|
+
e as PAYOFF_STYLE,
|
|
21
|
+
r as debtsBlockVariant
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=layout.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/DebtsBlock/layout.ts"],"sourcesContent":["import type { DebtPayoffCardStyleProps } from '../../../components/DebtPayoffCard'\n\nexport const debtsBlockVariant = {\n /** Debt Payoff Strategies, one account: balance plus projected payoff / monthly payment / rate rows. */\n ProjectedPayoff: 'projected_payoff',\n /** Debt Payoff Strategies, several accounts: one row per debt (balance, rate) and the total owed. */\n DebtSummary: 'debt_summary',\n} as const\n\nexport type DebtsBlockVariant = (typeof debtsBlockVariant)[keyof typeof debtsBlockVariant]\n\nexport interface DebtsBlockLayoutConfig {\n /** Which card the variant draws: the single-account payoff card or the multi-account summary list. */\n card: 'payoff' | 'summary'\n /** Payoff card slot + pill tokens. */\n style?: DebtPayoffCardStyleProps\n}\n\n/** `projected_payoff` look: primary-tinted slot and pill. The card story mirrors it from here. */\nexport const PAYOFF_STYLE: DebtPayoffCardStyleProps = {\n bgcolor: 'primary.lighter',\n pill: { bgcolor: 'primary.lighter', labelColor: 'text.primary' },\n}\n\nconst PROJECTED_PAYOFF: DebtsBlockLayoutConfig = { card: 'payoff', style: PAYOFF_STYLE }\n\nexport const DEBTS_LAYOUT: Record<string, DebtsBlockLayoutConfig> = {\n [debtsBlockVariant.ProjectedPayoff]: PROJECTED_PAYOFF,\n [debtsBlockVariant.DebtSummary]: { card: 'summary' },\n // Neutral fallback for an unknown variant: the payoff card. `resolveVariantConfig` warns first.\n default: PROJECTED_PAYOFF,\n}\n"],"mappings":"AAEA,IAAa,IAAoB;AAAA,EAE/B,iBAAiB;AAAA,EAEjB,aAAa;AACf,GAYa,IAAyC;AAAA,EACpD,SAAS;AAAA,EACT,MAAM;AAAA,IAAE,SAAS;AAAA,IAAmB,YAAY;AAAA,EAAe;AACjE,GAEM,IAA2C;AAAA,EAAE,MAAM;AAAA,EAAU,OAAO;AAAa,GAE1E,IAAuD;AAAA,EACjE,CAAA,EAAkB,eAAA,GAAkB;AAAA,EACpC,CAAA,EAAkB,WAAA,GAAc,EAAE,MAAM,UAAU;AAAA,EAEnD,SAAS;AACX"}
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
import { useAppConfig as
|
|
2
|
-
import { BeatActionsProvider as
|
|
3
|
-
import { isContactSupportCtaDisabled as
|
|
4
|
-
import { logoFromRef as
|
|
5
|
-
import { actionBlocksKey as
|
|
6
|
-
import
|
|
7
|
-
import { ErrorCard as q } from "./ErrorCard.es.js";
|
|
1
|
+
import { useAppConfig as U, useGlobalCopyStore as j, useGlobalStore as z, useInsightsV2Store as K } from "../../common/context/hooks.es.js";
|
|
2
|
+
import { BeatActionsProvider as X } from "../beatActions.es.js";
|
|
3
|
+
import { isContactSupportCtaDisabled as W } from "../actionBlocks/ContactSupportActionBlock.es.js";
|
|
4
|
+
import { logoFromRef as Y } from "./shared/EntityLogo.es.js";
|
|
5
|
+
import { actionBlocksKey as $ } from "../mappings/actionBlocksKey.es.js";
|
|
6
|
+
import { reportCtaClick as q } from "../ctaActions/runCtaAction.es.js";
|
|
8
7
|
import { useBeatCtaActions as J } from "../ctaActions/useCtaAction.es.js";
|
|
9
|
-
import
|
|
10
|
-
import Z from "./
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
8
|
+
import Q from "./FeedbackDialog.es.js";
|
|
9
|
+
import { ErrorCard as Z } from "./ErrorCard.es.js";
|
|
10
|
+
import { blocks as oo } from "../mappings/blocks.es.js";
|
|
11
|
+
import to from "./Footer.es.js";
|
|
12
|
+
import io from "./Header.es.js";
|
|
13
|
+
import { FeedbackBar as eo } from "./FeedbackBar.es.js";
|
|
14
|
+
import { DismissInsightDialog as ro } from "./DismissInsightDialog.es.js";
|
|
15
|
+
import { HiddenConfirmationCard as no } from "./HiddenConfirmationCard.es.js";
|
|
16
|
+
import { LoadingCard as so } from "./LoadingCard.es.js";
|
|
17
|
+
import { ObsolesceBanner as ao } from "./ObsolesceBanner.es.js";
|
|
18
|
+
import { ActionBlockLayer as lo } from "../actionBlocks/ActionBlockLayer.es.js";
|
|
19
|
+
import { useBeatFeedbackFlow as co } from "../hooks/useBeatFeedbackFlow.es.js";
|
|
20
|
+
import { useMemo as mo } from "react";
|
|
21
|
+
import { observer as po } from "mobx-react-lite";
|
|
20
22
|
import g from "@mui/material/Stack";
|
|
21
|
-
import { P as
|
|
22
|
-
import
|
|
23
|
+
import { P as uo, Text as fo } from "@mxenabled/mxui";
|
|
24
|
+
import p from "@mui/material/Button";
|
|
23
25
|
import { ChevronRight as D } from "@mxenabled/mx-icons";
|
|
24
|
-
import { Fragment as
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
var
|
|
26
|
+
import { Fragment as bo, jsx as t, jsxs as l } from "react/jsx-runtime";
|
|
27
|
+
import Co from "@mui/material/Box";
|
|
28
|
+
import ho from "@mui/material/Card";
|
|
29
|
+
var yo = {}, go = {
|
|
28
30
|
position: "absolute",
|
|
29
31
|
top: 0,
|
|
30
32
|
left: 0,
|
|
@@ -33,7 +35,7 @@ var uo = {}, bo = {
|
|
|
33
35
|
backgroundColor: "background.default",
|
|
34
36
|
opacity: 0.7,
|
|
35
37
|
zIndex: 1
|
|
36
|
-
},
|
|
38
|
+
}, ko = {
|
|
37
39
|
alignItems: "center",
|
|
38
40
|
alignSelf: "flex-start",
|
|
39
41
|
display: "flex",
|
|
@@ -41,54 +43,62 @@ var uo = {}, bo = {
|
|
|
41
43
|
height: 44,
|
|
42
44
|
px: 2,
|
|
43
45
|
textTransform: "none"
|
|
44
|
-
},
|
|
45
|
-
const I = j(), w =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
46
|
+
}, $o = po(({ beat: i, beatActions: n = yo, obsolete: u, isLoading: L = !1, isError: O = !1 }) => {
|
|
47
|
+
const I = j(), w = K(), { config: A } = U(), o = co(i, n), F = z(), { runCta: E, primary: k, secondary: x } = J(i, n, i.insights_payload?.primary_cta, i.insights_payload?.secondary_cta), c = i.insights_payload?.widget_type === "mini", M = mo(() => ({
|
|
48
|
+
...o.wrappedActions,
|
|
49
|
+
beat: i
|
|
50
|
+
}), [o.wrappedActions, i]);
|
|
51
|
+
if (O) return /* @__PURE__ */ t(Z, {});
|
|
52
|
+
const e = i.insights_payload;
|
|
53
|
+
if (!e || o.cardState === "dismissed") return null;
|
|
54
|
+
const { instance_slot: N, primary_cta: r, secondary_cta: s, sub_title: R, title: H, guid: _, dismissed_at: P } = e, { block: V } = N, G = R ?? (e.subtitle ? {
|
|
55
|
+
logo: Y(e.logo),
|
|
56
|
+
text: e.subtitle
|
|
57
|
+
} : void 0), d = (m) => W(m, A, n.onContactSupport), v = async (m, y) => {
|
|
58
|
+
if (!d(y.block)) {
|
|
59
|
+
if (y.block === $.CONTACT_SUPPORT_ACTION_BLOCK) {
|
|
60
|
+
q({
|
|
61
|
+
beat: i,
|
|
62
|
+
stores: F,
|
|
63
|
+
hostActions: n,
|
|
64
|
+
slot: m
|
|
65
|
+
}), n.onContactSupport?.();
|
|
56
66
|
return;
|
|
57
67
|
}
|
|
58
|
-
await
|
|
68
|
+
await E(m, y);
|
|
59
69
|
}
|
|
60
|
-
}, S =
|
|
61
|
-
return /* @__PURE__ */ t(
|
|
62
|
-
value:
|
|
63
|
-
children: /* @__PURE__ */
|
|
70
|
+
}, S = oo[V], a = e.in_description_cta, f = !c && a?.label && a.block ? a : void 0, b = r?.label ?? (f ? void 0 : a?.label), B = !c && !!r?.label, T = !c && !!s?.label, C = I.insights_feed?.general, h = u?.state === "not_refreshable" && !P && !!C;
|
|
71
|
+
return /* @__PURE__ */ t(X, {
|
|
72
|
+
value: M,
|
|
73
|
+
children: /* @__PURE__ */ l(g, {
|
|
64
74
|
sx: { mb: 16 },
|
|
65
75
|
children: [
|
|
66
|
-
o.cardState === "confirming" ? /* @__PURE__ */ t(
|
|
76
|
+
o.cardState === "confirming" ? /* @__PURE__ */ t(no, {
|
|
67
77
|
onClose: o.collapseConfirmation,
|
|
68
78
|
onLeaveFeedback: o.openHideSurvey,
|
|
69
79
|
onUndo: o.undoDismiss
|
|
70
|
-
}) : /* @__PURE__ */
|
|
71
|
-
...
|
|
72
|
-
copy:
|
|
73
|
-
}), /* @__PURE__ */
|
|
74
|
-
inert:
|
|
75
|
-
sx: { ...
|
|
80
|
+
}) : /* @__PURE__ */ l(bo, { children: [u && C && /* @__PURE__ */ t(ao, {
|
|
81
|
+
...u,
|
|
82
|
+
copy: C
|
|
83
|
+
}), /* @__PURE__ */ l(ho, {
|
|
84
|
+
inert: h,
|
|
85
|
+
sx: { ...h && {
|
|
76
86
|
position: "relative",
|
|
77
87
|
zIndex: 2,
|
|
78
88
|
pointerEvents: "none"
|
|
79
89
|
} },
|
|
80
90
|
children: [
|
|
81
|
-
|
|
82
|
-
/* @__PURE__ */ t(
|
|
83
|
-
isMini:
|
|
84
|
-
subtitle:
|
|
85
|
-
title:
|
|
91
|
+
h && /* @__PURE__ */ t(Co, { sx: go }),
|
|
92
|
+
/* @__PURE__ */ t(io, {
|
|
93
|
+
isMini: c,
|
|
94
|
+
subtitle: G,
|
|
95
|
+
title: H ?? ""
|
|
86
96
|
}),
|
|
87
|
-
L ? /* @__PURE__ */ t(
|
|
97
|
+
L ? /* @__PURE__ */ t(so, {}) : S && /* @__PURE__ */ t(S, {
|
|
88
98
|
beatGuid: _,
|
|
89
|
-
payload:
|
|
99
|
+
payload: e
|
|
90
100
|
}),
|
|
91
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ l(g, {
|
|
92
102
|
sx: {
|
|
93
103
|
gap: 6,
|
|
94
104
|
pb: 16,
|
|
@@ -96,11 +106,11 @@ var uo = {}, bo = {
|
|
|
96
106
|
px: 16
|
|
97
107
|
},
|
|
98
108
|
children: [
|
|
99
|
-
/* @__PURE__ */ t(
|
|
100
|
-
dangerouslySetInnerHTML: { __html:
|
|
109
|
+
/* @__PURE__ */ t(uo, {
|
|
110
|
+
dangerouslySetInnerHTML: { __html: e.description.html_text },
|
|
101
111
|
variant: "subtitle2"
|
|
102
112
|
}),
|
|
103
|
-
f && /* @__PURE__ */ t(
|
|
113
|
+
f && /* @__PURE__ */ t(p, {
|
|
104
114
|
endIcon: /* @__PURE__ */ t(D, {}),
|
|
105
115
|
onClick: () => w.openActionDrawer({
|
|
106
116
|
guid: _,
|
|
@@ -113,7 +123,7 @@ var uo = {}, bo = {
|
|
|
113
123
|
},
|
|
114
124
|
children: f.label
|
|
115
125
|
}),
|
|
116
|
-
!a?.label &&
|
|
126
|
+
!a?.label && i?.in_description_cta && /* @__PURE__ */ t(p, {
|
|
117
127
|
endIcon: /* @__PURE__ */ t(D, {}),
|
|
118
128
|
onClick: () => {
|
|
119
129
|
},
|
|
@@ -122,53 +132,53 @@ var uo = {}, bo = {
|
|
|
122
132
|
p: 4,
|
|
123
133
|
width: "max-content"
|
|
124
134
|
},
|
|
125
|
-
children:
|
|
135
|
+
children: i.in_description_cta
|
|
126
136
|
})
|
|
127
137
|
]
|
|
128
138
|
}),
|
|
129
|
-
(
|
|
139
|
+
(b || T) && /* @__PURE__ */ l(g, {
|
|
130
140
|
sx: {
|
|
131
141
|
gap: 8,
|
|
132
142
|
pb: 16,
|
|
133
143
|
px: 16
|
|
134
144
|
},
|
|
135
145
|
children: [
|
|
136
|
-
|
|
146
|
+
b && !B && /* @__PURE__ */ t(fo, {
|
|
137
147
|
color: "primary.main",
|
|
138
|
-
sx:
|
|
148
|
+
sx: ko,
|
|
139
149
|
variant: "button",
|
|
140
|
-
children:
|
|
150
|
+
children: b
|
|
141
151
|
}),
|
|
142
|
-
B && r && /* @__PURE__ */ t(
|
|
143
|
-
"aria-disabled":
|
|
152
|
+
B && r && /* @__PURE__ */ t(p, {
|
|
153
|
+
"aria-disabled": d(r.block) || k.disabled,
|
|
144
154
|
disabled: k.disabled,
|
|
145
155
|
onClick: () => v("primary", r),
|
|
146
|
-
sx: { ...
|
|
156
|
+
sx: { ...d(r.block) && { color: "text.disabled" } },
|
|
147
157
|
variant: "outlined",
|
|
148
158
|
children: r.label
|
|
149
159
|
}),
|
|
150
|
-
T &&
|
|
151
|
-
"aria-disabled":
|
|
160
|
+
T && s && /* @__PURE__ */ t(p, {
|
|
161
|
+
"aria-disabled": d(s.block) || x.disabled,
|
|
152
162
|
color: "secondary",
|
|
153
163
|
disabled: x.disabled,
|
|
154
|
-
onClick: () => v("secondary",
|
|
155
|
-
children:
|
|
164
|
+
onClick: () => v("secondary", s),
|
|
165
|
+
children: s.label
|
|
156
166
|
})
|
|
157
167
|
]
|
|
158
168
|
}),
|
|
159
|
-
/* @__PURE__ */ t(
|
|
169
|
+
/* @__PURE__ */ t(eo, {
|
|
160
170
|
onTellUsMore: o.openRatingSurvey,
|
|
161
171
|
show: o.isFeedbackBarShown
|
|
162
172
|
})
|
|
163
173
|
]
|
|
164
174
|
})] }),
|
|
165
|
-
/* @__PURE__ */ t(
|
|
166
|
-
/* @__PURE__ */ t(
|
|
175
|
+
/* @__PURE__ */ t(lo, { beat: i }),
|
|
176
|
+
/* @__PURE__ */ t(ro, {
|
|
167
177
|
isOpen: o.isDismissOpen,
|
|
168
178
|
onClose: o.closeDismissDialog,
|
|
169
179
|
onDismiss: o.confirmDismiss
|
|
170
180
|
}),
|
|
171
|
-
o.isSurveyOpen && /* @__PURE__ */ t(
|
|
181
|
+
o.isSurveyOpen && /* @__PURE__ */ t(Q, {
|
|
172
182
|
characterLimitLabel: o.survey.characterLimitLabel,
|
|
173
183
|
closeAriaLabel: o.survey.closeAriaLabel,
|
|
174
184
|
isOpen: !0,
|
|
@@ -181,13 +191,13 @@ var uo = {}, bo = {
|
|
|
181
191
|
secondaryText: o.survey.backText,
|
|
182
192
|
title: o.survey.title
|
|
183
193
|
}),
|
|
184
|
-
o.cardState === "visible" &&
|
|
194
|
+
o.cardState === "visible" && e.footer && /* @__PURE__ */ t(to, { footer: e.footer })
|
|
185
195
|
]
|
|
186
196
|
})
|
|
187
197
|
});
|
|
188
198
|
});
|
|
189
199
|
export {
|
|
190
|
-
|
|
200
|
+
$o as default
|
|
191
201
|
};
|
|
192
202
|
|
|
193
203
|
//# sourceMappingURL=BaseLayout.es.js.map
|