@mx-cartographer/experiences 9.7.26 → 9.7.27
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 +4 -0
- package/dist/core/types/Insights.d.ts +3 -0
- package/dist/core/types/Insights.es.js.map +1 -1
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +2 -0
- package/dist/insights-v2/blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendDaysBlock.d.ts +3 -0
- package/dist/insights-v2/blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendDaysBlock.es.js +101 -0
- package/dist/insights-v2/blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendDaysBlock.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendGraphic.d.ts +5 -0
- package/dist/insights-v2/blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendGraphic.es.js +108 -0
- package/dist/insights-v2/blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendGraphic.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/NoSpendDaysBlock/index.d.ts +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/index.d.ts +1 -0
- package/dist/insights-v2/index.es.js +87 -85
- package/dist/insights-v2/mappings/blocks.es.js +44 -42
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -252,6 +252,7 @@ export declare const BlockType: {
|
|
|
252
252
|
readonly DoubleBarChartBlock: "double_bar_chart_block";
|
|
253
253
|
readonly DoubleProgressBarBlock: "double_progress_bar_block";
|
|
254
254
|
readonly DebtsBlock: "debts_block";
|
|
255
|
+
readonly NoSpendDaysBlock: "no_spend_days_block";
|
|
255
256
|
readonly RepeatingTransactionBlock: "repeating_transaction_block";
|
|
256
257
|
readonly SaveExtraBlock: "save_extra_block";
|
|
257
258
|
readonly SavingsOpportunityBlock: "savings_opportunity_block";
|
|
@@ -352,4 +353,6 @@ export interface InstanceSlot {
|
|
|
352
353
|
monthly_payment?: number;
|
|
353
354
|
/** Annual interest rate as a percentage (e.g. `19.99`); the block formats it as a percent. */
|
|
354
355
|
interest_rate?: number;
|
|
356
|
+
start_date?: string;
|
|
357
|
+
no_spend_days?: string[];
|
|
355
358
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Insights.es.js","names":[],"sources":["../../../src/core/types/Insights.ts"],"sourcesContent":["// ============ Core InsightsV2 Types ============\n\nimport { InsightsInstanceSlotData } from './InsightsInstanceSlotData'\n\nexport interface ThemedSVGImageProps {\n divProps?: React.HTMLAttributes<HTMLDivElement>\n image: React.ComponentType<React.SVGProps<SVGSVGElement>>\n isMini?: boolean\n}\n\n/**\n * Emitted by a block when the user drills into a specific datum (e.g. clicks a\n * chart bar). Named fields rather than positional args so blocks with differing\n * shapes can extend this without the call sites transposing values.\n */\nexport interface DrilldownPayload {\n chartBarIndex: number\n tabIndex?: number\n transaction_guid?: string\n block?: string\n}\n\n/**\n * Which envelope a beat was fetched with. `embedded` (the transaction-row pill + details-drawer\n * card) and `notification` are V2 additions; a surface asks for one with `widget_type=` on the fetch.\n */\nexport type WidgetType = 'full' | 'mini' | 'micro' | 'embedded' | 'notification'\n\n/**\n * V2: the transaction-row tag, its own small section of the `embedded` envelope (the same grammar\n * as `description` / `footer`, with room for a tone or an icon later). Omitted for an insight that\n * tags no transaction row. It deliberately is *not* `short_title`, which stays a per-variant\n * attribute with a second consumer (the bank-holiday sub-header).\n */\nexport interface Pill {\n text: string\n}\n\n/**\n * V2: facts a drilldown shows that the card does not (e.g. the account number for the Transaction\n * Details drawer), or the guid list a list drawer shows (`transaction_guids`). Scalars or string\n * lists, shared by every CTA of the card, omitted when the insight has none. Never carries copy or\n * user actions (memo, tags, hide, flag come from the transaction store). Values come from the\n * server, so a reader still checks each value's runtime shape.\n */\nexport type DrilldownData = Record<string, string | number | boolean | null | string[]>\n\nexport interface InsightsPayload {\n widget_type: WidgetType\n instance_slot: InstanceSlot\n /**\n * V1 only. The v2 contract carries everything a block needs on `instance_slot.data`,\n * and omits this key entirely (see the LargeTransactionV2 payload). Blocks that still require it\n * get it as a required field through `BlockProps`, which re-declares it.\n */\n instance_slot_data?: InsightsInstanceSlotData\n description: Description\n primary_cta?: PrimaryCTA\n secondary_cta?: SecondaryCTA\n title?: string\n sub_title?: Subtitle\n /**\n * V2 rename of `sub_title`: a flat string, with the logo promoted to the payload-level `logo`\n * field below. `sub_title` wins when both are present.\n */\n subtitle?: string\n /** V2: header logo paired with the flat `subtitle`: an entity guid or a status icon (`LogoRef`). */\n logo?: LogoRef\n /** V2: which design branch the backend picked (e.g. `no_merchant`). */\n variant?: string\n /** V2, `embedded` envelope only: the transaction-row pill. */\n pill?: Pill\n /**\n * V2: drilldown-only facts, e.g. `{ account_number: 'XXXXXXXX043' }`, or the guid list a list\n * drawer shows (`{ transaction_guids: [...] }`).\n */\n drilldown_data?: DrilldownData\n footer?: Footer\n /**\n * V2: the link inside the description: on the full card a drawer of its own (Low Account\n * Balance's \"Transactions ›\"); on mini and micro the card's action, sent instead of `primary_cta`.\n * Absent when the beat has no link.\n */\n in_description_cta?: InDescriptionCTA\n guid: string\n user_guid: string\n client_guid?: string\n /** Template name, e.g. `LargeTransactionV2`. */\n template?: string\n revision?: number\n /** Unix seconds. */\n created_at?: number\n /** Unix seconds. */\n updated_at?: number\n /** Unix seconds. */\n active_at?: number\n displayed_at?: number | null\n dismissed_at: number | null\n cta_clicked_at?: number | null\n has_been_displayed?: boolean\n is_dismissed: boolean\n is_deleted?: boolean\n is_hidden_by_system?: boolean\n is_obsolete?: boolean\n is_refreshable?: boolean\n is_sampled?: boolean\n is_zero_state?: boolean\n status?: string | null\n /**\n * V2 (LargeTransactionV2 onward): the entities the beat is about, carried on the payload so\n * action blocks do not have to reach back out to the beat envelope.\n */\n primary_account_guid?: string | null\n primary_transaction_guid?: string | null\n primary_category_guid?: string | null\n primary_merchant_guid?: string | null\n /**\n * V2: the repeating transaction a subscription beat is about (Upcoming Subscription, Subscription\n * Price Increase). Read by `recurring_transaction_block`, see\n * `actionBlocks/RecurringTransactionBlock/subscriptionBeats.ts`.\n */\n primary_repeating_transaction_guid?: string | null\n}\n\nexport interface Legends {\n label: string\n value: number\n additional_value?: number\n additional_value_type?: string\n value_type?: string\n}\n\nexport interface Logo {\n category_guid?: string\n category_name?: string\n institution_guid?: string\n institution_name?: string\n logo_color?: string\n /** Draw the `logo_name` icon filled (V2 `ICO-` logos). */\n logo_fill?: boolean\n logo_name?: string\n merchant_guid?: string\n merchant_name?: string\n}\n\nexport interface Subtitle {\n logo?: Logo\n text: string\n}\n\n/**\n * A V2 logo, shared by the header (`InsightsPayload.logo`) and every instance-slot row. It takes\n * one of two shapes:\n *\n * - **Entity**: `guid`, whose prefix (`INS-` / `MCH-` / `CAT-`) picks the logo component, plus an\n * optional `fallback_guid` for when that component's asset cannot load. Today that is the\n * category behind an `MCH-` guid, which `MerchantLogo` shows as a tile when the merchant image\n * is missing.\n * - **Status icon**: `icon` (an mx-icons name, e.g. `warning`) and `color` (a theme palette path,\n * e.g. `error.main`), for subheaders that show a state rather than an entity (V1's\n * `logo_name` / `logo_color`).\n *\n * `alt` is the accessible name for either shape. A logo sends one shape; if it sends both, `icon`\n * wins, as `logo_name` does in V1's `SubHeader`.\n */\nexport interface LogoRef {\n alt?: string\n color?: string\n fallback_guid?: string\n guid?: string\n icon?: string\n}\n\nexport interface CategoryLogo {\n category_guid: string\n category_name: string\n}\n\nexport interface MerchantLogo {\n merchant_guid: string\n merchant_name: string\n}\n\nexport interface InstitutionLogo {\n institution_guid: string\n institution_name: string\n}\n\nexport interface Description {\n text: string\n html_text: string\n}\n\n/**\n * Post message a CTA press sends to the host, resolved by the backend for the beat's current\n * state. Absent/null = the backend has not described one: the frontend uses the template's\n * interim `ctaPostMessages` entry if there is one, else sends no message. `payload` carries only\n * beat-specific extras; the frontend always adds `beat_guid`, `beat_template`, `user_guid` and\n * `action_string`.\n */\nexport interface CtaPostMessageMetadata {\n /** Post message event; defaults to `beat/cta`. */\n event?: string | null\n /** Operation the host should perform, e.g. `op_1`, `op_2`, `op_3`. Defaults to `op_1`. */\n action?: string | null\n /** Beat-specific fields merged into the message metadata (account ids, amounts, ...). */\n payload?: Record<string, unknown> | null\n}\n\nexport interface PrimaryCTA {\n label: string\n block: string\n variant?: string | null\n /**\n * What pressing the CTA does beyond opening its block, named by the backend (ditto\n * `primary_cta_action`, passed through by tupac). Looked up in `insights-v2/ctaActions`;\n * null / absent / unknown means the CTA only opens its block or posts its message.\n */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n}\n\nexport interface SecondaryCTA {\n label: string\n /**\n * Drawer block to open. `null` when the CTA opens nothing (ditto `secondary_cta_block: null`,\n * e.g. Fee Detected's \"Contact Support\"): the press posts its message to the host instead.\n */\n block: string | null\n variant?: string | null\n /** See `PrimaryCTA.action_key` (ditto `secondary_cta_action`). */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n}\n\n/**\n * The description link: its label, the action block it opens and, like a CTA's, the variant that\n * tells that block what to show (ditto's `in_description_cta_variant`, e.g. `low_balance`). On mini\n * and micro it words the card's action; `block` is empty when that action opens no drawer.\n */\nexport interface InDescriptionCTA {\n label: string\n block?: string\n variant?: string | null\n action_key?: string | null\n}\n\nexport interface Footer {\n /** V1: a pre-formatted date string. */\n date?: string\n /**\n * The account label, on both V1 and V2. The backend resolves the plurality: one account sends\n * its name (e.g. `Epic Bank`), several send a localized count (e.g. `2 Accounts`), none sends\n * `null` (tupac's `footer_account_label` returns nil for a beat with no accounts, as Payday Cash\n * Left Over Status does). There is deliberately no separate `accounts` key.\n */\n account?: string | null\n /**\n * V2 (LargeTransactionV2 onward): unix seconds, formatted by `Footer` for display.\n * Replaces `date`; `date` wins when a beat somehow sends both.\n */\n timestamp?: number\n}\n\n// ============ Instance Slot Types ============\n// Values are the snake_case block names the backend sends on a beat's instance slot; the PascalCase\n// keys stay as friendly references (e.g. BlockType.BarChartBlock === 'bar_chart_block').\nexport const BlockType = {\n AccountBlock: 'account_block',\n AccountSwitchBlock: 'account_switch_block',\n BarChartBlock: 'bar_chart_block',\n BudgetBlock: 'budget_block',\n DirectDepositBlock: 'direct_deposit_block',\n ImageBlock: 'image_block',\n TransactionBlock: 'transaction_block',\n DonutChartBlock: 'donut_chart_block',\n DoubleBarChartBlock: 'double_bar_chart_block',\n DoubleProgressBarBlock: 'double_progress_bar_block',\n DebtsBlock: 'debts_block',\n RepeatingTransactionBlock: 'repeating_transaction_block',\n SaveExtraBlock: 'save_extra_block',\n SavingsOpportunityBlock: 'savings_opportunity_block',\n StepChartBlock: 'step_chart_block',\n SVGImageBlock: 'svg_image_block',\n UpcomingBillBlock: 'upcoming_bill_block',\n UpcomingSubscriptionBlock: 'upcoming_subscription_block',\n WithdrawalBlock: 'withdrawal_block',\n} as const\n\nexport type BlockType = (typeof BlockType)[keyof typeof BlockType]\n\n/**\n * A pre-localized row on a V2 instance slot. The backend resolves the copy and formatting; the\n * logo is a `LogoRef` (an entity guid or a status icon, see `logoFromRef`).\n */\nexport interface InstanceSlotRow {\n amount?: number\n logo?: LogoRef\n primary_text?: string\n secondary_text?: string\n}\n\n/**\n * V2: the slots a block's variant filled, keyed by slot name; ditto owns the names and omits any\n * slot it has no value for (`lib/ditto/blocks/<block>.yml`). Read with `slot()`, which names the\n * kind the caller expects.\n */\nexport interface InstanceSlotData {\n [slot: string]: unknown\n}\n\n/**\n * Reads one slot off a block's `data`; undefined when ditto did not fill it.\n *\n * The caller names the kind, because the slot's kind lives in the block's ditto schema and not\n * here — a block fills slots with whatever its card needs, so no fixed list of kinds would hold\n * (`account_switch_block` alone carries a boolean and `budget_block` a nested object).\n */\nexport const slot = <T = unknown>(\n data: InstanceSlotData | undefined,\n name: string,\n): T | undefined => data?.[name] as T | undefined\n\n/**\n * V2: which block renders this beat's content, and what it renders.\n *\n * `block` is optional: a beat whose template has no ditto config arrives as an empty `{}` and the\n * card renders its copy and CTAs alone, so a reader cannot assume a block is named. One interface\n * with `block` optional rather than a union with `Record<string, never>`, which TypeScript absorbs\n * — that union left `block` reading as required and typed a promise it did not keep.\n *\n * `variant` is optional for the same reason — the empty `{}` carries neither. Every ditto beat\n * file that names a block also names a variant, so a *filled* slot always has one; ditto drops a\n * nil variant rather than sending null, which is why the type is `string | null | undefined`.\n */\nexport interface InstanceSlot {\n block?: BlockType\n variant?: string | null\n /** The slots this block's variant declares in ditto. */\n data?: InstanceSlotData\n // Direct Deposit block (Set Up Direct Deposit, Switch Direct Deposit, Missing\n // Interest Rate): account facts carried flat on the slot, beside `data`.\n /** Primary line on the hero card, e.g. \"Epic Bank Checking, *1234\". */\n account_name?: string\n /** Secondary line beneath the name, e.g. \"Checking Account\" / \"Credit Card\". */\n account_type?: string\n /** Status pill label, e.g. \"Direct Deposit Not Set Up\" / \"Interest Rate: 19.99% APR\". */\n status_text?: string\n institution_guid?: string\n institution_name?: string\n // Shared across multiple V2 component blocks:\n // `amount` — UpcomingBillBlock (projected bill), SavingsOpportunityBlock (coupon),\n // UpcomingSubscriptionBlock (price per cadence).\n // `merchant_guid` / `merchant_name` — UpcomingBillBlock (bill row logo + name),\n // UpcomingSubscriptionBlock (hero logo + name).\n /** Dollar amount (unformatted); the block formats it as currency. */\n amount?: number\n // Withdrawal block (Emergency Fund Withdrawal): one row flat on the slot - `amount` above is the\n // withdrawal, shown with its date line \"{amount_label} {withdrawal_date}\" over the balance row.\n /** Pre-localized lead-in for the date line, e.g. \"Withdrawn on\". */\n amount_label?: string\n /** The withdrawal's calendar day, `YYYY-MM-DD` (e.g. `2026-10-20`); the card formats it. */\n withdrawal_date?: string\n /** Account balance after the withdrawal (unformatted); the card formats it as currency. */\n balance?: number\n /** Pre-localized label for the balance row, e.g. \"Balance\". */\n balance_label?: string\n /** Merchant guid used to render the inline / hero logo via `LogoFromGuid` (`MCH-...`). */\n merchant_guid?: string\n /** Merchant display name — shown as logo alt text and as the merchant/hero label. */\n merchant_name?: string\n // Upcoming Bill block (Projected Bill Payment): the block derives the Sun→Sat week strip\n // around `due_date` at render time.\n /** Due date of the projected bill in ISO form (e.g. `2025-10-30`). */\n due_date?: string\n // Savings Opportunity block (Save An Extra, Potential Savings, Embedded): purely data-driven\n // coupon card. Backend sends the caption and the amount, plus `slot` to toggle the green\n // gradient background when the card is embedded in a parent surface that supplies its own.\n /** Caption shown above the amount, e.g. `Save an extra` or `Potential savings`. */\n label?: string\n /**\n * Whether to render the green gradient slot behind the coupon. Defaults to true. Backend sends\n * `false` when the coupon is embedded in a parent surface that supplies its own background.\n */\n slot?: boolean\n // Upcoming Subscription block: billing cadence for the price pill (`${amount} / ${cadence}`).\n /** Billing cadence word that trails the price, e.g. `month` or `year`. */\n cadence?: string\n // Account block (status on/off-track, deposit, payoff variants): card content carried flat on\n // the slot (the V2 contract drops `instance_slot_data`). `amount`, `label`, `merchant_guid`,\n // `merchant_name`, `institution_guid`, `institution_name` are shared fields declared above.\n /** Secondary line beneath the amount on the standard card, e.g. \"Remaining after expenses\". */\n sub_text?: string\n /** Header bar text (standard card) or the colored category strip label (deposit cards). */\n header_text?: string\n /** Generic-tile icon name used when no merchant/institution logo is available. */\n icon_name?: string\n /** Category guid used to render the deposit-card logo fallback. */\n category_guid?: string\n // Debts block: `amount` is the current balance; the shared account/institution fields above.\n /** Projected payoff date in ISO form (e.g. `2027-03-01`); the block formats it as month + year. */\n payoff_date?: string\n /** Monthly payment toward the debt (unformatted); the block formats it as currency. */\n monthly_payment?: number\n /** Annual interest rate as a percentage (e.g. `19.99`); the block formats it as a percent. */\n interest_rate?: number\n}\n"],"mappings":"AA8TA,IAAa,IAAA,CACX,GACA,MACkB,IAAO,CAAA"}
|
|
1
|
+
{"version":3,"file":"Insights.es.js","names":[],"sources":["../../../src/core/types/Insights.ts"],"sourcesContent":["// ============ Core InsightsV2 Types ============\n\nimport { InsightsInstanceSlotData } from './InsightsInstanceSlotData'\n\nexport interface ThemedSVGImageProps {\n divProps?: React.HTMLAttributes<HTMLDivElement>\n image: React.ComponentType<React.SVGProps<SVGSVGElement>>\n isMini?: boolean\n}\n\n/**\n * Emitted by a block when the user drills into a specific datum (e.g. clicks a\n * chart bar). Named fields rather than positional args so blocks with differing\n * shapes can extend this without the call sites transposing values.\n */\nexport interface DrilldownPayload {\n chartBarIndex: number\n tabIndex?: number\n transaction_guid?: string\n block?: string\n}\n\n/**\n * Which envelope a beat was fetched with. `embedded` (the transaction-row pill + details-drawer\n * card) and `notification` are V2 additions; a surface asks for one with `widget_type=` on the fetch.\n */\nexport type WidgetType = 'full' | 'mini' | 'micro' | 'embedded' | 'notification'\n\n/**\n * V2: the transaction-row tag, its own small section of the `embedded` envelope (the same grammar\n * as `description` / `footer`, with room for a tone or an icon later). Omitted for an insight that\n * tags no transaction row. It deliberately is *not* `short_title`, which stays a per-variant\n * attribute with a second consumer (the bank-holiday sub-header).\n */\nexport interface Pill {\n text: string\n}\n\n/**\n * V2: facts a drilldown shows that the card does not (e.g. the account number for the Transaction\n * Details drawer), or the guid list a list drawer shows (`transaction_guids`). Scalars or string\n * lists, shared by every CTA of the card, omitted when the insight has none. Never carries copy or\n * user actions (memo, tags, hide, flag come from the transaction store). Values come from the\n * server, so a reader still checks each value's runtime shape.\n */\nexport type DrilldownData = Record<string, string | number | boolean | null | string[]>\n\nexport interface InsightsPayload {\n widget_type: WidgetType\n instance_slot: InstanceSlot\n /**\n * V1 only. The v2 contract carries everything a block needs on `instance_slot.data`,\n * and omits this key entirely (see the LargeTransactionV2 payload). Blocks that still require it\n * get it as a required field through `BlockProps`, which re-declares it.\n */\n instance_slot_data?: InsightsInstanceSlotData\n description: Description\n primary_cta?: PrimaryCTA\n secondary_cta?: SecondaryCTA\n title?: string\n sub_title?: Subtitle\n /**\n * V2 rename of `sub_title`: a flat string, with the logo promoted to the payload-level `logo`\n * field below. `sub_title` wins when both are present.\n */\n subtitle?: string\n /** V2: header logo paired with the flat `subtitle`: an entity guid or a status icon (`LogoRef`). */\n logo?: LogoRef\n /** V2: which design branch the backend picked (e.g. `no_merchant`). */\n variant?: string\n /** V2, `embedded` envelope only: the transaction-row pill. */\n pill?: Pill\n /**\n * V2: drilldown-only facts, e.g. `{ account_number: 'XXXXXXXX043' }`, or the guid list a list\n * drawer shows (`{ transaction_guids: [...] }`).\n */\n drilldown_data?: DrilldownData\n footer?: Footer\n /**\n * V2: the link inside the description: on the full card a drawer of its own (Low Account\n * Balance's \"Transactions ›\"); on mini and micro the card's action, sent instead of `primary_cta`.\n * Absent when the beat has no link.\n */\n in_description_cta?: InDescriptionCTA\n guid: string\n user_guid: string\n client_guid?: string\n /** Template name, e.g. `LargeTransactionV2`. */\n template?: string\n revision?: number\n /** Unix seconds. */\n created_at?: number\n /** Unix seconds. */\n updated_at?: number\n /** Unix seconds. */\n active_at?: number\n displayed_at?: number | null\n dismissed_at: number | null\n cta_clicked_at?: number | null\n has_been_displayed?: boolean\n is_dismissed: boolean\n is_deleted?: boolean\n is_hidden_by_system?: boolean\n is_obsolete?: boolean\n is_refreshable?: boolean\n is_sampled?: boolean\n is_zero_state?: boolean\n status?: string | null\n /**\n * V2 (LargeTransactionV2 onward): the entities the beat is about, carried on the payload so\n * action blocks do not have to reach back out to the beat envelope.\n */\n primary_account_guid?: string | null\n primary_transaction_guid?: string | null\n primary_category_guid?: string | null\n primary_merchant_guid?: string | null\n /**\n * V2: the repeating transaction a subscription beat is about (Upcoming Subscription, Subscription\n * Price Increase). Read by `recurring_transaction_block`, see\n * `actionBlocks/RecurringTransactionBlock/subscriptionBeats.ts`.\n */\n primary_repeating_transaction_guid?: string | null\n}\n\nexport interface Legends {\n label: string\n value: number\n additional_value?: number\n additional_value_type?: string\n value_type?: string\n}\n\nexport interface Logo {\n category_guid?: string\n category_name?: string\n institution_guid?: string\n institution_name?: string\n logo_color?: string\n /** Draw the `logo_name` icon filled (V2 `ICO-` logos). */\n logo_fill?: boolean\n logo_name?: string\n merchant_guid?: string\n merchant_name?: string\n}\n\nexport interface Subtitle {\n logo?: Logo\n text: string\n}\n\n/**\n * A V2 logo, shared by the header (`InsightsPayload.logo`) and every instance-slot row. It takes\n * one of two shapes:\n *\n * - **Entity**: `guid`, whose prefix (`INS-` / `MCH-` / `CAT-`) picks the logo component, plus an\n * optional `fallback_guid` for when that component's asset cannot load. Today that is the\n * category behind an `MCH-` guid, which `MerchantLogo` shows as a tile when the merchant image\n * is missing.\n * - **Status icon**: `icon` (an mx-icons name, e.g. `warning`) and `color` (a theme palette path,\n * e.g. `error.main`), for subheaders that show a state rather than an entity (V1's\n * `logo_name` / `logo_color`).\n *\n * `alt` is the accessible name for either shape. A logo sends one shape; if it sends both, `icon`\n * wins, as `logo_name` does in V1's `SubHeader`.\n */\nexport interface LogoRef {\n alt?: string\n color?: string\n fallback_guid?: string\n guid?: string\n icon?: string\n}\n\nexport interface CategoryLogo {\n category_guid: string\n category_name: string\n}\n\nexport interface MerchantLogo {\n merchant_guid: string\n merchant_name: string\n}\n\nexport interface InstitutionLogo {\n institution_guid: string\n institution_name: string\n}\n\nexport interface Description {\n text: string\n html_text: string\n}\n\n/**\n * Post message a CTA press sends to the host, resolved by the backend for the beat's current\n * state. Absent/null = the backend has not described one: the frontend uses the template's\n * interim `ctaPostMessages` entry if there is one, else sends no message. `payload` carries only\n * beat-specific extras; the frontend always adds `beat_guid`, `beat_template`, `user_guid` and\n * `action_string`.\n */\nexport interface CtaPostMessageMetadata {\n /** Post message event; defaults to `beat/cta`. */\n event?: string | null\n /** Operation the host should perform, e.g. `op_1`, `op_2`, `op_3`. Defaults to `op_1`. */\n action?: string | null\n /** Beat-specific fields merged into the message metadata (account ids, amounts, ...). */\n payload?: Record<string, unknown> | null\n}\n\nexport interface PrimaryCTA {\n label: string\n block: string\n variant?: string | null\n /**\n * What pressing the CTA does beyond opening its block, named by the backend (ditto\n * `primary_cta_action`, passed through by tupac). Looked up in `insights-v2/ctaActions`;\n * null / absent / unknown means the CTA only opens its block or posts its message.\n */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n}\n\nexport interface SecondaryCTA {\n label: string\n /**\n * Drawer block to open. `null` when the CTA opens nothing (ditto `secondary_cta_block: null`,\n * e.g. Fee Detected's \"Contact Support\"): the press posts its message to the host instead.\n */\n block: string | null\n variant?: string | null\n /** See `PrimaryCTA.action_key` (ditto `secondary_cta_action`). */\n action_key?: string | null\n metadata?: CtaPostMessageMetadata | null\n}\n\n/**\n * The description link: its label, the action block it opens and, like a CTA's, the variant that\n * tells that block what to show (ditto's `in_description_cta_variant`, e.g. `low_balance`). On mini\n * and micro it words the card's action; `block` is empty when that action opens no drawer.\n */\nexport interface InDescriptionCTA {\n label: string\n block?: string\n variant?: string | null\n action_key?: string | null\n}\n\nexport interface Footer {\n /** V1: a pre-formatted date string. */\n date?: string\n /**\n * The account label, on both V1 and V2. The backend resolves the plurality: one account sends\n * its name (e.g. `Epic Bank`), several send a localized count (e.g. `2 Accounts`), none sends\n * `null` (tupac's `footer_account_label` returns nil for a beat with no accounts, as Payday Cash\n * Left Over Status does). There is deliberately no separate `accounts` key.\n */\n account?: string | null\n /**\n * V2 (LargeTransactionV2 onward): unix seconds, formatted by `Footer` for display.\n * Replaces `date`; `date` wins when a beat somehow sends both.\n */\n timestamp?: number\n}\n\n// ============ Instance Slot Types ============\n// Values are the snake_case block names the backend sends on a beat's instance slot; the PascalCase\n// keys stay as friendly references (e.g. BlockType.BarChartBlock === 'bar_chart_block').\nexport const BlockType = {\n AccountBlock: 'account_block',\n AccountSwitchBlock: 'account_switch_block',\n BarChartBlock: 'bar_chart_block',\n BudgetBlock: 'budget_block',\n DirectDepositBlock: 'direct_deposit_block',\n ImageBlock: 'image_block',\n TransactionBlock: 'transaction_block',\n DonutChartBlock: 'donut_chart_block',\n DoubleBarChartBlock: 'double_bar_chart_block',\n DoubleProgressBarBlock: 'double_progress_bar_block',\n DebtsBlock: 'debts_block',\n NoSpendDaysBlock: 'no_spend_days_block',\n RepeatingTransactionBlock: 'repeating_transaction_block',\n SaveExtraBlock: 'save_extra_block',\n SavingsOpportunityBlock: 'savings_opportunity_block',\n StepChartBlock: 'step_chart_block',\n SVGImageBlock: 'svg_image_block',\n UpcomingBillBlock: 'upcoming_bill_block',\n UpcomingSubscriptionBlock: 'upcoming_subscription_block',\n WithdrawalBlock: 'withdrawal_block',\n} as const\n\nexport type BlockType = (typeof BlockType)[keyof typeof BlockType]\n\n/**\n * A pre-localized row on a V2 instance slot. The backend resolves the copy and formatting; the\n * logo is a `LogoRef` (an entity guid or a status icon, see `logoFromRef`).\n */\nexport interface InstanceSlotRow {\n amount?: number\n logo?: LogoRef\n primary_text?: string\n secondary_text?: string\n}\n\n/**\n * V2: the slots a block's variant filled, keyed by slot name; ditto owns the names and omits any\n * slot it has no value for (`lib/ditto/blocks/<block>.yml`). Read with `slot()`, which names the\n * kind the caller expects.\n */\nexport interface InstanceSlotData {\n [slot: string]: unknown\n}\n\n/**\n * Reads one slot off a block's `data`; undefined when ditto did not fill it.\n *\n * The caller names the kind, because the slot's kind lives in the block's ditto schema and not\n * here — a block fills slots with whatever its card needs, so no fixed list of kinds would hold\n * (`account_switch_block` alone carries a boolean and `budget_block` a nested object).\n */\nexport const slot = <T = unknown>(\n data: InstanceSlotData | undefined,\n name: string,\n): T | undefined => data?.[name] as T | undefined\n\n/**\n * V2: which block renders this beat's content, and what it renders.\n *\n * `block` is optional: a beat whose template has no ditto config arrives as an empty `{}` and the\n * card renders its copy and CTAs alone, so a reader cannot assume a block is named. One interface\n * with `block` optional rather than a union with `Record<string, never>`, which TypeScript absorbs\n * — that union left `block` reading as required and typed a promise it did not keep.\n *\n * `variant` is optional for the same reason — the empty `{}` carries neither. Every ditto beat\n * file that names a block also names a variant, so a *filled* slot always has one; ditto drops a\n * nil variant rather than sending null, which is why the type is `string | null | undefined`.\n */\nexport interface InstanceSlot {\n block?: BlockType\n variant?: string | null\n /** The slots this block's variant declares in ditto. */\n data?: InstanceSlotData\n // Direct Deposit block (Set Up Direct Deposit, Switch Direct Deposit, Missing\n // Interest Rate): account facts carried flat on the slot, beside `data`.\n /** Primary line on the hero card, e.g. \"Epic Bank Checking, *1234\". */\n account_name?: string\n /** Secondary line beneath the name, e.g. \"Checking Account\" / \"Credit Card\". */\n account_type?: string\n /** Status pill label, e.g. \"Direct Deposit Not Set Up\" / \"Interest Rate: 19.99% APR\". */\n status_text?: string\n institution_guid?: string\n institution_name?: string\n // Shared across multiple V2 component blocks:\n // `amount` — UpcomingBillBlock (projected bill), SavingsOpportunityBlock (coupon),\n // UpcomingSubscriptionBlock (price per cadence).\n // `merchant_guid` / `merchant_name` — UpcomingBillBlock (bill row logo + name),\n // UpcomingSubscriptionBlock (hero logo + name).\n /** Dollar amount (unformatted); the block formats it as currency. */\n amount?: number\n // Withdrawal block (Emergency Fund Withdrawal): one row flat on the slot - `amount` above is the\n // withdrawal, shown with its date line \"{amount_label} {withdrawal_date}\" over the balance row.\n /** Pre-localized lead-in for the date line, e.g. \"Withdrawn on\". */\n amount_label?: string\n /** The withdrawal's calendar day, `YYYY-MM-DD` (e.g. `2026-10-20`); the card formats it. */\n withdrawal_date?: string\n /** Account balance after the withdrawal (unformatted); the card formats it as currency. */\n balance?: number\n /** Pre-localized label for the balance row, e.g. \"Balance\". */\n balance_label?: string\n /** Merchant guid used to render the inline / hero logo via `LogoFromGuid` (`MCH-...`). */\n merchant_guid?: string\n /** Merchant display name — shown as logo alt text and as the merchant/hero label. */\n merchant_name?: string\n // Upcoming Bill block (Projected Bill Payment): the block derives the Sun→Sat week strip\n // around `due_date` at render time.\n /** Due date of the projected bill in ISO form (e.g. `2025-10-30`). */\n due_date?: string\n // Savings Opportunity block (Save An Extra, Potential Savings, Embedded): purely data-driven\n // coupon card. Backend sends the caption and the amount, plus `slot` to toggle the green\n // gradient background when the card is embedded in a parent surface that supplies its own.\n /** Caption shown above the amount, e.g. `Save an extra` or `Potential savings`. */\n label?: string\n /**\n * Whether to render the green gradient slot behind the coupon. Defaults to true. Backend sends\n * `false` when the coupon is embedded in a parent surface that supplies its own background.\n */\n slot?: boolean\n // Upcoming Subscription block: billing cadence for the price pill (`${amount} / ${cadence}`).\n /** Billing cadence word that trails the price, e.g. `month` or `year`. */\n cadence?: string\n // Account block (status on/off-track, deposit, payoff variants): card content carried flat on\n // the slot (the V2 contract drops `instance_slot_data`). `amount`, `label`, `merchant_guid`,\n // `merchant_name`, `institution_guid`, `institution_name` are shared fields declared above.\n /** Secondary line beneath the amount on the standard card, e.g. \"Remaining after expenses\". */\n sub_text?: string\n /** Header bar text (standard card) or the colored category strip label (deposit cards). */\n header_text?: string\n /** Generic-tile icon name used when no merchant/institution logo is available. */\n icon_name?: string\n /** Category guid used to render the deposit-card logo fallback. */\n category_guid?: string\n // Debts block: `amount` is the current balance; the shared account/institution fields above.\n /** Projected payoff date in ISO form (e.g. `2027-03-01`); the block formats it as month + year. */\n payoff_date?: string\n /** Monthly payment toward the debt (unformatted); the block formats it as currency. */\n monthly_payment?: number\n /** Annual interest rate as a percentage (e.g. `19.99`); the block formats it as a percent. */\n interest_rate?: number\n start_date?: string\n no_spend_days?: string[]\n}\n"],"mappings":"AA+TA,IAAa,IAAA,CACX,GACA,MACkB,IAAO,CAAA"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { formatDate as g } from "../../../../core/constants/DateFormats.es.js";
|
|
2
|
+
import { useGlobalCopyStore as y } from "../../../../common/context/hooks.es.js";
|
|
3
|
+
import { slot as _ } from "../../../../core/types/Insights.es.js";
|
|
4
|
+
import { ConfettiOverlay as h } from "../../../components/shared/ConfettiOverlay.es.js";
|
|
5
|
+
import { parseDueDate as S } from "../RepeatingTransactionBlock/weekStrip.es.js";
|
|
6
|
+
import x from "./NoSpendGraphic.es.js";
|
|
7
|
+
import i from "@mui/material/Stack";
|
|
8
|
+
import { Text as b } from "@mxenabled/mxui";
|
|
9
|
+
import { CheckCircle as D } from "@mxenabled/mx-icons";
|
|
10
|
+
import { jsx as n, jsxs as u } from "react/jsx-runtime";
|
|
11
|
+
var k = 5, w = [
|
|
12
|
+
"sunday",
|
|
13
|
+
"monday",
|
|
14
|
+
"tuesday",
|
|
15
|
+
"wednesday",
|
|
16
|
+
"thursday",
|
|
17
|
+
"friday",
|
|
18
|
+
"saturday"
|
|
19
|
+
], N = (t) => [
|
|
20
|
+
t.getFullYear(),
|
|
21
|
+
t.getMonth() + 1,
|
|
22
|
+
t.getDate()
|
|
23
|
+
].map((r) => String(r).padStart(2, "0")).join("-"), v = (t, r) => Array.from({ length: 7 }, (l, s) => {
|
|
24
|
+
const o = new Date(t);
|
|
25
|
+
o.setDate(t.getDate() + s);
|
|
26
|
+
const a = N(o);
|
|
27
|
+
return {
|
|
28
|
+
iso: a,
|
|
29
|
+
key: w[o.getDay()],
|
|
30
|
+
label: g(o, { weekday: "short" }),
|
|
31
|
+
isNoSpend: r.includes(a)
|
|
32
|
+
};
|
|
33
|
+
}), M = ({ payload: t }) => {
|
|
34
|
+
const r = y().insights_feed?.general, l = r?.weekly_no_spending_component_alt_text, { instance_slot: s = {} } = t, o = (e) => _(s.data, e) ?? s[e], a = o("start_date"), d = typeof a == "string" ? S(a.slice(0, 10)) : null;
|
|
35
|
+
if (!d) return null;
|
|
36
|
+
const p = o("no_spend_days"), f = Array.isArray(p) ? p.map((e) => String(e).slice(0, 10)) : [], c = v(d, f), m = c.filter((e) => e.isNoSpend).length;
|
|
37
|
+
return /* @__PURE__ */ u(i, {
|
|
38
|
+
sx: {
|
|
39
|
+
alignItems: "center",
|
|
40
|
+
gap: 1,
|
|
41
|
+
position: "relative",
|
|
42
|
+
pt: 14,
|
|
43
|
+
px: 16
|
|
44
|
+
},
|
|
45
|
+
children: [
|
|
46
|
+
m >= k && /* @__PURE__ */ n(h, {}),
|
|
47
|
+
/* @__PURE__ */ n(x, {
|
|
48
|
+
count: m,
|
|
49
|
+
label: r?.dollar_bill
|
|
50
|
+
}),
|
|
51
|
+
/* @__PURE__ */ n(i, {
|
|
52
|
+
component: "ul",
|
|
53
|
+
direction: "row",
|
|
54
|
+
sx: {
|
|
55
|
+
justifyContent: "space-between",
|
|
56
|
+
listStyle: "none",
|
|
57
|
+
m: 0,
|
|
58
|
+
p: 0,
|
|
59
|
+
position: "relative",
|
|
60
|
+
width: "100%"
|
|
61
|
+
},
|
|
62
|
+
children: c.map((e) => /* @__PURE__ */ u(i, {
|
|
63
|
+
"aria-label": e.isNoSpend ? l?.[`${e.key}_no_spend_day`] : l?.[`${e.key}_is_a_spend_day`],
|
|
64
|
+
component: "li",
|
|
65
|
+
sx: {
|
|
66
|
+
alignItems: "center",
|
|
67
|
+
gap: 4,
|
|
68
|
+
width: 24
|
|
69
|
+
},
|
|
70
|
+
children: [/* @__PURE__ */ n(b, {
|
|
71
|
+
"aria-hidden": "true",
|
|
72
|
+
color: e.isNoSpend ? "success.main" : "text.secondary",
|
|
73
|
+
sx: { fontWeight: e.isNoSpend ? 600 : 400 },
|
|
74
|
+
variant: "body2",
|
|
75
|
+
children: e.label
|
|
76
|
+
}), e.isNoSpend ? /* @__PURE__ */ n(D, {
|
|
77
|
+
"aria-hidden": !0,
|
|
78
|
+
filled: !0,
|
|
79
|
+
size: 24,
|
|
80
|
+
sx: { color: "success.main" }
|
|
81
|
+
}) : /* @__PURE__ */ n(i, {
|
|
82
|
+
"aria-hidden": "true",
|
|
83
|
+
sx: {
|
|
84
|
+
bgcolor: "action.disabledBackground",
|
|
85
|
+
border: "2px solid transparent",
|
|
86
|
+
backgroundClip: "content-box",
|
|
87
|
+
borderRadius: "50%",
|
|
88
|
+
height: 24,
|
|
89
|
+
width: 24
|
|
90
|
+
}
|
|
91
|
+
})]
|
|
92
|
+
}, e.iso))
|
|
93
|
+
})
|
|
94
|
+
]
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
export {
|
|
98
|
+
M as default
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
//# sourceMappingURL=NoSpendDaysBlock.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoSpendDaysBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendDaysBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\nimport { CheckCircle } from '@mxenabled/mx-icons'\n\nimport { useGlobalCopyStore } from '../../../../common'\nimport { slot, type InstanceSlot } from '../../../../core'\nimport { formatDate } from '../../../../core/constants'\nimport { ConfettiOverlay } from '../../../components/shared/ConfettiOverlay'\nimport type { BlockProps } from '../../types'\nimport { parseDueDate } from '../RepeatingTransactionBlock/weekStrip'\n\nimport NoSpendGraphic from './NoSpendGraphic'\n\ntype NoSpendDaysSlot = Pick<InstanceSlot, 'start_date' | 'no_spend_days'>\n\nconst CONFETTI_MIN_DAYS = 5\n\nconst DAY_KEYS = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday']\n\nconst toIsoDay = (date: Date) =>\n [date.getFullYear(), date.getMonth() + 1, date.getDate()]\n .map((part) => String(part).padStart(2, '0'))\n .join('-')\n\nconst buildWeek = (start: Date, noSpendDays: string[]) =>\n Array.from({ length: 7 }, (_, index) => {\n const date = new Date(start)\n date.setDate(start.getDate() + index)\n const iso = toIsoDay(date)\n return {\n iso,\n key: DAY_KEYS[date.getDay()],\n label: formatDate(date, { weekday: 'short' }),\n isNoSpend: noSpendDays.includes(iso),\n }\n })\n\nconst NoSpendDaysBlock = ({ payload }: BlockProps) => {\n const generalCopy = useGlobalCopyStore().insights_feed?.general\n const altText = generalCopy?.weekly_no_spending_component_alt_text\n\n const { instance_slot = {} } = payload\n const field = <K extends keyof NoSpendDaysSlot>(key: K) =>\n slot<InstanceSlot[K]>(instance_slot.data, key) ?? instance_slot[key]\n\n const startDate = field('start_date')\n const start = typeof startDate === 'string' ? parseDueDate(startDate.slice(0, 10)) : null\n\n if (!start) return null\n\n const rawDays = field('no_spend_days')\n const noSpendDays = Array.isArray(rawDays) ? rawDays.map((day) => String(day).slice(0, 10)) : []\n const week = buildWeek(start, noSpendDays)\n const count = week.filter((day) => day.isNoSpend).length\n\n return (\n <Stack sx={{ alignItems: 'center', gap: 1, position: 'relative', pt: 14, px: 16 }}>\n {count >= CONFETTI_MIN_DAYS && <ConfettiOverlay />}\n <NoSpendGraphic count={count} label={generalCopy?.dollar_bill} />\n <Stack\n component=\"ul\"\n direction=\"row\"\n sx={{\n justifyContent: 'space-between',\n listStyle: 'none',\n m: 0,\n p: 0,\n position: 'relative',\n width: '100%',\n }}\n >\n {week.map((day) => (\n <Stack\n aria-label={\n day.isNoSpend\n ? altText?.[`${day.key}_no_spend_day`]\n : altText?.[`${day.key}_is_a_spend_day`]\n }\n component=\"li\"\n key={day.iso}\n sx={{ alignItems: 'center', gap: 4, width: 24 }}\n >\n <Text\n aria-hidden=\"true\"\n color={day.isNoSpend ? 'success.main' : 'text.secondary'}\n sx={{ fontWeight: day.isNoSpend ? 600 : 400 }}\n variant=\"body2\"\n >\n {day.label}\n </Text>\n {day.isNoSpend ? (\n <CheckCircle\n aria-hidden={true}\n filled={true}\n size={24}\n sx={{ color: 'success.main' }}\n />\n ) : (\n <Stack\n aria-hidden=\"true\"\n sx={{\n bgcolor: 'action.disabledBackground',\n border: '2px solid transparent',\n backgroundClip: 'content-box',\n borderRadius: '50%',\n height: 24,\n width: 24,\n }}\n />\n )}\n </Stack>\n ))}\n </Stack>\n </Stack>\n )\n}\n\nexport default NoSpendDaysBlock\n"],"mappings":";;;;;;;;;;AAgBA,IAAM,IAAoB,GAEpB,IAAW;AAAA,EAAC;AAAA,EAAU;AAAA,EAAU;AAAA,EAAW;AAAA,EAAa;AAAA,EAAY;AAAA,EAAU;AAAU,GAExF,IAAA,CAAY,MAChB;AAAA,EAAC,EAAK,YAAY;AAAA,EAAG,EAAK,SAAS,IAAI;AAAA,EAAG,EAAK,QAAQ;AAAC,EACrD,IAAA,CAAK,MAAS,OAAO,CAAI,EAAE,SAAS,GAAG,GAAG,CAAC,EAC3C,KAAK,GAAG,GAEP,IAAA,C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8E", i = "#0D5F42", d = "#FBB346", s = "#FFDA6C", h = "M63.48 3.24C66.89 1.24 71.11 1.24 74.52 3.24L103.04 19.95C106.38 21.91 108.44 25.5 108.44 29.37V63.09C108.44 66.97 106.38 70.55 103.04 72.51L74.52 89.23C71.11 91.22 66.89 91.22 63.48 89.23L34.96 72.51C31.61 70.55 29.56 66.97 29.56 63.09V29.37C29.56 25.5 31.61 21.91 34.96 19.95Z", a = ({ x: r, y: e, rotate: x }) => /* @__PURE__ */ t("path", {
|
|
3
|
+
d: "M14 14C14 6 7.5 0 0 0V14Z",
|
|
4
|
+
fill: i,
|
|
5
|
+
transform: `translate(${r} ${e}) rotate(${x} 7 7)`
|
|
6
|
+
}), l = ({ x: r, y: e }) => /* @__PURE__ */ t("text", {
|
|
7
|
+
fill: n,
|
|
8
|
+
fontSize: 9.2,
|
|
9
|
+
fontWeight: 700,
|
|
10
|
+
x: r,
|
|
11
|
+
y: e,
|
|
12
|
+
children: "$"
|
|
13
|
+
}), c = ({ count: r, label: e }) => /* @__PURE__ */ o("svg", {
|
|
14
|
+
"aria-label": e,
|
|
15
|
+
height: 110,
|
|
16
|
+
role: "img",
|
|
17
|
+
style: { position: "relative" },
|
|
18
|
+
viewBox: "0 0 138 110",
|
|
19
|
+
width: 138,
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ t("rect", {
|
|
22
|
+
fill: n,
|
|
23
|
+
height: 69,
|
|
24
|
+
rx: 2,
|
|
25
|
+
width: 138,
|
|
26
|
+
y: 12
|
|
27
|
+
}),
|
|
28
|
+
/* @__PURE__ */ t("rect", {
|
|
29
|
+
fill: "none",
|
|
30
|
+
height: 59.8,
|
|
31
|
+
rx: 1,
|
|
32
|
+
stroke: i,
|
|
33
|
+
strokeWidth: 5,
|
|
34
|
+
width: 128.8,
|
|
35
|
+
x: 4.6,
|
|
36
|
+
y: 16.6
|
|
37
|
+
}),
|
|
38
|
+
/* @__PURE__ */ t(a, {
|
|
39
|
+
rotate: 90,
|
|
40
|
+
x: 9.4,
|
|
41
|
+
y: 21.4
|
|
42
|
+
}),
|
|
43
|
+
/* @__PURE__ */ t(a, {
|
|
44
|
+
rotate: 180,
|
|
45
|
+
x: 114.5,
|
|
46
|
+
y: 21.4
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ t(a, {
|
|
49
|
+
rotate: 0,
|
|
50
|
+
x: 9.4,
|
|
51
|
+
y: 58
|
|
52
|
+
}),
|
|
53
|
+
/* @__PURE__ */ t(a, {
|
|
54
|
+
rotate: 270,
|
|
55
|
+
x: 114.5,
|
|
56
|
+
y: 58
|
|
57
|
+
}),
|
|
58
|
+
/* @__PURE__ */ t("circle", {
|
|
59
|
+
cx: 69,
|
|
60
|
+
cy: 46.5,
|
|
61
|
+
fill: i,
|
|
62
|
+
r: 16.5
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ t(l, {
|
|
65
|
+
x: 10,
|
|
66
|
+
y: 29
|
|
67
|
+
}),
|
|
68
|
+
/* @__PURE__ */ t(l, {
|
|
69
|
+
x: 121.4,
|
|
70
|
+
y: 29
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ t(l, {
|
|
73
|
+
x: 10,
|
|
74
|
+
y: 70.5
|
|
75
|
+
}),
|
|
76
|
+
/* @__PURE__ */ t(l, {
|
|
77
|
+
x: 121.4,
|
|
78
|
+
y: 70.5
|
|
79
|
+
}),
|
|
80
|
+
/* @__PURE__ */ o("g", {
|
|
81
|
+
style: { filter: "drop-shadow(0 3px 4px rgba(0,0,0,0.06)) drop-shadow(0 6px 6px rgba(0,0,0,0.16))" },
|
|
82
|
+
children: [/* @__PURE__ */ t("path", {
|
|
83
|
+
d: h,
|
|
84
|
+
fill: s
|
|
85
|
+
}), /* @__PURE__ */ t("path", {
|
|
86
|
+
d: h,
|
|
87
|
+
fill: d,
|
|
88
|
+
transform: "translate(69 46.2) scale(0.88) translate(-69 -46.2)"
|
|
89
|
+
})]
|
|
90
|
+
}),
|
|
91
|
+
/* @__PURE__ */ t("text", {
|
|
92
|
+
"aria-hidden": "true",
|
|
93
|
+
dominantBaseline: "central",
|
|
94
|
+
fill: "black",
|
|
95
|
+
fontSize: 53,
|
|
96
|
+
fontWeight: 700,
|
|
97
|
+
textAnchor: "middle",
|
|
98
|
+
x: 69,
|
|
99
|
+
y: 48,
|
|
100
|
+
children: r
|
|
101
|
+
})
|
|
102
|
+
]
|
|
103
|
+
});
|
|
104
|
+
export {
|
|
105
|
+
c as default
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
//# sourceMappingURL=NoSpendGraphic.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoSpendGraphic.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendGraphic.tsx"],"sourcesContent":["const BILL = '#59AB8E'\nconst BILL_DARK = '#0D5F42'\nconst BADGE = '#FBB346'\nconst BADGE_EDGE = '#FFDA6C'\n\nconst HEXAGON =\n 'M63.48 3.24C66.89 1.24 71.11 1.24 74.52 3.24L103.04 19.95C106.38 21.91 108.44 25.5 108.44 29.37V63.09C108.44 66.97 106.38 70.55 103.04 72.51L74.52 89.23C71.11 91.22 66.89 91.22 63.48 89.23L34.96 72.51C31.61 70.55 29.56 66.97 29.56 63.09V29.37C29.56 25.5 31.61 21.91 34.96 19.95Z'\n\nconst Corner = ({ x, y, rotate }: { x: number; y: number; rotate: number }) => (\n <path\n d=\"M14 14C14 6 7.5 0 0 0V14Z\"\n fill={BILL_DARK}\n transform={`translate(${x} ${y}) rotate(${rotate} 7 7)`}\n />\n)\n\nconst Dollar = ({ x, y }: { x: number; y: number }) => (\n <text fill={BILL} fontSize={9.2} fontWeight={700} x={x} y={y}>\n $\n </text>\n)\n\nconst NoSpendGraphic = ({ count, label }: { count: number; label?: string }) => (\n <svg\n aria-label={label}\n height={110}\n role=\"img\"\n style={{ position: 'relative' }}\n viewBox=\"0 0 138 110\"\n width={138}\n >\n <rect fill={BILL} height={69} rx={2} width={138} y={12} />\n <rect\n fill=\"none\"\n height={59.8}\n rx={1}\n stroke={BILL_DARK}\n strokeWidth={5}\n width={128.8}\n x={4.6}\n y={16.6}\n />\n <Corner rotate={90} x={9.4} y={21.4} />\n <Corner rotate={180} x={114.5} y={21.4} />\n <Corner rotate={0} x={9.4} y={58} />\n <Corner rotate={270} x={114.5} y={58} />\n <circle cx={69} cy={46.5} fill={BILL_DARK} r={16.5} />\n <Dollar x={10} y={29} />\n <Dollar x={121.4} y={29} />\n <Dollar x={10} y={70.5} />\n <Dollar x={121.4} y={70.5} />\n <g\n style={{\n filter: 'drop-shadow(0 3px 4px rgba(0,0,0,0.06)) drop-shadow(0 6px 6px rgba(0,0,0,0.16))',\n }}\n >\n <path d={HEXAGON} fill={BADGE_EDGE} />\n <path\n d={HEXAGON}\n fill={BADGE}\n transform=\"translate(69 46.2) scale(0.88) translate(-69 -46.2)\"\n />\n </g>\n <text\n aria-hidden=\"true\"\n dominantBaseline=\"central\"\n fill=\"black\"\n fontSize={53}\n fontWeight={700}\n textAnchor=\"middle\"\n x={69}\n y={48}\n >\n {count}\n </text>\n </svg>\n)\n\nexport default NoSpendGraphic\n"],"mappings":";AAAA,IAAM,IAAO,WACP,IAAY,WACZ,IAAQ,WACR,IAAa,WAEb,IACJ,0RAEI,IAAA,CAAU,EAAE,GAAA,GAAG,GAAA,GAAG,QAAA,EAAA,MACtB,gBAAA,EAAC,QAAD;AAAA,EACE,GAAE;AAAA,EACF,MAAM;AAAA,EACN,WAAW,aAAa,CAAA,IAAK,CAAA,YAAa,CAAA;AAC3C,CAAA,GAGG,IAAA,CAAU,EAAE,GAAA,GAAG,GAAA,EAAA,MACnB,gBAAA,EAAC,QAAD;AAAA,EAAM,MAAM;AAAA,EAAM,UAAU;AAAA,EAAK,YAAY;AAAA,EAAQ,GAAA;AAAA,EAAM,GAAA;AAAA,EAAG,UAAA;AAExD,CAAA,GAGF,IAAA,CAAkB,EAAE,OAAA,G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AAAA,IAC1B,gBAAA,EAAC,GAAD;AAAA,MAAQ,GAAG;AAAA,MAAI,GAAG;AAAA,IAAO,CAAA;AAAA,IACzB,gBAAA,EAAC,GAAD;AAAA,MAAQ,GAAG;AAAA,MAAO,GAAG;AAAA,IAAO,CAAA;AAAA,IAC5B,gBAAA,EAAC,KAAD;AAAA,MACE,OAAO,EACL,QAAQ,kFACV;AAAA,MAHF,UAAA,CAKE,gBAAA,EAAC,QAAD;AAAA,QAAM,GAAG;AAAA,QAAS,MAAM;AAAA,MAAa,CAAA,GACrC,gBAAA,EAAC,QAAD;AAAA,QACE,GAAG;AAAA,QACH,MAAM;AAAA,QACN,WAAU;AAAA,MACX,CAAA,CACA;AAAA;IACH,gBAAA,EAAC,QAAD;AAAA,MACE,eAAY;AAAA,MACZ,kBAAiB;AAAA,MACjB,MAAK;AAAA,MACL,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,YAAW;AAAA,MACX,GAAG;AAAA,MACH,GAAG;AAAA,MAEF,UAAA;AAAA,IACG,CAAA;AAAA,EACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as NoSpendDaysBlock } from './NoSpendDaysBlock';
|
|
@@ -3,6 +3,7 @@ export * from './AccountSwitchBlock';
|
|
|
3
3
|
export * from './BudgetBlock';
|
|
4
4
|
export * from './DebtsBlock';
|
|
5
5
|
export * from './DetailedAccountBlock';
|
|
6
|
+
export * from './NoSpendDaysBlock';
|
|
6
7
|
export * from './RepeatingTransactionBlock';
|
|
7
8
|
export * from './SaveExtraBlock';
|
|
8
9
|
export * from './SavingsOpportunityBlock';
|
|
@@ -10,11 +10,11 @@ import h from "./blocks/ChartBlocks/StepChartBlock/StepChartBlock.es.js";
|
|
|
10
10
|
import L from "./blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js";
|
|
11
11
|
import I from "./blocks/ChartBlocks/DoubleProgressBarBlock/DoubleProgressBarBlock.es.js";
|
|
12
12
|
import R, { isLogoGuid as w } from "./components/LogoFromGuid.es.js";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
13
|
+
import H from "./components/AccountHeroCard.es.js";
|
|
14
|
+
import V from "./components/DirectDepositCard.es.js";
|
|
15
15
|
import { detailedAccountVariant as M, directDepositVariant as P, isDetailedAccountVariant as _ } from "./blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js";
|
|
16
16
|
import x from "./blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js";
|
|
17
|
-
import
|
|
17
|
+
import N from "./blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js";
|
|
18
18
|
import W from "./components/TransferLogoCard.es.js";
|
|
19
19
|
import q from "./blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js";
|
|
20
20
|
import { BudgetBlock as J } from "./blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js";
|
|
@@ -22,107 +22,109 @@ import Q from "./components/DebtPayoffCard.es.js";
|
|
|
22
22
|
import Y from "./components/InsightTransactionRow.es.js";
|
|
23
23
|
import $ from "./components/TransactionListCard.es.js";
|
|
24
24
|
import ro from "./blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js";
|
|
25
|
-
import mo from "./
|
|
26
|
-
import ao from "./
|
|
27
|
-
import eo from "./
|
|
28
|
-
import no from "./
|
|
29
|
-
import lo from "./
|
|
30
|
-
import Bo from "./
|
|
31
|
-
import go from "./
|
|
32
|
-
import
|
|
33
|
-
import {
|
|
34
|
-
import ho from "./
|
|
35
|
-
import Lo from "./components/
|
|
36
|
-
import Io from "./
|
|
37
|
-
import Ro from "./
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import Eo from "./
|
|
41
|
-
import Po from "./components/
|
|
42
|
-
import Fo from "./components/
|
|
43
|
-
import Go from "./components/
|
|
44
|
-
import
|
|
45
|
-
import jo from "./components/
|
|
46
|
-
import
|
|
47
|
-
import Ko from "./components/
|
|
48
|
-
import
|
|
49
|
-
import {
|
|
50
|
-
import or from "./components/
|
|
51
|
-
import tr from "./components/
|
|
52
|
-
import ir from "./components/
|
|
53
|
-
import pr from "./components/
|
|
54
|
-
import
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import kr from "./components/
|
|
60
|
-
import Sr from "./components/
|
|
61
|
-
import hr from "./components/
|
|
62
|
-
import Lr from "./components/
|
|
63
|
-
import Ir from "./components/
|
|
25
|
+
import mo from "./blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendDaysBlock.es.js";
|
|
26
|
+
import ao from "./components/UpcomingBillCard.es.js";
|
|
27
|
+
import eo from "./blocks/ComponentBlocks/RepeatingTransactionBlock/RepeatingTransactionBlock.es.js";
|
|
28
|
+
import no from "./components/SaveAnExtraCard.es.js";
|
|
29
|
+
import lo from "./blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
|
|
30
|
+
import Bo from "./components/SavingsOpportunityCard.es.js";
|
|
31
|
+
import go from "./blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.es.js";
|
|
32
|
+
import ko from "./components/StatusMessageCard.es.js";
|
|
33
|
+
import { transactionBlockVariant as So } from "./blocks/ComponentBlocks/TransactionBlock/layout.es.js";
|
|
34
|
+
import { TransactionBlock as ho } from "./blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js";
|
|
35
|
+
import Lo from "./components/AmountPill.es.js";
|
|
36
|
+
import Io from "./components/SubscriptionHeroCard.es.js";
|
|
37
|
+
import Ro from "./blocks/ComponentBlocks/UpcomingSubscriptionBlock/UpcomingSubscriptionBlock.es.js";
|
|
38
|
+
import yo from "./components/WithdrawalCard.es.js";
|
|
39
|
+
import Oo from "./blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js";
|
|
40
|
+
import { SVGImageBlock as Eo } from "./blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
|
|
41
|
+
import Po from "./components/shared/StatusSnackbar.es.js";
|
|
42
|
+
import Fo from "./components/FeedbackDialog.es.js";
|
|
43
|
+
import Go from "./components/FeedbackModal.es.js";
|
|
44
|
+
import Uo from "./components/ConnectionDetailDrillDown.es.js";
|
|
45
|
+
import jo from "./components/SurveyModal.es.js";
|
|
46
|
+
import zo from "./components/InsightErrorCard.es.js";
|
|
47
|
+
import { ErrorCard as Ko } from "./components/ErrorCard.es.js";
|
|
48
|
+
import Xo from "./components/BadgedTile.es.js";
|
|
49
|
+
import { OverflowMenu as Zo } from "./components/OverflowMenu.es.js";
|
|
50
|
+
import { InsightOptionsMenu as or } from "./components/InsightOptionsMenu.es.js";
|
|
51
|
+
import tr from "./components/StatusBadge.es.js";
|
|
52
|
+
import ir from "./components/CompactInsightCard.es.js";
|
|
53
|
+
import pr from "./components/AmountBreakdownCard.es.js";
|
|
54
|
+
import fr from "./components/DesignateEmergencySavingsCard.es.js";
|
|
55
|
+
import { FeedbackBar as cr } from "./components/FeedbackBar.es.js";
|
|
56
|
+
import { DismissInsightDialog as sr } from "./components/DismissInsightDialog.es.js";
|
|
57
|
+
import { HiddenConfirmationCard as Br } from "./components/HiddenConfirmationCard.es.js";
|
|
58
|
+
import { LoadingCard as gr } from "./components/LoadingCard.es.js";
|
|
59
|
+
import { ObsolesceBanner as kr } from "./components/ObsolesceBanner.es.js";
|
|
60
|
+
import Sr from "./components/BaseLayout.es.js";
|
|
61
|
+
import hr from "./components/LogoTile.es.js";
|
|
62
|
+
import Lr from "./components/LogoClusterCard.es.js";
|
|
63
|
+
import Ir from "./components/MerchantHighlightCard.es.js";
|
|
64
|
+
import Rr from "./components/P2PLogoStack.es.js";
|
|
64
65
|
export {
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
N as AccountBlock,
|
|
67
|
+
H as AccountHeroCard,
|
|
67
68
|
q as AccountSwitchBlock,
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
pr as AmountBreakdownCard,
|
|
70
|
+
Lo as AmountPill,
|
|
70
71
|
e as BAR_ARIA_LABEL,
|
|
71
72
|
f as BAR_CHART_VARIANTS,
|
|
72
|
-
|
|
73
|
+
Xo as BadgedTile,
|
|
73
74
|
k as BarchartBlock,
|
|
74
|
-
|
|
75
|
+
Sr as BaseLayout,
|
|
75
76
|
J as BudgetBlock,
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
ir as CompactInsightCard,
|
|
78
|
+
Uo as ConnectionDetailDrillDown,
|
|
78
79
|
Q as DebtPayoffCard,
|
|
79
80
|
ro as DebtsBlock,
|
|
80
|
-
|
|
81
|
+
fr as DesignateEmergencySavingsCard,
|
|
81
82
|
x as DetailedAccountBlock,
|
|
82
83
|
x as DirectDepositBlock,
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
V as DirectDepositCard,
|
|
85
|
+
sr as DismissInsightDialog,
|
|
85
86
|
L as DonutChartBlock,
|
|
86
87
|
S as DoubleBarChartBlock,
|
|
87
88
|
I as DoubleProgressBarBlock,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
Ko as ErrorCard,
|
|
90
|
+
cr as FeedbackBar,
|
|
91
|
+
Fo as FeedbackDialog,
|
|
92
|
+
Go as FeedbackModal,
|
|
92
93
|
d as HOST_ACTIONS,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
Br as HiddenConfirmationCard,
|
|
95
|
+
zo as InsightErrorCard,
|
|
96
|
+
or as InsightOptionsMenu,
|
|
96
97
|
Y as InsightTransactionRow,
|
|
97
|
-
|
|
98
|
-
|
|
98
|
+
gr as LoadingCard,
|
|
99
|
+
Lr as LogoClusterCard,
|
|
99
100
|
R as LogoFromGuid,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
no as
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
101
|
+
hr as LogoTile,
|
|
102
|
+
Ir as MerchantHighlightCard,
|
|
103
|
+
mo as NoSpendDaysBlock,
|
|
104
|
+
kr as ObsolesceBanner,
|
|
105
|
+
Zo as OverflowMenu,
|
|
106
|
+
Rr as P2PLogoStack,
|
|
107
|
+
eo as RepeatingTransactionBlock,
|
|
108
|
+
Eo as SVGImageBlock,
|
|
109
|
+
no as SaveAnExtraCard,
|
|
110
|
+
lo as SaveExtraBlock,
|
|
111
|
+
go as SavingsOpportunityBlock,
|
|
112
|
+
Bo as SavingsOpportunityCard,
|
|
113
|
+
tr as StatusBadge,
|
|
114
|
+
ko as StatusMessageCard,
|
|
113
115
|
r as StatusPill,
|
|
114
|
-
|
|
116
|
+
Po as StatusSnackbar,
|
|
115
117
|
h as StepChartBlock,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
118
|
+
Io as SubscriptionHeroCard,
|
|
119
|
+
jo as SurveyModal,
|
|
120
|
+
ho as TransactionBlock,
|
|
119
121
|
$ as TransactionListCard,
|
|
120
122
|
W as TransferLogoCard,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
eo as UpcomingBillBlock,
|
|
124
|
+
ao as UpcomingBillCard,
|
|
125
|
+
Ro as UpcomingSubscriptionBlock,
|
|
126
|
+
Oo as WithdrawalBlock,
|
|
127
|
+
yo as WithdrawalCard,
|
|
126
128
|
n as barChartVariant,
|
|
127
129
|
c as buildChartData,
|
|
128
130
|
l as buildDataSeries,
|
|
@@ -131,7 +133,7 @@ export {
|
|
|
131
133
|
_ as isDetailedAccountVariant,
|
|
132
134
|
w as isLogoGuid,
|
|
133
135
|
m as resolveInsightRender,
|
|
134
|
-
|
|
136
|
+
So as transactionBlockVariant,
|
|
135
137
|
a as useBeatActions,
|
|
136
138
|
C as useBeatCtaActions,
|
|
137
139
|
g as useCtaHandler
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ContactSupportActionBlock as p } from "../actionBlocks/ContactSupportActionBlock.es.js";
|
|
2
|
-
import { hasDrawerBlock as
|
|
2
|
+
import { hasDrawerBlock as V } from "./hasDrawerBlock.es.js";
|
|
3
3
|
import { actionBlocksKey as o } from "./actionBlocksKey.es.js";
|
|
4
4
|
import { BarchartBlock as l } from "../blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js";
|
|
5
5
|
import { DoubleBarChartBlock as _ } from "../blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js";
|
|
@@ -10,31 +10,32 @@ import B from "../blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlo
|
|
|
10
10
|
import u from "../blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js";
|
|
11
11
|
import T from "../blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js";
|
|
12
12
|
import { BudgetBlock as A } from "../blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js";
|
|
13
|
-
import
|
|
13
|
+
import f from "../blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js";
|
|
14
|
+
import O from "../blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendDaysBlock.es.js";
|
|
14
15
|
import n from "../blocks/ComponentBlocks/RepeatingTransactionBlock/RepeatingTransactionBlock.es.js";
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import { TransactionBlock as
|
|
16
|
+
import b from "../blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
|
|
17
|
+
import N from "../blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.es.js";
|
|
18
|
+
import { TransactionBlock as d } from "../blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js";
|
|
18
19
|
import g from "../blocks/ComponentBlocks/UpcomingSubscriptionBlock/UpcomingSubscriptionBlock.es.js";
|
|
19
20
|
import I from "../blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js";
|
|
20
|
-
import
|
|
21
|
-
import { SVGImageBlock as
|
|
22
|
-
import { FeedbackModalActionBlock as
|
|
23
|
-
import { ConnectionDetailActionBlock as
|
|
24
|
-
import { ConnectWidgetActionBlock as
|
|
25
|
-
import { SurveyModalActionBlock as
|
|
26
|
-
import { PlaceholderActionBlock as
|
|
27
|
-
import { getMakeTransferDrawerTitle as
|
|
28
|
-
import { MakeTransferActionBlockLayer as
|
|
29
|
-
import { getDrawerHeaderTitle as
|
|
21
|
+
import L from "../blocks/ImageBlocks/ImageBlock.es.js";
|
|
22
|
+
import { SVGImageBlock as P } from "../blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
|
|
23
|
+
import { FeedbackModalActionBlock as D } from "../actionBlocks/FeedbackModalActionBlock.es.js";
|
|
24
|
+
import { ConnectionDetailActionBlock as h } from "../actionBlocks/ConnectionDetailActionBlock.es.js";
|
|
25
|
+
import { ConnectWidgetActionBlock as S } from "../actionBlocks/ConnectWidgetActionBlock.es.js";
|
|
26
|
+
import { SurveyModalActionBlock as R } from "../actionBlocks/SurveyModalActionBlock.es.js";
|
|
27
|
+
import { PlaceholderActionBlock as E } from "../actionBlocks/PlaceholderActionBlock.es.js";
|
|
28
|
+
import { getMakeTransferDrawerTitle as K } from "../actionBlocks/MakeTransferActionBlock/layout.es.js";
|
|
29
|
+
import { MakeTransferActionBlockLayer as v } from "../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js";
|
|
30
|
+
import { getDrawerHeaderTitle as y } from "../actionBlocks/TransactionHistoryBlock/utils.es.js";
|
|
30
31
|
import { TransactionDetailsBlock as M } from "../actionBlocks/TransactionDetailsBlock/TransactionDetailsBlock.es.js";
|
|
31
32
|
import { useTransactionDetailsPrepare as a } from "../actionBlocks/TransactionDetailsBlock/useTransactionDetailsPrepare.es.js";
|
|
32
33
|
import { TransactionHistoryBlock as w } from "../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js";
|
|
33
34
|
import { useRecurringTransactionPrepare as c } from "../actionBlocks/RecurringTransactionBlock/useRecurringTransactionPrepare.es.js";
|
|
34
|
-
import { RecurringTransactionBlock as
|
|
35
|
-
import { TransactionListBlock as
|
|
36
|
-
import { RemainingCashBlock as
|
|
37
|
-
import { AmountInputModalBlock as
|
|
35
|
+
import { RecurringTransactionBlock as U } from "../actionBlocks/RecurringTransactionBlock/RecurringTransactionBlock.es.js";
|
|
36
|
+
import { TransactionListBlock as H } from "../actionBlocks/TransactionListBlock/TransactionListBlock.es.js";
|
|
37
|
+
import { RemainingCashBlock as x } from "../actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js";
|
|
38
|
+
import { AmountInputModalBlock as G } from "../actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js";
|
|
38
39
|
var e = (t) => {
|
|
39
40
|
}, r = (t) => ({
|
|
40
41
|
get Component() {
|
|
@@ -49,21 +50,21 @@ var e = (t) => {
|
|
|
49
50
|
get presentation() {
|
|
50
51
|
return t().presentation;
|
|
51
52
|
}
|
|
52
|
-
}),
|
|
53
|
+
}), Do = {
|
|
53
54
|
[o.PLACEHOLDER_ACTION_BLOCK]: r(() => ({
|
|
54
|
-
Component:
|
|
55
|
+
Component: E,
|
|
55
56
|
usePrepare: e,
|
|
56
57
|
title: () => "Action Block Layer Drilldown"
|
|
57
58
|
})),
|
|
58
59
|
[o.MAKE_TRANSFER_ACTION_BLOCK]: r(() => ({
|
|
59
|
-
Component:
|
|
60
|
+
Component: v,
|
|
60
61
|
usePrepare: e,
|
|
61
|
-
title:
|
|
62
|
+
title: K
|
|
62
63
|
})),
|
|
63
64
|
[o.TRANSCATION_HISTORY_ACTION_BLOCK]: r(() => ({
|
|
64
65
|
Component: w,
|
|
65
66
|
usePrepare: e,
|
|
66
|
-
title:
|
|
67
|
+
title: y
|
|
67
68
|
})),
|
|
68
69
|
[o.TRANSACTION_DETAILS_ACTION_BLOCK]: r(() => ({
|
|
69
70
|
Component: M,
|
|
@@ -71,12 +72,12 @@ var e = (t) => {
|
|
|
71
72
|
title: () => "Transaction Details"
|
|
72
73
|
})),
|
|
73
74
|
[o.RECURRING_TRANSACTION_ACTION_BLOCK]: r(() => ({
|
|
74
|
-
Component:
|
|
75
|
+
Component: U,
|
|
75
76
|
usePrepare: c,
|
|
76
77
|
title: (t, i) => i.recurring?.expense_details ?? ""
|
|
77
78
|
})),
|
|
78
79
|
[o.REMAINING_CASH_ACTION_BLOCK]: r(() => ({
|
|
79
|
-
Component:
|
|
80
|
+
Component: x,
|
|
80
81
|
usePrepare: c,
|
|
81
82
|
title: (t, i) => i.insights_feed?.remaining_cash?.title ?? ""
|
|
82
83
|
})),
|
|
@@ -86,59 +87,60 @@ var e = (t) => {
|
|
|
86
87
|
title: (t, i) => i.help?.request_support ?? ""
|
|
87
88
|
})),
|
|
88
89
|
[o.FEEDBACK_MODAL_ACTION_BLOCK]: r(() => ({
|
|
89
|
-
Component:
|
|
90
|
+
Component: D,
|
|
90
91
|
usePrepare: e,
|
|
91
92
|
presentation: "modal"
|
|
92
93
|
})),
|
|
93
94
|
[o.CONNECTION_DETAIL_ACTION_BLOCK]: r(() => ({
|
|
94
|
-
Component:
|
|
95
|
+
Component: h,
|
|
95
96
|
usePrepare: e,
|
|
96
97
|
title: (t, i) => i.insights_feed?.connection_details?.connection_details_drawer_title ?? ""
|
|
97
98
|
})),
|
|
98
99
|
[o.CONNECT_WIDGET_ACTION_BLOCK]: r(() => ({
|
|
99
|
-
Component:
|
|
100
|
+
Component: S,
|
|
100
101
|
usePrepare: e
|
|
101
102
|
})),
|
|
102
103
|
[o.SURVEY_MODAL_ACTION_BLOCK]: r(() => ({
|
|
103
|
-
Component:
|
|
104
|
+
Component: R,
|
|
104
105
|
usePrepare: e,
|
|
105
106
|
presentation: "modal"
|
|
106
107
|
})),
|
|
107
108
|
[o.TRANSACTION_LIST_ACTION_BLOCK]: r(() => ({
|
|
108
|
-
Component:
|
|
109
|
+
Component: H,
|
|
109
110
|
usePrepare: a,
|
|
110
111
|
title: (t, i, m) => m?.insights_payload?.title ?? ""
|
|
111
112
|
})),
|
|
112
113
|
[o.AMOUNT_INPUT_MODAL_ACTION_BLOCK]: r(() => ({
|
|
113
|
-
Component:
|
|
114
|
+
Component: G,
|
|
114
115
|
presentation: "modal",
|
|
115
116
|
usePrepare: e
|
|
116
117
|
}))
|
|
117
|
-
},
|
|
118
|
+
}, ho = {
|
|
118
119
|
account_block: u,
|
|
119
120
|
account_switch_block: T,
|
|
120
121
|
direct_deposit_block: B,
|
|
121
122
|
bar_chart_block: l,
|
|
122
123
|
budget_block: A,
|
|
123
|
-
debts_block:
|
|
124
|
+
debts_block: f,
|
|
124
125
|
donut_chart_block: C,
|
|
125
126
|
double_bar_chart_block: _,
|
|
126
127
|
double_progress_bar_block: k,
|
|
127
|
-
image_block:
|
|
128
|
+
image_block: L,
|
|
129
|
+
no_spend_days_block: O,
|
|
128
130
|
repeating_transaction_block: n,
|
|
129
|
-
save_extra_block:
|
|
130
|
-
savings_opportunity_block:
|
|
131
|
+
save_extra_block: b,
|
|
132
|
+
savings_opportunity_block: N,
|
|
131
133
|
step_chart_block: s,
|
|
132
|
-
svg_image_block:
|
|
134
|
+
svg_image_block: P,
|
|
133
135
|
upcoming_bill_block: n,
|
|
134
136
|
upcoming_subscription_block: g,
|
|
135
137
|
withdrawal_block: I,
|
|
136
|
-
transaction_block:
|
|
138
|
+
transaction_block: d
|
|
137
139
|
};
|
|
138
140
|
export {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
Do as actionBlocks,
|
|
142
|
+
ho as blocks,
|
|
143
|
+
V as hasDrawerBlock
|
|
142
144
|
};
|
|
143
145
|
|
|
144
146
|
//# sourceMappingURL=blocks.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.es.js","names":[],"sources":["../../../src/insights-v2/mappings/blocks.ts"],"sourcesContent":["import {\n AccountBlock,\n AccountSwitchBlock,\n BarchartBlock,\n BudgetBlock,\n DebtsBlock,\n DetailedAccountBlock,\n DonutChartBlock,\n DoubleBarChartBlock,\n DoubleProgressBarBlock,\n RepeatingTransactionBlock,\n SaveExtraBlock,\n SavingsOpportunityBlock,\n SVGImageBlock,\n UpcomingSubscriptionBlock,\n WithdrawalBlock,\n TransactionBlock,\n} from '../blocks'\nimport StepChartBlock from '../blocks/ChartBlocks/StepChartBlock'\nimport ImageBlock from '../blocks/ImageBlocks/ImageBlock'\n\nimport type { Beat, GlobalCopy, InsightsPayload } from '../../core'\nimport { ContactSupportActionBlock } from '../actionBlocks/ContactSupportActionBlock'\nimport { FeedbackModalActionBlock } from '../actionBlocks/FeedbackModalActionBlock'\nimport { ConnectionDetailActionBlock } from '../actionBlocks/ConnectionDetailActionBlock'\nimport { ConnectWidgetActionBlock } from '../actionBlocks/ConnectWidgetActionBlock'\nimport { SurveyModalActionBlock } from '../actionBlocks/SurveyModalActionBlock'\nimport { PlaceholderActionBlock } from '../actionBlocks/PlaceholderActionBlock'\nimport { MakeTransferActionBlockLayer } from '../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer'\nimport { getMakeTransferDrawerTitle } from '../actionBlocks/MakeTransferActionBlock/layout'\nimport { TransactionHistoryBlock } from '../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock'\nimport { getDrawerHeaderTitle } from '../actionBlocks/TransactionHistoryBlock/utils'\nimport {\n TransactionDetailsBlock,\n useTransactionDetailsPrepare,\n} from '../actionBlocks/TransactionDetailsBlock'\nimport {\n RecurringTransactionBlock,\n useRecurringTransactionPrepare,\n} from '../actionBlocks/RecurringTransactionBlock'\nimport { TransactionListBlock } from '../actionBlocks/TransactionListBlock'\nimport { RemainingCashBlock } from '../actionBlocks/RemainingCashBlock'\nimport { AmountInputModalBlock } from '../actionBlocks/AmountInputModalBlock'\n// Keys live in ./actionBlocksKey (imported directly by chart blocks/tests too) to avoid a\n// circular import between this module and the chart blocks — see that file for details.\nimport { actionBlocksKey } from './actionBlocksKey'\n\n// Drilldown indexes are not passed down: action blocks read them from\n// InsightsV2Store (useInsightsV2Store().actionDrawer).\nexport interface ActionBlockProps {\n beat: Beat\n}\n\nconst noop = (_: ActionBlockProps) => {}\n\n// Re-exported so existing `hasDrawerBlock` imports from this module keep working.\nexport { hasDrawerBlock } from './hasDrawerBlock'\n\nexport interface ActionBlockEntry {\n Component: React.ComponentType<ActionBlockProps>\n usePrepare: (props: ActionBlockProps) => void // required; default to noop in each entry\n // Resolves the drawer title from the clicked CTA's variant + copy, with the beat available\n // for blocks that title from beat fields (e.g. transaction-list reads insights_payload.title).\n // Falls back to the CTA label when the resolver returns an empty string / is absent.\n title?: (variant: string | null | undefined, copy: GlobalCopy, beat?: Beat) => string\n // 'drawer' (default) or 'modal' (component renders its own dialog, no Drawer wrapper).\n presentation?: 'drawer' | 'modal'\n}\n\n// Registry of drawer drilldowns, keyed by the `block` name the backend sends Add\n// `usePrepare` when the block needs to load data before rendering.\n\n/**\n * A registry entry whose fields read their imports when used, not when this module loads. Some\n * registered blocks render `TransactionDetails`, whose embedded card mounts `ActionBlockLayer`,\n * which imports this registry: when one of those blocks loads first, its own import is not\n * initialised yet while this module evaluates, so a value copied at load would be `undefined`\n * (or throw under native ES modules). Reading on access sees the finished import.\n */\nconst liveEntry = (resolve: () => ActionBlockEntry): ActionBlockEntry => ({\n get Component() {\n return resolve().Component\n },\n get usePrepare() {\n return resolve().usePrepare\n },\n get title() {\n return resolve().title\n },\n get presentation() {\n return resolve().presentation\n },\n})\n\nexport const actionBlocks = {\n [actionBlocksKey.PLACEHOLDER_ACTION_BLOCK]: liveEntry(() => ({\n Component: PlaceholderActionBlock,\n usePrepare: noop,\n title: () => 'Action Block Layer Drilldown',\n })),\n [actionBlocksKey.MAKE_TRANSFER_ACTION_BLOCK]: liveEntry(() => ({\n Component: MakeTransferActionBlockLayer,\n usePrepare: noop,\n title: getMakeTransferDrawerTitle,\n })),\n [actionBlocksKey.TRANSCATION_HISTORY_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionHistoryBlock,\n usePrepare: noop,\n title: getDrawerHeaderTitle,\n })),\n [actionBlocksKey.TRANSACTION_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionDetailsBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: () => 'Transaction Details',\n })),\n // Expense Details for one recurring subscription. Which subscription a beat names is resolved in\n // `RecurringTransactionBlock/subscriptionBeats.ts`, not through this registry.\n [actionBlocksKey.RECURRING_TRANSACTION_ACTION_BLOCK]: liveEntry(() => ({\n Component: RecurringTransactionBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.recurring?.expense_details ?? '',\n })),\n // Remaining Cash for the Payday Cash Left Over Status beat. Store-driven: reuses the recurring\n // loader, which also loads accounts and categories, so CashflowStore's computeds are ready.\n [actionBlocksKey.REMAINING_CASH_ACTION_BLOCK]: liveEntry(() => ({\n Component: RemainingCashBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.insights_feed?.remaining_cash?.title ?? '',\n })),\n // The block renders its own drawer (the help module's RequestSupport) on top of the action\n // drawer, so the action drawer's title is the CTA label.\n [actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK]: liveEntry(() => ({\n Component: ContactSupportActionBlock,\n usePrepare: noop,\n title: (_variant, copy) => copy.help?.request_support ?? '',\n })),\n [actionBlocksKey.FEEDBACK_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: FeedbackModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.CONNECTION_DETAIL_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectionDetailActionBlock,\n usePrepare: noop,\n title: (_variant, copy) =>\n copy.insights_feed?.connection_details?.connection_details_drawer_title ?? '',\n })),\n // Boots MX's Connect widget (web-widget-sdk iframe) inside the action\n // drawer; the drawer title falls back to the CTA label.\n [actionBlocksKey.CONNECT_WIDGET_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectWidgetActionBlock,\n usePrepare: noop,\n })),\n [actionBlocksKey.SURVEY_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: SurveyModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.TRANSACTION_LIST_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionListBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: (_variant, _copy, beat) => beat?.insights_payload?.title ?? '',\n })),\n // One whole-dollar setting in a dialog; the CTA variant picks which (low-balance threshold or\n // safety net). A modal: no drawer, so no drawer title.\n [actionBlocksKey.AMOUNT_INPUT_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: AmountInputModalBlock,\n presentation: 'modal',\n // Loads inside the block: it mounts only while open, so mounting is the open-time load.\n usePrepare: noop,\n })),\n} as Record<string, ActionBlockEntry>\n\nexport const blocks = {\n account_block: AccountBlock,\n account_switch_block: AccountSwitchBlock,\n direct_deposit_block: DetailedAccountBlock,\n bar_chart_block: BarchartBlock,\n budget_block: BudgetBlock,\n debts_block: DebtsBlock,\n donut_chart_block: DonutChartBlock,\n double_bar_chart_block: DoubleBarChartBlock,\n double_progress_bar_block: DoubleProgressBarBlock,\n image_block: ImageBlock,\n repeating_transaction_block: RepeatingTransactionBlock,\n save_extra_block: SaveExtraBlock,\n savings_opportunity_block: SavingsOpportunityBlock,\n step_chart_block: StepChartBlock,\n svg_image_block: SVGImageBlock,\n upcoming_bill_block: RepeatingTransactionBlock,\n upcoming_subscription_block: UpcomingSubscriptionBlock,\n withdrawal_block: WithdrawalBlock,\n transaction_block: TransactionBlock,\n} as Record<string, React.ComponentType<{ payload: InsightsPayload; beatGuid?: string }>>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,IAAM,IAAA,CAAQ,MAAwB;AAAC,GA0BjC,IAAA,CAAa,OAAuD;AAAA,EACxE,IAAI,YAAY;AACd,WAAO,EAAQ,EAAE;AAAA,EACnB;AAAA,EACA,IAAI,aAAa;AACf,WAAO,EAAQ,EAAE;AAAA,EACnB;AAAA,EACA,IAAI,QAAQ;AACV,WAAO,EAAQ,EAAE;AAAA,EACnB;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AA,GAAiC,EAAA,OAAiB;AAAA,IACjE,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,CAAQ,GAAU,MAChB,EAAK,eAAe,oBAAoB,mCAAmC;AAAA,EAC/E,EAAE;AAAA,EAGD,CAAA,EAAgB,2BAAA,GAA8B,EAAA,OAAiB;AAAA,IAC9D,WAAW;AAAA,IACX,YAAY;AAAA,EACd,EAAE;AAAA,EACD,CAAA,EAAgB,yBAAA,GAA4B,EAAA,OAAiB;AAAA,IAC5D,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,cAAc;AAAA,EAChB,EAAE;AAAA,EACD,CAAA,EAAgB,6BAAA,GAAgC,EAAA,OAAiB;AAAA,IAChE,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,CAAQ,GAAU,GAAO,MAAS,GAAM,kBAAkB,SAAS;AAAA,EACrE,EAAE;AAAA,EAGD,CAAA,EAAgB,+BAAA,GAAkC,EAAA,OAAiB;AAAA,IAClE,WAAW;AAAA,IACX,cAAc;AAAA,IAEd,YAAY;AAAA,EACd,EAAE;AACJ,GAEa,KAAS;AAAA,EACpB,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,aAAa;AAAA,EACb,mBAAmB;AAAA,EACnB,wBAAwB;AAAA,EACxB,2BAA2B;AAAA,EAC3B,aAAa;AAAA,EACb,6BAA6B;AAAA,EAC7B,kBAAkB;AAAA,EAClB,2BAA2B;AAAA,EAC3B,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAC7B,kBAAkB;AAAA,EAClB,mBAAmB;AACrB"}
|
|
1
|
+
{"version":3,"file":"blocks.es.js","names":[],"sources":["../../../src/insights-v2/mappings/blocks.ts"],"sourcesContent":["import {\n AccountBlock,\n AccountSwitchBlock,\n BarchartBlock,\n BudgetBlock,\n DebtsBlock,\n DetailedAccountBlock,\n DonutChartBlock,\n DoubleBarChartBlock,\n DoubleProgressBarBlock,\n NoSpendDaysBlock,\n RepeatingTransactionBlock,\n SaveExtraBlock,\n SavingsOpportunityBlock,\n SVGImageBlock,\n UpcomingSubscriptionBlock,\n WithdrawalBlock,\n TransactionBlock,\n} from '../blocks'\nimport StepChartBlock from '../blocks/ChartBlocks/StepChartBlock'\nimport ImageBlock from '../blocks/ImageBlocks/ImageBlock'\n\nimport type { Beat, GlobalCopy, InsightsPayload } from '../../core'\nimport { ContactSupportActionBlock } from '../actionBlocks/ContactSupportActionBlock'\nimport { FeedbackModalActionBlock } from '../actionBlocks/FeedbackModalActionBlock'\nimport { ConnectionDetailActionBlock } from '../actionBlocks/ConnectionDetailActionBlock'\nimport { ConnectWidgetActionBlock } from '../actionBlocks/ConnectWidgetActionBlock'\nimport { SurveyModalActionBlock } from '../actionBlocks/SurveyModalActionBlock'\nimport { PlaceholderActionBlock } from '../actionBlocks/PlaceholderActionBlock'\nimport { MakeTransferActionBlockLayer } from '../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer'\nimport { getMakeTransferDrawerTitle } from '../actionBlocks/MakeTransferActionBlock/layout'\nimport { TransactionHistoryBlock } from '../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock'\nimport { getDrawerHeaderTitle } from '../actionBlocks/TransactionHistoryBlock/utils'\nimport {\n TransactionDetailsBlock,\n useTransactionDetailsPrepare,\n} from '../actionBlocks/TransactionDetailsBlock'\nimport {\n RecurringTransactionBlock,\n useRecurringTransactionPrepare,\n} from '../actionBlocks/RecurringTransactionBlock'\nimport { TransactionListBlock } from '../actionBlocks/TransactionListBlock'\nimport { RemainingCashBlock } from '../actionBlocks/RemainingCashBlock'\nimport { AmountInputModalBlock } from '../actionBlocks/AmountInputModalBlock'\n// Keys live in ./actionBlocksKey (imported directly by chart blocks/tests too) to avoid a\n// circular import between this module and the chart blocks — see that file for details.\nimport { actionBlocksKey } from './actionBlocksKey'\n\n// Drilldown indexes are not passed down: action blocks read them from\n// InsightsV2Store (useInsightsV2Store().actionDrawer).\nexport interface ActionBlockProps {\n beat: Beat\n}\n\nconst noop = (_: ActionBlockProps) => {}\n\n// Re-exported so existing `hasDrawerBlock` imports from this module keep working.\nexport { hasDrawerBlock } from './hasDrawerBlock'\n\nexport interface ActionBlockEntry {\n Component: React.ComponentType<ActionBlockProps>\n usePrepare: (props: ActionBlockProps) => void // required; default to noop in each entry\n // Resolves the drawer title from the clicked CTA's variant + copy, with the beat available\n // for blocks that title from beat fields (e.g. transaction-list reads insights_payload.title).\n // Falls back to the CTA label when the resolver returns an empty string / is absent.\n title?: (variant: string | null | undefined, copy: GlobalCopy, beat?: Beat) => string\n // 'drawer' (default) or 'modal' (component renders its own dialog, no Drawer wrapper).\n presentation?: 'drawer' | 'modal'\n}\n\n// Registry of drawer drilldowns, keyed by the `block` name the backend sends Add\n// `usePrepare` when the block needs to load data before rendering.\n\n/**\n * A registry entry whose fields read their imports when used, not when this module loads. Some\n * registered blocks render `TransactionDetails`, whose embedded card mounts `ActionBlockLayer`,\n * which imports this registry: when one of those blocks loads first, its own import is not\n * initialised yet while this module evaluates, so a value copied at load would be `undefined`\n * (or throw under native ES modules). Reading on access sees the finished import.\n */\nconst liveEntry = (resolve: () => ActionBlockEntry): ActionBlockEntry => ({\n get Component() {\n return resolve().Component\n },\n get usePrepare() {\n return resolve().usePrepare\n },\n get title() {\n return resolve().title\n },\n get presentation() {\n return resolve().presentation\n },\n})\n\nexport const actionBlocks = {\n [actionBlocksKey.PLACEHOLDER_ACTION_BLOCK]: liveEntry(() => ({\n Component: PlaceholderActionBlock,\n usePrepare: noop,\n title: () => 'Action Block Layer Drilldown',\n })),\n [actionBlocksKey.MAKE_TRANSFER_ACTION_BLOCK]: liveEntry(() => ({\n Component: MakeTransferActionBlockLayer,\n usePrepare: noop,\n title: getMakeTransferDrawerTitle,\n })),\n [actionBlocksKey.TRANSCATION_HISTORY_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionHistoryBlock,\n usePrepare: noop,\n title: getDrawerHeaderTitle,\n })),\n [actionBlocksKey.TRANSACTION_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionDetailsBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: () => 'Transaction Details',\n })),\n // Expense Details for one recurring subscription. Which subscription a beat names is resolved in\n // `RecurringTransactionBlock/subscriptionBeats.ts`, not through this registry.\n [actionBlocksKey.RECURRING_TRANSACTION_ACTION_BLOCK]: liveEntry(() => ({\n Component: RecurringTransactionBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.recurring?.expense_details ?? '',\n })),\n // Remaining Cash for the Payday Cash Left Over Status beat. Store-driven: reuses the recurring\n // loader, which also loads accounts and categories, so CashflowStore's computeds are ready.\n [actionBlocksKey.REMAINING_CASH_ACTION_BLOCK]: liveEntry(() => ({\n Component: RemainingCashBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.insights_feed?.remaining_cash?.title ?? '',\n })),\n // The block renders its own drawer (the help module's RequestSupport) on top of the action\n // drawer, so the action drawer's title is the CTA label.\n [actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK]: liveEntry(() => ({\n Component: ContactSupportActionBlock,\n usePrepare: noop,\n title: (_variant, copy) => copy.help?.request_support ?? '',\n })),\n [actionBlocksKey.FEEDBACK_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: FeedbackModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.CONNECTION_DETAIL_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectionDetailActionBlock,\n usePrepare: noop,\n title: (_variant, copy) =>\n copy.insights_feed?.connection_details?.connection_details_drawer_title ?? '',\n })),\n // Boots MX's Connect widget (web-widget-sdk iframe) inside the action\n // drawer; the drawer title falls back to the CTA label.\n [actionBlocksKey.CONNECT_WIDGET_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectWidgetActionBlock,\n usePrepare: noop,\n })),\n [actionBlocksKey.SURVEY_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: SurveyModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.TRANSACTION_LIST_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionListBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: (_variant, _copy, beat) => beat?.insights_payload?.title ?? '',\n })),\n // One whole-dollar setting in a dialog; the CTA variant picks which (low-balance threshold or\n // safety net). A modal: no drawer, so no drawer title.\n [actionBlocksKey.AMOUNT_INPUT_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: AmountInputModalBlock,\n presentation: 'modal',\n // Loads inside the block: it mounts only while open, so mounting is the open-time load.\n usePrepare: noop,\n })),\n} as Record<string, ActionBlockEntry>\n\nexport const blocks = {\n account_block: AccountBlock,\n account_switch_block: AccountSwitchBlock,\n direct_deposit_block: DetailedAccountBlock,\n bar_chart_block: BarchartBlock,\n budget_block: BudgetBlock,\n debts_block: DebtsBlock,\n donut_chart_block: DonutChartBlock,\n double_bar_chart_block: DoubleBarChartBlock,\n double_progress_bar_block: DoubleProgressBarBlock,\n image_block: ImageBlock,\n no_spend_days_block: NoSpendDaysBlock,\n repeating_transaction_block: RepeatingTransactionBlock,\n save_extra_block: SaveExtraBlock,\n savings_opportunity_block: SavingsOpportunityBlock,\n step_chart_block: StepChartBlock,\n svg_image_block: SVGImageBlock,\n upcoming_bill_block: RepeatingTransactionBlock,\n upcoming_subscription_block: UpcomingSubscriptionBlock,\n withdrawal_block: WithdrawalBlock,\n transaction_block: TransactionBlock,\n} as Record<string, React.ComponentType<{ payload: InsightsPayload; beatGuid?: string }>>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,IAAM,IAAA,CAAQ,MAAwB;AAAC,GA0BjC,IAAA,CAAa,OAAuD;AAAA,EACxE,IAAI,YAAY;AACd,WAAO,EAAQ,EAAE;AAAA,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