@mx-cartographer/experiences 9.7.29 → 9.7.31
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 +8 -0
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +51 -0
- package/dist/core/types/localization/index.d.ts +1 -1
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.d.ts +4 -0
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js +80 -0
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/SavingsCalculator.d.ts +8 -0
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/SavingsCalculator.es.js +138 -0
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/SavingsCalculator.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/index.d.ts +1 -0
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/layout.d.ts +52 -0
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/layout.es.js +72 -0
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/layout.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.d.ts +11 -0
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js +132 -0
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffResults.d.ts +12 -0
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffResults.es.js +124 -0
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffResults.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/index.d.ts +1 -0
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/layout.d.ts +26 -0
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/layout.es.js +64 -0
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/layout.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/payoff.d.ts +8 -0
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/payoff.es.js +26 -0
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/payoff.es.js.map +1 -0
- package/dist/insights-v2/mappings/actionBlocksKey.d.ts +2 -0
- package/dist/insights-v2/mappings/actionBlocksKey.es.js +3 -1
- package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
- package/dist/insights-v2/mappings/blocks.es.js +85 -73
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PayoffCalculatorBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.tsx"],"sourcesContent":["import React from 'react'\n\nimport Button from '@mui/material/Button'\nimport InputAdornment from '@mui/material/InputAdornment'\nimport Stack from '@mui/material/Stack'\n\nimport { InstitutionLogo, Text, TextField } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport { Loader, useAccountStore, useGlobalCopyStore } from '../../../common'\nimport getAccountDisplayName from '../../../common/utils/AccountDisplayName'\nimport type { Account, PayoffCalculatorCopy } from '../../../core'\nimport type { ActionBlockProps } from '../../mappings/blocks'\n\nimport {\n buildPayoffRows,\n initialPayoffInputs,\n parsePayoffInputs,\n resolvePrimaryAccount,\n validatePayoffInputs,\n type PayoffErrors,\n type PayoffField,\n type PayoffInputs,\n type PayoffRow,\n} from './layout'\nimport { isPayoffPossible } from './payoff'\nimport { CalculationFailed, PayoffResults } from './PayoffResults'\n\n/** Loads accounts once per open when the host did not attach the beat's primary account. */\nexport const usePayoffCalculatorPrepare = ({ beat }: ActionBlockProps) => {\n const { accountsLoaded, loadAccounts } = useAccountStore()\n\n React.useEffect(() => {\n if (!beat.primary_account && !accountsLoaded) void loadAccounts()\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n}\n\ntype Outcome =\n | { status: 'idle' }\n | { status: 'calculated'; rows: PayoffRow[] }\n | { status: 'failed' }\n\ninterface PayoffCalculatorFormProps {\n account?: Account\n copy: PayoffCalculatorCopy\n}\n\nconst PayoffCalculatorForm = ({ account, copy }: PayoffCalculatorFormProps) => {\n const id = React.useId()\n const [inputs, setInputs] = React.useState<PayoffInputs>(() => initialPayoffInputs(account))\n const [errors, setErrors] = React.useState<PayoffErrors>({})\n const [outcome, setOutcome] = React.useState<Outcome>({ status: 'idle' })\n\n const accountName = account ? getAccountDisplayName(account) : ''\n\n const setField = (field: PayoffField) => (event: React.ChangeEvent<HTMLInputElement>) =>\n setInputs((previous) => ({ ...previous, [field]: event.target.value }))\n\n const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault()\n\n const nextErrors = validatePayoffInputs(inputs, copy)\n\n setErrors(nextErrors)\n if (Object.keys(nextErrors).length > 0) return\n\n const { balance, interestRate, monthlyPayment } = parsePayoffInputs(inputs)\n\n setOutcome(\n isPayoffPossible(interestRate, balance, monthlyPayment)\n ? { status: 'calculated', rows: buildPayoffRows(interestRate, balance, monthlyPayment) }\n : { status: 'failed' },\n )\n }\n\n const field = (\n name: PayoffField,\n label: string,\n adornment: { position: 'start' | 'end'; symbol: string },\n ) => (\n <TextField\n error={!!errors[name]}\n fullWidth={true}\n helperText={errors[name]}\n id={`${id}-${name}`}\n label={label}\n onChange={setField(name)}\n slotProps={{\n htmlInput: { inputMode: 'decimal' },\n input: {\n [adornment.position === 'start' ? 'startAdornment' : 'endAdornment']: (\n <InputAdornment aria-hidden=\"true\" position={adornment.position}>\n {adornment.symbol}\n </InputAdornment>\n ),\n },\n }}\n value={inputs[name]}\n />\n )\n\n return (\n <Stack component=\"form\" noValidate={true} onSubmit={handleSubmit} sx={{ p: 16 }}>\n {accountName && (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 8 }}>\n <InstitutionLogo alt=\"\" institutionGuid={account?.institution_guid ?? ''} size={24} />\n <Text component=\"p\" variant=\"body2\">\n {accountName}\n </Text>\n </Stack>\n )}\n <Text color=\"text.secondary\" component=\"p\" sx={{ mt: 16 }} variant=\"body2\">\n {copy.description}\n </Text>\n <Stack sx={{ gap: 24, pb: 24, pt: 32 }}>\n {field('balance', copy.credit_card_balance, { position: 'start', symbol: '$' })}\n <Stack sx={{ flexDirection: 'row', gap: 16 }}>\n {field('interestRate', copy.interest_rate, { position: 'end', symbol: '%' })}\n {field('monthlyPayment', copy.monthly_payment, { position: 'start', symbol: '$' })}\n </Stack>\n </Stack>\n <Button fullWidth={true} sx={{ mb: 24, mt: 8 }} type=\"submit\" variant=\"contained\">\n {copy.calculate}\n </Button>\n {outcome.status === 'failed' ? (\n <CalculationFailed copy={copy} />\n ) : (\n <PayoffResults\n copy={copy}\n rows={outcome.status === 'calculated' ? outcome.rows : undefined}\n />\n )}\n </Stack>\n )\n}\n\n/**\n * Monthly Credit Card Interest Summary's \"Learn how to save\" drawer: the credit card payoff\n * calculator. The beat's account prefills the balance, interest rate and minimum payment; the\n * user edits them and compares the payoff at that payment, $10 more and $20 more.\n */\nexport const PayoffCalculatorBlock = observer(function PayoffCalculatorBlock({\n beat,\n}: ActionBlockProps) {\n const { common: commonCopy, insights_feed: insightsFeedCopy } = useGlobalCopyStore()\n const { accounts, accountsLoaded } = useAccountStore()\n const copy = insightsFeedCopy?.payoff_calculator\n\n if (!copy) {\n return (\n <Stack sx={{ p: 24 }}>\n <Text>{commonCopy?.error_message}</Text>\n </Stack>\n )\n }\n\n if (!beat.primary_account && !accountsLoaded) return <Loader />\n\n return (\n <PayoffCalculatorForm\n account={resolvePrimaryAccount(beat, accounts)}\n copy={copy}\n key={beat.guid}\n />\n )\n})\n"],"mappings":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AA,UAAO,GAAY,cAAoB,CAAA;AAAA,EAClC,CAAA;AAab,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PayoffCalculatorCopy } from '../../../core';
|
|
2
|
+
import { PayoffRow } from './layout';
|
|
3
|
+
interface PayoffResultsProps {
|
|
4
|
+
copy: PayoffCalculatorCopy;
|
|
5
|
+
/** Undefined until the user has calculated: the rows then show placeholders. */
|
|
6
|
+
rows?: PayoffRow[];
|
|
7
|
+
}
|
|
8
|
+
export declare const PayoffResults: ({ copy, rows }: PayoffResultsProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const CalculationFailed: ({ copy }: {
|
|
10
|
+
copy: PayoffCalculatorCopy;
|
|
11
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { buildPluralCopy as h } from "../../../core/utils/Localization.es.js";
|
|
2
|
+
import { formatCurrency as s } from "../../../core/utils/NumberFormatting.es.js";
|
|
3
|
+
import { PAYMENT_INCREMENTS as x } from "./layout.es.js";
|
|
4
|
+
import m from "@mui/material/Stack";
|
|
5
|
+
import { Text as t } from "@mxenabled/mxui";
|
|
6
|
+
import { Icon as v } from "@mxenabled/mx-icons";
|
|
7
|
+
import { Fragment as y, jsx as r, jsxs as n } from "react/jsx-runtime";
|
|
8
|
+
import g from "@mui/material/Box";
|
|
9
|
+
var C = "0px 6px 12px rgba(106, 115, 129, 0.16), 0px 3px 8px rgba(87, 102, 117, 0.06)", p = ({ label: o, tone: a, value: e }) => /* @__PURE__ */ n(m, {
|
|
10
|
+
sx: {
|
|
11
|
+
flexDirection: "row",
|
|
12
|
+
justifyContent: "space-between"
|
|
13
|
+
},
|
|
14
|
+
children: [/* @__PURE__ */ r(t, {
|
|
15
|
+
color: "text.secondary",
|
|
16
|
+
component: "span",
|
|
17
|
+
variant: "caption",
|
|
18
|
+
children: o
|
|
19
|
+
}), /* @__PURE__ */ r(t, {
|
|
20
|
+
bold: !0,
|
|
21
|
+
color: a,
|
|
22
|
+
component: "span",
|
|
23
|
+
sx: { transition: "color 0.5s" },
|
|
24
|
+
variant: "body1",
|
|
25
|
+
children: e
|
|
26
|
+
})]
|
|
27
|
+
}), E = ({ copy: o, rows: a }) => {
|
|
28
|
+
const e = !!a, i = e ? "text.primary" : "text.secondary", u = a ?? x.map(() => {
|
|
29
|
+
});
|
|
30
|
+
return /* @__PURE__ */ n(g, {
|
|
31
|
+
sx: {
|
|
32
|
+
bgcolor: e ? "background.paper" : "background.default",
|
|
33
|
+
borderRadius: "4px",
|
|
34
|
+
boxShadow: e ? C : "none",
|
|
35
|
+
transition: "background-color 0.5s, box-shadow 0.5s"
|
|
36
|
+
},
|
|
37
|
+
children: [/* @__PURE__ */ r(t, {
|
|
38
|
+
bold: !0,
|
|
39
|
+
color: i,
|
|
40
|
+
component: "h3",
|
|
41
|
+
sx: {
|
|
42
|
+
borderBottom: 1,
|
|
43
|
+
borderColor: "divider",
|
|
44
|
+
p: 16
|
|
45
|
+
},
|
|
46
|
+
variant: "h3",
|
|
47
|
+
children: o.your_results
|
|
48
|
+
}), u.map((l, b) => {
|
|
49
|
+
const c = x[b], d = l?.result.paymentCount ?? 0, f = d >= 1 ? h(o.month, o.months, d, String(d)) : "-";
|
|
50
|
+
return /* @__PURE__ */ n(m, {
|
|
51
|
+
sx: {
|
|
52
|
+
borderBottom: b === u.length - 1 ? 0 : 1,
|
|
53
|
+
borderColor: "divider",
|
|
54
|
+
gap: 16,
|
|
55
|
+
px: 16,
|
|
56
|
+
py: 24
|
|
57
|
+
},
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ r(p, {
|
|
60
|
+
label: /* @__PURE__ */ n(y, { children: [o.monthly_payment, c > 0 && /* @__PURE__ */ r(t, {
|
|
61
|
+
bold: !0,
|
|
62
|
+
color: "success.main",
|
|
63
|
+
component: "span",
|
|
64
|
+
variant: "caption",
|
|
65
|
+
children: ` +${s(c, "0,0.00")}`
|
|
66
|
+
})] }),
|
|
67
|
+
tone: i,
|
|
68
|
+
value: s(l?.monthlyPayment ?? 0, "0,0.00")
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ r(p, {
|
|
71
|
+
label: o.time_to_payoff,
|
|
72
|
+
tone: i,
|
|
73
|
+
value: f
|
|
74
|
+
}),
|
|
75
|
+
/* @__PURE__ */ r(p, {
|
|
76
|
+
label: o.total_interest_paid,
|
|
77
|
+
tone: i,
|
|
78
|
+
value: s(l?.result.totalInterestPaid ?? 0, "0,0.00")
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
}, c);
|
|
82
|
+
})]
|
|
83
|
+
});
|
|
84
|
+
}, j = ({ copy: o }) => /* @__PURE__ */ n(m, {
|
|
85
|
+
role: "alert",
|
|
86
|
+
sx: {
|
|
87
|
+
alignItems: "center",
|
|
88
|
+
bgcolor: "background.default",
|
|
89
|
+
borderRadius: "4px",
|
|
90
|
+
px: 32,
|
|
91
|
+
py: 40,
|
|
92
|
+
textAlign: "center"
|
|
93
|
+
},
|
|
94
|
+
children: [
|
|
95
|
+
/* @__PURE__ */ r(v, {
|
|
96
|
+
"aria-hidden": "true",
|
|
97
|
+
fill: !0,
|
|
98
|
+
name: "error",
|
|
99
|
+
size: 24,
|
|
100
|
+
sx: { color: "primary.main" }
|
|
101
|
+
}),
|
|
102
|
+
/* @__PURE__ */ r(t, {
|
|
103
|
+
bold: !0,
|
|
104
|
+
component: "p",
|
|
105
|
+
sx: {
|
|
106
|
+
pb: 8,
|
|
107
|
+
pt: 16
|
|
108
|
+
},
|
|
109
|
+
variant: "body1",
|
|
110
|
+
children: o.calculation_failed
|
|
111
|
+
}),
|
|
112
|
+
/* @__PURE__ */ r(t, {
|
|
113
|
+
component: "p",
|
|
114
|
+
variant: "body2",
|
|
115
|
+
children: o.calculation_failed_description
|
|
116
|
+
})
|
|
117
|
+
]
|
|
118
|
+
});
|
|
119
|
+
export {
|
|
120
|
+
j as CalculationFailed,
|
|
121
|
+
E as PayoffResults
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
//# sourceMappingURL=PayoffResults.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PayoffResults.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffResults.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { Text } from '@mxenabled/mxui'\n\nimport { buildPluralCopy } from '../../../common'\nimport type { PayoffCalculatorCopy } from '../../../core'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\n\nimport { PAYMENT_INCREMENTS, type PayoffRow } from './layout'\n\nconst CALCULATED_SHADOW =\n '0px 6px 12px rgba(106, 115, 129, 0.16), 0px 3px 8px rgba(87, 102, 117, 0.06)'\n\ninterface ResultLineProps {\n label: React.ReactNode\n tone: 'text.primary' | 'text.secondary'\n value: string\n}\n\nconst ResultLine = ({ label, tone, value }: ResultLineProps) => (\n <Stack sx={{ flexDirection: 'row', justifyContent: 'space-between' }}>\n <Text color=\"text.secondary\" component=\"span\" variant=\"caption\">\n {label}\n </Text>\n <Text\n bold={true}\n color={tone}\n component=\"span\"\n sx={{ transition: 'color 0.5s' }}\n variant=\"body1\"\n >\n {value}\n </Text>\n </Stack>\n)\n\ninterface PayoffResultsProps {\n copy: PayoffCalculatorCopy\n /** Undefined until the user has calculated: the rows then show placeholders. */\n rows?: PayoffRow[]\n}\n\nexport const PayoffResults = ({ copy, rows }: PayoffResultsProps) => {\n const isCalculated = !!rows\n const tone = isCalculated ? 'text.primary' : 'text.secondary'\n const shown: Array<PayoffRow | undefined> = rows ?? PAYMENT_INCREMENTS.map(() => undefined)\n\n return (\n <Box\n sx={{\n bgcolor: isCalculated ? 'background.paper' : 'background.default',\n borderRadius: '4px',\n boxShadow: isCalculated ? CALCULATED_SHADOW : 'none',\n transition: 'background-color 0.5s, box-shadow 0.5s',\n }}\n >\n <Text\n bold={true}\n color={tone}\n component=\"h3\"\n sx={{ borderBottom: 1, borderColor: 'divider', p: 16 }}\n variant=\"h3\"\n >\n {copy.your_results}\n </Text>\n {shown.map((row, index) => {\n const increment = PAYMENT_INCREMENTS[index]\n const paymentCount = row?.result.paymentCount ?? 0\n const timeToPayoff =\n paymentCount >= 1\n ? (buildPluralCopy(\n copy.month,\n copy.months,\n paymentCount,\n String(paymentCount),\n ) as string)\n : '-'\n\n return (\n <Stack\n key={increment}\n sx={{\n borderBottom: index === shown.length - 1 ? 0 : 1,\n borderColor: 'divider',\n gap: 16,\n px: 16,\n py: 24,\n }}\n >\n <ResultLine\n label={\n <>\n {copy.monthly_payment}\n {increment > 0 && (\n <Text bold={true} color=\"success.main\" component=\"span\" variant=\"caption\">\n {` +${formatCurrency(increment, '0,0.00')}`}\n </Text>\n )}\n </>\n }\n tone={tone}\n value={formatCurrency(row?.monthlyPayment ?? 0, '0,0.00')}\n />\n <ResultLine label={copy.time_to_payoff} tone={tone} value={timeToPayoff} />\n <ResultLine\n label={copy.total_interest_paid}\n tone={tone}\n value={formatCurrency(row?.result.totalInterestPaid ?? 0, '0,0.00')}\n />\n </Stack>\n )\n })}\n </Box>\n )\n}\n\nexport const CalculationFailed = ({ copy }: { copy: PayoffCalculatorCopy }) => (\n <Stack\n role=\"alert\"\n sx={{\n alignItems: 'center',\n bgcolor: 'background.default',\n borderRadius: '4px',\n px: 32,\n py: 40,\n textAlign: 'center',\n }}\n >\n <Icon aria-hidden=\"true\" fill={true} name=\"error\" size={24} sx={{ color: 'primary.main' }} />\n <Text bold={true} component=\"p\" sx={{ pb: 8, pt: 16 }} variant=\"body1\">\n {copy.calculation_failed}\n </Text>\n <Text component=\"p\" variant=\"body2\">\n {copy.calculation_failed_description}\n </Text>\n </Stack>\n)\n"],"mappings":";;;;;;;;AAYA,IAAM,IACJ,gFAQI,IAAA,CAAc,EAAE,OAAA,GAAO,MAAA,GAAM,OAAA,EAAA,MAC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M;AAAA,MAAM,WAAU;AAAA,MAAI,IAAI;AAAA,QAAE,IAAI;AAAA,QAAG,IAAI;AAAA,MAAG;AAAA,MAAG,SAAQ;AAAA,MAC5D,UAAA,EAAK;AAAA,IACF,CAAA;AAAA,IACN,gBAAA,EAAC,GAAD;AAAA,MAAM,WAAU;AAAA,MAAI,SAAQ;AAAA,MACzB,UAAA,EAAK;AAAA,IACF,CAAA;AAAA,EACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PayoffCalculatorBlock, usePayoffCalculatorPrepare } from './PayoffCalculatorBlock';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Account, Beat, PayoffCalculatorCopy } from '../../../core';
|
|
2
|
+
import { PayoffResult } from './payoff';
|
|
3
|
+
/** The three monthly payments the results compare: the entered one and two small increases. */
|
|
4
|
+
export declare const PAYMENT_INCREMENTS: readonly [0, 10, 20];
|
|
5
|
+
export type PayoffField = 'balance' | 'interestRate' | 'monthlyPayment';
|
|
6
|
+
export type PayoffInputs = Record<PayoffField, string>;
|
|
7
|
+
export type PayoffErrors = Partial<Record<PayoffField, string>>;
|
|
8
|
+
export declare const PAYOFF_FIELDS: readonly PayoffField[];
|
|
9
|
+
export declare const validatePayoffInputs: (inputs: PayoffInputs, copy: PayoffCalculatorCopy) => PayoffErrors;
|
|
10
|
+
export interface PayoffRow {
|
|
11
|
+
/** How much more than the entered payment this row pays each month. */
|
|
12
|
+
increment: number;
|
|
13
|
+
monthlyPayment: number;
|
|
14
|
+
result: PayoffResult;
|
|
15
|
+
}
|
|
16
|
+
export declare const buildPayoffRows: (annualRatePercent: number, balance: number, payment: number) => PayoffRow[];
|
|
17
|
+
export declare const parsePayoffInputs: (inputs: PayoffInputs) => {
|
|
18
|
+
balance: number;
|
|
19
|
+
interestRate: number;
|
|
20
|
+
monthlyPayment: number;
|
|
21
|
+
};
|
|
22
|
+
/** Manual accounts carry their rate as `interest_rate`; aggregated ones as APR, else APY. */
|
|
23
|
+
export declare const interestRateOf: (account: Account) => number | undefined;
|
|
24
|
+
export declare const initialPayoffInputs: (account?: Account) => PayoffInputs;
|
|
25
|
+
/** The beat's primary account: from the beat when the host attached it, else the loaded accounts. */
|
|
26
|
+
export declare const resolvePrimaryAccount: (beat: Beat, accounts: Account[]) => Account | undefined;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { buildDynamicCopy as i } from "../../../core/utils/Localization.es.js";
|
|
2
|
+
import { calculatePayoff as o } from "./payoff.es.js";
|
|
3
|
+
var s = [
|
|
4
|
+
0,
|
|
5
|
+
10,
|
|
6
|
+
20
|
|
7
|
+
], u = [
|
|
8
|
+
"balance",
|
|
9
|
+
"interestRate",
|
|
10
|
+
"monthlyPayment"
|
|
11
|
+
], f = {
|
|
12
|
+
balance: {
|
|
13
|
+
label: "credit_card_balance",
|
|
14
|
+
min: 0.01
|
|
15
|
+
},
|
|
16
|
+
interestRate: {
|
|
17
|
+
label: "interest_rate",
|
|
18
|
+
min: 0,
|
|
19
|
+
max: 100
|
|
20
|
+
},
|
|
21
|
+
monthlyPayment: {
|
|
22
|
+
label: "monthly_payment",
|
|
23
|
+
min: 0.01,
|
|
24
|
+
max: 1e6
|
|
25
|
+
}
|
|
26
|
+
}, b = /^(\d+\.?\d*|\.\d+)$/, y = (e, t, a) => {
|
|
27
|
+
const r = f[e], n = a[r.label], m = t.trim();
|
|
28
|
+
if (!m) return i(a.value_is_required, n);
|
|
29
|
+
if (!b.test(m)) return i(a.value_must_be_a_number, n);
|
|
30
|
+
const _ = Number(m);
|
|
31
|
+
if (_ < r.min) return i(a.value_must_be_greater_than_or_equal_to, n, String(r.min));
|
|
32
|
+
if (r.max !== void 0 && _ > r.max) return i(a.value_must_be_less_than_or_equal_to, n, String(r.max));
|
|
33
|
+
}, R = (e, t) => {
|
|
34
|
+
const a = {};
|
|
35
|
+
for (const r of u) {
|
|
36
|
+
const n = y(r, e[r], t);
|
|
37
|
+
n && (a[r] = n);
|
|
38
|
+
}
|
|
39
|
+
return a;
|
|
40
|
+
}, h = (e, t, a) => s.map((r) => ({
|
|
41
|
+
increment: r,
|
|
42
|
+
monthlyPayment: a + r,
|
|
43
|
+
result: o(e, t, a + r)
|
|
44
|
+
})), p = (e) => ({
|
|
45
|
+
balance: Number(e.balance),
|
|
46
|
+
interestRate: Number(e.interestRate),
|
|
47
|
+
monthlyPayment: Number(e.monthlyPayment)
|
|
48
|
+
}), v = (e) => e.is_manual ? e.interest_rate ?? void 0 : e.apr ?? e.apy ?? e.interest_rate ?? void 0, l = (e) => e ? String(e) : "", N = (e) => ({
|
|
49
|
+
balance: l(e?.balance),
|
|
50
|
+
interestRate: l(e && v(e)),
|
|
51
|
+
monthlyPayment: l(e?.minimum_payment)
|
|
52
|
+
}), E = (e, t) => e.primary_account ?? t.find((a) => a.guid === e.primary_account_guid);
|
|
53
|
+
export {
|
|
54
|
+
s as PAYMENT_INCREMENTS,
|
|
55
|
+
u as PAYOFF_FIELDS,
|
|
56
|
+
h as buildPayoffRows,
|
|
57
|
+
N as initialPayoffInputs,
|
|
58
|
+
v as interestRateOf,
|
|
59
|
+
p as parsePayoffInputs,
|
|
60
|
+
E as resolvePrimaryAccount,
|
|
61
|
+
R as validatePayoffInputs
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=layout.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/PayoffCalculatorBlock/layout.ts"],"sourcesContent":["import { buildDynamicCopy } from '../../../common'\nimport type { Account, Beat, PayoffCalculatorCopy } from '../../../core'\n\nimport { calculatePayoff, type PayoffResult } from './payoff'\n\n/** The three monthly payments the results compare: the entered one and two small increases. */\nexport const PAYMENT_INCREMENTS = [0, 10, 20] as const\n\nexport type PayoffField = 'balance' | 'interestRate' | 'monthlyPayment'\n\nexport type PayoffInputs = Record<PayoffField, string>\n\nexport type PayoffErrors = Partial<Record<PayoffField, string>>\n\nexport const PAYOFF_FIELDS: readonly PayoffField[] = ['balance', 'interestRate', 'monthlyPayment']\n\ninterface FieldRule {\n label: 'credit_card_balance' | 'interest_rate' | 'monthly_payment'\n min: number\n max?: number\n}\n\nconst RULES: Record<PayoffField, FieldRule> = {\n balance: { label: 'credit_card_balance', min: 0.01 },\n interestRate: { label: 'interest_rate', min: 0, max: 100 },\n monthlyPayment: { label: 'monthly_payment', min: 0.01, max: 1_000_000 },\n}\n\nconst NUMBER_PATTERN = /^(\\d+\\.?\\d*|\\.\\d+)$/\n\nconst fieldError = (\n field: PayoffField,\n value: string,\n copy: PayoffCalculatorCopy,\n): string | undefined => {\n const rule = RULES[field]\n const label = copy[rule.label]\n const trimmed = value.trim()\n\n if (!trimmed) return buildDynamicCopy(copy.value_is_required, label) as string\n if (!NUMBER_PATTERN.test(trimmed))\n return buildDynamicCopy(copy.value_must_be_a_number, label) as string\n\n const amount = Number(trimmed)\n\n if (amount < rule.min) {\n return buildDynamicCopy(\n copy.value_must_be_greater_than_or_equal_to,\n label,\n String(rule.min),\n ) as string\n }\n if (rule.max !== undefined && amount > rule.max) {\n return buildDynamicCopy(\n copy.value_must_be_less_than_or_equal_to,\n label,\n String(rule.max),\n ) as string\n }\n\n return undefined\n}\n\nexport const validatePayoffInputs = (\n inputs: PayoffInputs,\n copy: PayoffCalculatorCopy,\n): PayoffErrors => {\n const errors: PayoffErrors = {}\n\n for (const field of PAYOFF_FIELDS) {\n const error = fieldError(field, inputs[field], copy)\n\n if (error) errors[field] = error\n }\n\n return errors\n}\n\nexport interface PayoffRow {\n /** How much more than the entered payment this row pays each month. */\n increment: number\n monthlyPayment: number\n result: PayoffResult\n}\n\nexport const buildPayoffRows = (\n annualRatePercent: number,\n balance: number,\n payment: number,\n): PayoffRow[] =>\n PAYMENT_INCREMENTS.map((increment) => ({\n increment,\n monthlyPayment: payment + increment,\n result: calculatePayoff(annualRatePercent, balance, payment + increment),\n }))\n\nexport const parsePayoffInputs = (inputs: PayoffInputs) => ({\n balance: Number(inputs.balance),\n interestRate: Number(inputs.interestRate),\n monthlyPayment: Number(inputs.monthlyPayment),\n})\n\n/** Manual accounts carry their rate as `interest_rate`; aggregated ones as APR, else APY. */\nexport const interestRateOf = (account: Account): number | undefined => {\n if (account.is_manual) return account.interest_rate ?? undefined\n\n return account.apr ?? account.apy ?? account.interest_rate ?? undefined\n}\n\n/** A known, non-zero figure as the field's starting text; anything else starts empty. */\nconst toInputValue = (value?: number | null): string => (value ? String(value) : '')\n\nexport const initialPayoffInputs = (account?: Account): PayoffInputs => ({\n balance: toInputValue(account?.balance),\n interestRate: toInputValue(account && interestRateOf(account)),\n monthlyPayment: toInputValue(account?.minimum_payment),\n})\n\n/** The beat's primary account: from the beat when the host attached it, else the loaded accounts. */\nexport const resolvePrimaryAccount = (beat: Beat, accounts: Account[]): Account | undefined =>\n beat.primary_account ?? accounts.find((account) => account.guid === beat.primary_account_guid)\n"],"mappings":";;AAMA,IAAa,IAAqB;AAAA,EAAC;AAAA,EAAG;AAAA,EAAI;AAAE,GAQ/B,IAAwC;AAAA,EAAC;AAAA,EAAW;AAAA,EAAgB;AAAgB,GAQ3F,IAAwC;AAAA,EAC5C,SAAS;AAAA,IAAE,OAAO;AAAA,IAAuB,KAAK;AAAA,EAAK;AAAA,EACnD,cAAc;AAAA,IAAE,OAAO;AAAA,IAAiB,KAAK;AAAA,IAAG,KAAK;AAAA,EAAI;AAAA,EACzD,gBAAgB;AAAA,IAAE,OAAO;AAAA,IAAmB,KAAK;AAAA,IAAM,KAAK;AAAA,EAAU;AACxE,GAEM,IAAiB,uBAEjB,IAAA,CACJ,GACA,GACA,MACuB;AACvB,QAAM,IAAO,EAAM,CAAA,GACb,IAAQ,EAAK,EAAK,KAAA,GAClB,IAAU,EAAM,KAAK;AAE3B,MAAI,CAAC,EAAS,QAAO,EAAiB,EAAK,mBAAmB,CAAK;AACnE,MAAI,CAAC,EAAe,KAAK,CAAO,EAC9B,QAAO,EAAiB,EAAK,wBAAwB,CAAK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aches zero. */
|
|
3
|
+
paymentCount: number;
|
|
4
|
+
totalInterestPaid: number;
|
|
5
|
+
}
|
|
6
|
+
export declare const paymentCountFor: (balance: number, monthlyRate: number, payment: number) => number;
|
|
7
|
+
export declare const isPayoffPossible: (annualRatePercent: number, balance: number, payment: number) => boolean;
|
|
8
|
+
export declare const calculatePayoff: (annualRatePercent: number, balance: number, payment: number) => PayoffResult;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var l = 1200, u = (r) => r / 1200, a = (r, o, t) => Math.ceil(o === 0 ? r / t : -Math.log(1 - o * r / t) / Math.log(1 + o)), v = (r, o, t, i) => {
|
|
2
|
+
if (t === 0) return 0;
|
|
3
|
+
let e = 0;
|
|
4
|
+
for (let s = 0; s < r; s += 1) {
|
|
5
|
+
const n = Math.pow(1 + t, s), f = o * n - i * ((n - 1) / t);
|
|
6
|
+
e += f * t;
|
|
7
|
+
}
|
|
8
|
+
return e;
|
|
9
|
+
}, M = (r, o, t) => {
|
|
10
|
+
if (!Number.isFinite(r) || !Number.isFinite(o) || !(t > 0)) return !1;
|
|
11
|
+
const i = a(o, u(r), t);
|
|
12
|
+
return Number.isFinite(i) && i <= l;
|
|
13
|
+
}, c = (r, o, t) => {
|
|
14
|
+
const i = u(r), e = a(o, i, t);
|
|
15
|
+
return {
|
|
16
|
+
paymentCount: e,
|
|
17
|
+
totalInterestPaid: v(e, o, i, t)
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
c as calculatePayoff,
|
|
22
|
+
M as isPayoffPossible,
|
|
23
|
+
a as paymentCountFor
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=payoff.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payoff.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/PayoffCalculatorBlock/payoff.ts"],"sourcesContent":["const MONTHS_PER_YEAR = 12\n\n/** A payoff further out than this is treated as unreachable (pulse `src/utils/Debt.js`). */\nconst MAX_MONTHS = 100 * MONTHS_PER_YEAR\n\nexport interface PayoffResult {\n /** Monthly payments until the balance reaches zero. */\n paymentCount: number\n totalInterestPaid: number\n}\n\nconst monthlyRateOf = (annualRatePercent: number) => annualRatePercent / (MONTHS_PER_YEAR * 100)\n\n// http://financeformulas.net/Solve-for-Number-of-Periods-PV-and-FV.html\nexport const paymentCountFor = (balance: number, monthlyRate: number, payment: number): number =>\n Math.ceil(\n monthlyRate === 0\n ? balance / payment\n : -Math.log(1 - (monthlyRate * balance) / payment) / Math.log(1 + monthlyRate),\n )\n\nconst totalInterestFor = (\n paymentCount: number,\n balance: number,\n monthlyRate: number,\n payment: number,\n): number => {\n if (monthlyRate === 0) return 0\n\n let total = 0\n\n for (let month = 0; month < paymentCount; month += 1) {\n const growth = Math.pow(1 + monthlyRate, month)\n const openingBalance = balance * growth - payment * ((growth - 1) / monthlyRate)\n\n total += openingBalance * monthlyRate\n }\n\n return total\n}\n\nexport const isPayoffPossible = (\n annualRatePercent: number,\n balance: number,\n payment: number,\n): boolean => {\n if (!Number.isFinite(annualRatePercent) || !Number.isFinite(balance) || !(payment > 0)) {\n return false\n }\n\n const paymentCount = paymentCountFor(balance, monthlyRateOf(annualRatePercent), payment)\n\n return Number.isFinite(paymentCount) && paymentCount <= MAX_MONTHS\n}\n\nexport const calculatePayoff = (\n annualRatePercent: number,\n balance: number,\n payment: number,\n): PayoffResult => {\n const monthlyRate = monthlyRateOf(annualRatePercent)\n const paymentCount = paymentCountFor(balance, monthlyRate, payment)\n\n return {\n paymentCount,\n totalInterestPaid: totalInterestFor(paymentCount, balance, monthlyRate, payment),\n }\n}\n"],"mappings":"AAGA,IAAM,IAAa,MAQb,IAAA,CAAiB,MAA8B,IAAqB,MAG7D,IAAA,CAAmB,GAAiB,GAAqB,MACpE,KAAK,KACH,MAAgB,IACZ,IAAU,IACV,CAAC,KAAK,IAAI,IAAK,IAAc,IAAW,CAAO,IAAI,KAAK,IAAI,IAAI,CAAW,CACjF,GAEI,IAAA,CACJ,GACA,GACA,GACA,MACW;AACX,MAAI,MAAgB,EAAG,QAAO;AAE9B,MAAI,IAAQ;AAEZ,WAAS,IAAQ,GAAG,IAAQ,GAAc,KAAS,GAAG;AACpD,UAAM,IAAS,KAAK,IAAI,IAAI,GAAa,CAAK,GACxC,IAAiB,IAAU,IAAS,MAAY,IAAS,KAAK;AAEpE,IAAA,KAAS,IAAiB;AAAA,EAC5B;AAEA,SAAO;AACT,GAEa,IAAA,CACX,GACA,GACA,MACY;AACZ,MAAI,CAAC,OAAO,SAAS,CAAiB,KAAK,CAAC,OAAO,SAAS,CAAO,KAAK,EAAE,IAAU,GAClF,QAAO;AAGT,QAAM,IAAe,EAAgB,GAAS,EAAc,CAAiB,GAAG,CAAO;AAEvF,SAAO,OAAO,SAAS,CAAY,KAAK,KAAgB;AAC1D,GAEa,IAAA,CACX,GACA,GACA,MACiB;AACjB,QAAM,IAAc,EAAc,CAAiB,GAC7C,IAAe,EAAgB,GAAS,GAAa,CAAO;AAElE,SAAO;AAAA,IACL,cAAA;AAAA,IACA,mBAAmB,EAAiB,GAAc,GAAS,GAAa,CAAO;AAAA,EACjF;AACF"}
|
|
@@ -11,7 +11,9 @@ var _ = {
|
|
|
11
11
|
RECURRING_TRANSACTION_ACTION_BLOCK: "recurring_transaction_block",
|
|
12
12
|
TRANSACTION_LIST_ACTION_BLOCK: "transaction_list_block",
|
|
13
13
|
REMAINING_CASH_ACTION_BLOCK: "remaining_cash_block",
|
|
14
|
-
AMOUNT_INPUT_MODAL_ACTION_BLOCK: "amount_input_modal_block"
|
|
14
|
+
AMOUNT_INPUT_MODAL_ACTION_BLOCK: "amount_input_modal_block",
|
|
15
|
+
EMERGENCY_SAVINGS_ACTION_BLOCK: "emergency_savings_block",
|
|
16
|
+
PAYOFF_CALCULATOR_ACTION_BLOCK: "payoff_calculator_block"
|
|
15
17
|
};
|
|
16
18
|
export {
|
|
17
19
|
_ as actionBlocksKey
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actionBlocksKey.es.js","names":[],"sources":["../../../src/insights-v2/mappings/actionBlocksKey.ts"],"sourcesContent":["// Keys for the drawer drilldown registry in `blocks.ts`, extracted into their own module.\n//\n// Why: chart blocks (e.g. BarchartBlock, DoubleBarChartBlock) need\n// `TRANSCATION_HISTORY_ACTION_BLOCK` to tag a chart bar's drilldown context, but they are\n// themselves re-exported through `../blocks` -> `mappings/blocks.ts` imports from that same\n// barrel to build its `blocks` registry. Importing the key straight from `mappings/blocks.ts`\n// closed that loop into a circular import: evaluating `mappings/blocks.ts` pulled in the\n// `blocks` barrel, which (before it got to `ComponentBlocks`/`AccountBlock`) loaded\n// `BarchartBlock`, which imported back into the still-initializing `mappings/blocks.ts` —\n// tripping a \"Cannot access 'AccountBlock' before initialization\" TDZ error in Storybook/Vite.\n//\n// Keeping the keys here (no dependency on `mappings/blocks.ts`) lets chart blocks reference\n// them without re-entering that module.\n//\n// Names follow ditto: its registry ends every CTA block in `_block` and the V2 envelope copies those\n// names verbatim (`transaction_details_block`, `contact_support_block`, `make_transfer_block`).\nexport const actionBlocksKey = {\n PLACEHOLDER_ACTION_BLOCK: 'placeholder_block',\n MAKE_TRANSFER_ACTION_BLOCK: 'make_transfer_block',\n TRANSCATION_HISTORY_ACTION_BLOCK: 'transaction_history_block',\n TRANSACTION_DETAILS_ACTION_BLOCK: 'transaction_details_block',\n CONTACT_SUPPORT_ACTION_BLOCK: 'contact_support_block',\n FEEDBACK_MODAL_ACTION_BLOCK: 'feedback_modal_block',\n CONNECTION_DETAIL_ACTION_BLOCK: 'connection_detail_block',\n CONNECT_WIDGET_ACTION_BLOCK: 'connect_widget_block',\n SURVEY_MODAL_ACTION_BLOCK: 'survey_modal_block',\n RECURRING_TRANSACTION_ACTION_BLOCK: 'recurring_transaction_block',\n TRANSACTION_LIST_ACTION_BLOCK: 'transaction_list_block',\n REMAINING_CASH_ACTION_BLOCK: 'remaining_cash_block',\n AMOUNT_INPUT_MODAL_ACTION_BLOCK: 'amount_input_modal_block',\n}\n"],"mappings":"AAgBA,IAAa,IAAkB;AAAA,EAC7B,0BAA0B;AAAA,EAC1B,4BAA4B;AAAA,EAC5B,kCAAkC;AAAA,EAClC,kCAAkC;AAAA,EAClC,8BAA8B;AAAA,EAC9B,6BAA6B;AAAA,EAC7B,gCAAgC;AAAA,EAChC,6BAA6B;AAAA,EAC7B,2BAA2B;AAAA,EAC3B,oCAAoC;AAAA,EACpC,+BAA+B;AAAA,EAC/B,6BAA6B;AAAA,EAC7B,iCAAiC;
|
|
1
|
+
{"version":3,"file":"actionBlocksKey.es.js","names":[],"sources":["../../../src/insights-v2/mappings/actionBlocksKey.ts"],"sourcesContent":["// Keys for the drawer drilldown registry in `blocks.ts`, extracted into their own module.\n//\n// Why: chart blocks (e.g. BarchartBlock, DoubleBarChartBlock) need\n// `TRANSCATION_HISTORY_ACTION_BLOCK` to tag a chart bar's drilldown context, but they are\n// themselves re-exported through `../blocks` -> `mappings/blocks.ts` imports from that same\n// barrel to build its `blocks` registry. Importing the key straight from `mappings/blocks.ts`\n// closed that loop into a circular import: evaluating `mappings/blocks.ts` pulled in the\n// `blocks` barrel, which (before it got to `ComponentBlocks`/`AccountBlock`) loaded\n// `BarchartBlock`, which imported back into the still-initializing `mappings/blocks.ts` —\n// tripping a \"Cannot access 'AccountBlock' before initialization\" TDZ error in Storybook/Vite.\n//\n// Keeping the keys here (no dependency on `mappings/blocks.ts`) lets chart blocks reference\n// them without re-entering that module.\n//\n// Names follow ditto: its registry ends every CTA block in `_block` and the V2 envelope copies those\n// names verbatim (`transaction_details_block`, `contact_support_block`, `make_transfer_block`).\nexport const actionBlocksKey = {\n PLACEHOLDER_ACTION_BLOCK: 'placeholder_block',\n MAKE_TRANSFER_ACTION_BLOCK: 'make_transfer_block',\n TRANSCATION_HISTORY_ACTION_BLOCK: 'transaction_history_block',\n TRANSACTION_DETAILS_ACTION_BLOCK: 'transaction_details_block',\n CONTACT_SUPPORT_ACTION_BLOCK: 'contact_support_block',\n FEEDBACK_MODAL_ACTION_BLOCK: 'feedback_modal_block',\n CONNECTION_DETAIL_ACTION_BLOCK: 'connection_detail_block',\n CONNECT_WIDGET_ACTION_BLOCK: 'connect_widget_block',\n SURVEY_MODAL_ACTION_BLOCK: 'survey_modal_block',\n RECURRING_TRANSACTION_ACTION_BLOCK: 'recurring_transaction_block',\n TRANSACTION_LIST_ACTION_BLOCK: 'transaction_list_block',\n REMAINING_CASH_ACTION_BLOCK: 'remaining_cash_block',\n AMOUNT_INPUT_MODAL_ACTION_BLOCK: 'amount_input_modal_block',\n EMERGENCY_SAVINGS_ACTION_BLOCK: 'emergency_savings_block',\n PAYOFF_CALCULATOR_ACTION_BLOCK: 'payoff_calculator_block',\n}\n"],"mappings":"AAgBA,IAAa,IAAkB;AAAA,EAC7B,0BAA0B;AAAA,EAC1B,4BAA4B;AAAA,EAC5B,kCAAkC;AAAA,EAClC,kCAAkC;AAAA,EAClC,8BAA8B;AAAA,EAC9B,6BAA6B;AAAA,EAC7B,gCAAgC;AAAA,EAChC,6BAA6B;AAAA,EAC7B,2BAA2B;AAAA,EAC3B,oCAAoC;AAAA,EACpC,+BAA+B;AAAA,EAC/B,6BAA6B;AAAA,EAC7B,iCAAiC;AAAA,EACjC,gCAAgC;AAAA,EAChC,gCAAgC;AAClC"}
|
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
import { ContactSupportActionBlock as p } from "../actionBlocks/ContactSupportActionBlock.es.js";
|
|
2
|
-
import { hasDrawerBlock as
|
|
2
|
+
import { hasDrawerBlock as z } from "./hasDrawerBlock.es.js";
|
|
3
3
|
import { actionBlocksKey as o } from "./actionBlocksKey.es.js";
|
|
4
|
-
import { BarchartBlock as
|
|
4
|
+
import { BarchartBlock as m } from "../blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js";
|
|
5
5
|
import { DoubleBarChartBlock as _ } from "../blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js";
|
|
6
6
|
import s from "../blocks/ChartBlocks/StepChartBlock/StepChartBlock.es.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import C from "../blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js";
|
|
8
|
+
import k from "../blocks/ChartBlocks/DoubleProgressBarBlock/DoubleProgressBarBlock.es.js";
|
|
9
9
|
import B from "../blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js";
|
|
10
10
|
import u from "../blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js";
|
|
11
|
-
import
|
|
11
|
+
import f from "../blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js";
|
|
12
12
|
import { BudgetBlock as A } from "../blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js";
|
|
13
|
-
import
|
|
13
|
+
import T from "../blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js";
|
|
14
14
|
import O from "../blocks/ComponentBlocks/GoalsBlock/GoalsBlock.es.js";
|
|
15
|
-
import
|
|
15
|
+
import N from "../blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendDaysBlock.es.js";
|
|
16
16
|
import n from "../blocks/ComponentBlocks/RepeatingTransactionBlock/RepeatingTransactionBlock.es.js";
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { TransactionBlock as
|
|
17
|
+
import b from "../blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
|
|
18
|
+
import g from "../blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.es.js";
|
|
19
|
+
import { TransactionBlock as d } from "../blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js";
|
|
20
20
|
import I from "../blocks/ComponentBlocks/UpcomingSubscriptionBlock/UpcomingSubscriptionBlock.es.js";
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import { SVGImageBlock as
|
|
21
|
+
import P from "../blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js";
|
|
22
|
+
import L from "../blocks/ImageBlocks/ImageBlock.es.js";
|
|
23
|
+
import { SVGImageBlock as S } from "../blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
|
|
24
24
|
import { FeedbackModalActionBlock as h } from "../actionBlocks/FeedbackModalActionBlock.es.js";
|
|
25
|
-
import { ConnectionDetailActionBlock as
|
|
26
|
-
import { ConnectWidgetActionBlock as
|
|
27
|
-
import { SurveyModalActionBlock as
|
|
28
|
-
import { PlaceholderActionBlock as
|
|
29
|
-
import { getMakeTransferDrawerTitle as
|
|
30
|
-
import { MakeTransferActionBlockLayer as
|
|
25
|
+
import { ConnectionDetailActionBlock as D } from "../actionBlocks/ConnectionDetailActionBlock.es.js";
|
|
26
|
+
import { ConnectWidgetActionBlock as E } from "../actionBlocks/ConnectWidgetActionBlock.es.js";
|
|
27
|
+
import { SurveyModalActionBlock as R } from "../actionBlocks/SurveyModalActionBlock.es.js";
|
|
28
|
+
import { PlaceholderActionBlock as y } from "../actionBlocks/PlaceholderActionBlock.es.js";
|
|
29
|
+
import { getMakeTransferDrawerTitle as K } from "../actionBlocks/MakeTransferActionBlock/layout.es.js";
|
|
30
|
+
import { MakeTransferActionBlockLayer as v } from "../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js";
|
|
31
31
|
import { getDrawerHeaderTitle as M } from "../actionBlocks/TransactionHistoryBlock/utils.es.js";
|
|
32
32
|
import { TransactionDetailsBlock as w } from "../actionBlocks/TransactionDetailsBlock/TransactionDetailsBlock.es.js";
|
|
33
|
-
import { useTransactionDetailsPrepare as
|
|
34
|
-
import { TransactionHistoryBlock as
|
|
35
|
-
import { useRecurringTransactionPrepare as
|
|
36
|
-
import { RecurringTransactionBlock as
|
|
37
|
-
import { TransactionListBlock as
|
|
38
|
-
import { RemainingCashBlock as
|
|
39
|
-
import { AmountInputModalBlock as
|
|
40
|
-
|
|
33
|
+
import { useTransactionDetailsPrepare as c } from "../actionBlocks/TransactionDetailsBlock/useTransactionDetailsPrepare.es.js";
|
|
34
|
+
import { TransactionHistoryBlock as G } from "../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js";
|
|
35
|
+
import { useRecurringTransactionPrepare as l } from "../actionBlocks/RecurringTransactionBlock/useRecurringTransactionPrepare.es.js";
|
|
36
|
+
import { RecurringTransactionBlock as U } from "../actionBlocks/RecurringTransactionBlock/RecurringTransactionBlock.es.js";
|
|
37
|
+
import { TransactionListBlock as F } from "../actionBlocks/TransactionListBlock/TransactionListBlock.es.js";
|
|
38
|
+
import { RemainingCashBlock as H } from "../actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js";
|
|
39
|
+
import { AmountInputModalBlock as x } from "../actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js";
|
|
40
|
+
import { EmergencySavingsBlock as Y } from "../actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js";
|
|
41
|
+
import { PayoffCalculatorBlock as V, usePayoffCalculatorPrepare as W } from "../actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js";
|
|
42
|
+
var a = (t) => {
|
|
41
43
|
}, r = (t) => ({
|
|
42
44
|
get Component() {
|
|
43
45
|
return t().Component;
|
|
@@ -51,98 +53,108 @@ var e = (t) => {
|
|
|
51
53
|
get presentation() {
|
|
52
54
|
return t().presentation;
|
|
53
55
|
}
|
|
54
|
-
}),
|
|
56
|
+
}), vo = {
|
|
55
57
|
[o.PLACEHOLDER_ACTION_BLOCK]: r(() => ({
|
|
56
|
-
Component:
|
|
57
|
-
usePrepare:
|
|
58
|
+
Component: y,
|
|
59
|
+
usePrepare: a,
|
|
58
60
|
title: () => "Action Block Layer Drilldown"
|
|
59
61
|
})),
|
|
60
62
|
[o.MAKE_TRANSFER_ACTION_BLOCK]: r(() => ({
|
|
61
|
-
Component:
|
|
62
|
-
usePrepare:
|
|
63
|
-
title:
|
|
63
|
+
Component: v,
|
|
64
|
+
usePrepare: a,
|
|
65
|
+
title: K
|
|
64
66
|
})),
|
|
65
67
|
[o.TRANSCATION_HISTORY_ACTION_BLOCK]: r(() => ({
|
|
66
|
-
Component:
|
|
67
|
-
usePrepare:
|
|
68
|
+
Component: G,
|
|
69
|
+
usePrepare: a,
|
|
68
70
|
title: M
|
|
69
71
|
})),
|
|
70
72
|
[o.TRANSACTION_DETAILS_ACTION_BLOCK]: r(() => ({
|
|
71
73
|
Component: w,
|
|
72
|
-
usePrepare:
|
|
74
|
+
usePrepare: c,
|
|
73
75
|
title: () => "Transaction Details"
|
|
74
76
|
})),
|
|
75
77
|
[o.RECURRING_TRANSACTION_ACTION_BLOCK]: r(() => ({
|
|
76
|
-
Component:
|
|
77
|
-
usePrepare:
|
|
78
|
-
title: (t,
|
|
78
|
+
Component: U,
|
|
79
|
+
usePrepare: l,
|
|
80
|
+
title: (t, e) => e.recurring?.expense_details ?? ""
|
|
79
81
|
})),
|
|
80
82
|
[o.REMAINING_CASH_ACTION_BLOCK]: r(() => ({
|
|
81
|
-
Component:
|
|
82
|
-
usePrepare:
|
|
83
|
-
title: (t,
|
|
83
|
+
Component: H,
|
|
84
|
+
usePrepare: l,
|
|
85
|
+
title: (t, e) => e.insights_feed?.remaining_cash?.title ?? ""
|
|
84
86
|
})),
|
|
85
87
|
[o.CONTACT_SUPPORT_ACTION_BLOCK]: r(() => ({
|
|
86
88
|
Component: p,
|
|
87
|
-
usePrepare:
|
|
88
|
-
title: (t,
|
|
89
|
+
usePrepare: a,
|
|
90
|
+
title: (t, e) => e.help?.request_support ?? ""
|
|
89
91
|
})),
|
|
90
92
|
[o.FEEDBACK_MODAL_ACTION_BLOCK]: r(() => ({
|
|
91
93
|
Component: h,
|
|
92
|
-
usePrepare:
|
|
94
|
+
usePrepare: a,
|
|
93
95
|
presentation: "modal"
|
|
94
96
|
})),
|
|
95
97
|
[o.CONNECTION_DETAIL_ACTION_BLOCK]: r(() => ({
|
|
96
|
-
Component:
|
|
97
|
-
usePrepare:
|
|
98
|
-
title: (t,
|
|
98
|
+
Component: D,
|
|
99
|
+
usePrepare: a,
|
|
100
|
+
title: (t, e) => e.insights_feed?.connection_details?.connection_details_drawer_title ?? ""
|
|
99
101
|
})),
|
|
100
102
|
[o.CONNECT_WIDGET_ACTION_BLOCK]: r(() => ({
|
|
101
|
-
Component:
|
|
102
|
-
usePrepare:
|
|
103
|
+
Component: E,
|
|
104
|
+
usePrepare: a
|
|
103
105
|
})),
|
|
104
106
|
[o.SURVEY_MODAL_ACTION_BLOCK]: r(() => ({
|
|
105
|
-
Component:
|
|
106
|
-
usePrepare:
|
|
107
|
+
Component: R,
|
|
108
|
+
usePrepare: a,
|
|
107
109
|
presentation: "modal"
|
|
108
110
|
})),
|
|
109
111
|
[o.TRANSACTION_LIST_ACTION_BLOCK]: r(() => ({
|
|
110
|
-
Component:
|
|
111
|
-
usePrepare:
|
|
112
|
-
title: (t,
|
|
112
|
+
Component: F,
|
|
113
|
+
usePrepare: c,
|
|
114
|
+
title: (t, e, i) => i?.insights_payload?.title ?? ""
|
|
113
115
|
})),
|
|
114
116
|
[o.AMOUNT_INPUT_MODAL_ACTION_BLOCK]: r(() => ({
|
|
115
|
-
Component:
|
|
117
|
+
Component: x,
|
|
116
118
|
presentation: "modal",
|
|
117
|
-
usePrepare:
|
|
119
|
+
usePrepare: a
|
|
120
|
+
})),
|
|
121
|
+
[o.EMERGENCY_SAVINGS_ACTION_BLOCK]: r(() => ({
|
|
122
|
+
Component: Y,
|
|
123
|
+
usePrepare: a,
|
|
124
|
+
title: (t, e, i) => i?.insights_payload?.title ?? ""
|
|
125
|
+
})),
|
|
126
|
+
[o.PAYOFF_CALCULATOR_ACTION_BLOCK]: r(() => ({
|
|
127
|
+
Component: V,
|
|
128
|
+
usePrepare: W,
|
|
129
|
+
title: (t, e) => e.insights_feed?.payoff_calculator?.title ?? ""
|
|
118
130
|
}))
|
|
119
|
-
},
|
|
131
|
+
}, Mo = {
|
|
120
132
|
account_block: u,
|
|
121
|
-
account_switch_block:
|
|
133
|
+
account_switch_block: f,
|
|
122
134
|
direct_deposit_block: B,
|
|
123
|
-
bar_chart_block:
|
|
135
|
+
bar_chart_block: m,
|
|
124
136
|
budget_block: A,
|
|
125
|
-
debts_block:
|
|
126
|
-
donut_chart_block:
|
|
137
|
+
debts_block: T,
|
|
138
|
+
donut_chart_block: C,
|
|
127
139
|
double_bar_chart_block: _,
|
|
128
|
-
double_progress_bar_block:
|
|
140
|
+
double_progress_bar_block: k,
|
|
129
141
|
goals_block: O,
|
|
130
|
-
image_block:
|
|
131
|
-
no_spend_days_block:
|
|
142
|
+
image_block: L,
|
|
143
|
+
no_spend_days_block: N,
|
|
132
144
|
repeating_transaction_block: n,
|
|
133
|
-
save_extra_block:
|
|
134
|
-
savings_opportunity_block:
|
|
145
|
+
save_extra_block: b,
|
|
146
|
+
savings_opportunity_block: g,
|
|
135
147
|
step_chart_block: s,
|
|
136
|
-
svg_image_block:
|
|
148
|
+
svg_image_block: S,
|
|
137
149
|
upcoming_bill_block: n,
|
|
138
150
|
upcoming_subscription_block: I,
|
|
139
|
-
withdrawal_block:
|
|
140
|
-
transaction_block:
|
|
151
|
+
withdrawal_block: P,
|
|
152
|
+
transaction_block: d
|
|
141
153
|
};
|
|
142
154
|
export {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
155
|
+
vo as actionBlocks,
|
|
156
|
+
Mo as blocks,
|
|
157
|
+
z as hasDrawerBlock
|
|
146
158
|
};
|
|
147
159
|
|
|
148
160
|
//# sourceMappingURL=blocks.es.js.map
|