@mx-cartographer/experiences 9.7.132 → 9.7.134

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/core/types/Insights.d.ts +1 -0
  3. package/dist/core/types/Insights.es.js.map +1 -1
  4. package/dist/core/types/localization/InsightsFeedCopy.d.ts +17 -0
  5. package/dist/insights/components/insights/BillAmountNotStandard/BillAmountNotStandard.es.js +4 -4
  6. package/dist/insights/components/insights/BillAmountNotStandard/BillAmountNotStandardMUI.es.js +4 -4
  7. package/dist/insights/components/insights/MonthlySpendingComparisonV2/MonthlySpendingComparisonV2.es.js +4 -4
  8. package/dist/insights/components/insights/WeeklyNoSpendDays/WeeklyNoSpendDays.es.js +8 -8
  9. package/dist/insights/components/shared/Charts/EmptyBarChart.es.js +4 -4
  10. package/dist/insights/components/shared/ZeroState/LinedCardZeroState.es.js +4 -4
  11. package/dist/insights/index.es.js +84 -84
  12. package/dist/insights-v2/actionBlocks/QuizMerchantBlock/QuizMerchantBlock.d.ts +7 -0
  13. package/dist/insights-v2/actionBlocks/QuizMerchantBlock/QuizMerchantBlock.es.js +147 -0
  14. package/dist/insights-v2/actionBlocks/QuizMerchantBlock/QuizMerchantBlock.es.js.map +1 -0
  15. package/dist/insights-v2/actionBlocks/QuizMerchantBlock/index.d.ts +1 -0
  16. package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.d.ts +6 -0
  17. package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.es.js +220 -0
  18. package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/QuizBlock.es.js.map +1 -0
  19. package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/index.d.ts +1 -0
  20. package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/quiz.d.ts +39 -0
  21. package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/quiz.es.js +44 -0
  22. package/dist/insights-v2/blocks/ComponentBlocks/QuizBlock/quiz.es.js.map +1 -0
  23. package/dist/insights-v2/blocks/ComponentBlocks/index.d.ts +1 -0
  24. package/dist/insights-v2/components/shared/elevation.d.ts +2 -0
  25. package/dist/insights-v2/components/shared/elevation.es.js +3 -2
  26. package/dist/insights-v2/components/shared/elevation.es.js.map +1 -1
  27. package/dist/insights-v2/ctaActions/ctaConfig.es.js +41 -23
  28. package/dist/insights-v2/ctaActions/ctaConfig.es.js.map +1 -1
  29. package/dist/insights-v2/ctaActions/ctaHandlers.d.ts +2 -0
  30. package/dist/insights-v2/ctaActions/ctaHandlers.es.js +32 -20
  31. package/dist/insights-v2/ctaActions/ctaHandlers.es.js.map +1 -1
  32. package/dist/insights-v2/ctaActions/hostActions.d.ts +1 -1
  33. package/dist/insights-v2/ctaActions/hostActions.es.js.map +1 -1
  34. package/dist/insights-v2/index.es.js +79 -77
  35. package/dist/insights-v2/mappings/actionBlocksKey.d.ts +1 -0
  36. package/dist/insights-v2/mappings/actionBlocksKey.es.js +2 -1
  37. package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
  38. package/dist/insights-v2/mappings/blocks.es.js +122 -114
  39. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  40. package/dist/recurringtransactions/components/RecurrenceRow.es.js +102 -92
  41. package/dist/recurringtransactions/components/RecurrenceRow.es.js.map +1 -1
  42. package/package.json +1 -1
@@ -1,45 +1,63 @@
1
- import { ANALYTICS_EVENTS_CONFIG as o } from "../analytics/analyticsEventsConfig.es.js";
2
- import { CTA_STATUS_CONTENT_CLASS as r } from "../components/CtaStatus.es.js";
3
- import { HOST_ACTIONS as a } from "./hostActions.es.js";
4
- import { subscriptionEntryStep as n, subscriptionSurvey as p } from "./subscriptionAnswer.es.js";
5
- import { alpha as c } from "@mui/material/styles";
6
- var u = ({ beat: t, stores: s }) => {
7
- const e = s.insightsV2Store.beatContext[t.guid]?.selected_account_guid;
8
- if (typeof e == "string")
9
- return s.accountStore.visibleSavingsAccounts.some((i) => i.guid === e && !i.is_closed && !i.is_deleted) ? e : void 0;
10
- }, S = {
1
+ import { ANALYTICS_EVENTS_CONFIG as a } from "../analytics/analyticsEventsConfig.es.js";
2
+ import { CTA_STATUS_CONTENT_CLASS as n } from "../components/CtaStatus.es.js";
3
+ import { QUIZ_CONTEXT as e } from "../blocks/ComponentBlocks/QuizBlock/quiz.es.js";
4
+ import { HOST_ACTIONS as c } from "./hostActions.es.js";
5
+ import { subscriptionEntryStep as d, subscriptionSurvey as _ } from "./subscriptionAnswer.es.js";
6
+ import { alpha as u } from "@mui/material/styles";
7
+ var s = ({ beat: t, stores: i }) => i.insightsV2Store.beatContext[t.guid] ?? {}, p = ({ beat: t, stores: i }) => {
8
+ const r = i.insightsV2Store.beatContext[t.guid]?.selected_account_guid;
9
+ if (typeof r == "string")
10
+ return i.accountStore.visibleSavingsAccounts.some((o) => o.guid === r && !o.is_closed && !o.is_deleted) ? r : void 0;
11
+ }, b = {
11
12
  dismiss_beat: {
12
13
  run: "delegateToHost",
13
- params: { hostAction: a.dismissBeat }
14
+ params: { hostAction: c.dismissBeat }
14
15
  },
15
16
  select_savings_account: {
16
17
  run: "updateUserInsightProfile",
17
- params: (t) => ({ fields: { emergency_savings_account_guid: u(t) } }),
18
- disabledWhen: (t) => !u(t),
18
+ params: (t) => ({ fields: { emergency_savings_account_guid: p(t) } }),
19
+ disabledWhen: (t) => !p(t),
19
20
  onSuccess: ["refreshBeat"],
20
- analytics: o.EMERGENCY_SAVINGS_ACCT_SAVED
21
+ analytics: a.EMERGENCY_SAVINGS_ACCT_SAVED
21
22
  },
22
- open_savings_account: { analytics: o.EMERGENCY_SAVINGS_ACCT_CREATED },
23
+ open_savings_account: { analytics: a.EMERGENCY_SAVINGS_ACCT_CREATED },
23
24
  atomic_flow: {
24
25
  run: "delegateToHost",
25
- params: { hostAction: a.atomicTransact }
26
+ params: { hostAction: c.atomicTransact }
26
27
  },
27
28
  confirm_subscription_detected: {
28
- ...n({ statusLabels: {
29
+ ...d({ statusLabels: {
29
30
  positive: "confirmed",
30
31
  negative: "incorrect"
31
32
  } }),
32
- surveyAnswer: p
33
+ surveyAnswer: _
34
+ },
35
+ check_quiz_answer: {
36
+ run: "updateBeatContext",
37
+ params: { fields: { [e.CHECKED]: !0 } },
38
+ disabledWhen: (t) => !s(t)[e.PICK] || !!s(t)[e.CHECKED],
39
+ presenter: (t) => s(t)[e.REVEALED] ? {
40
+ kind: "hidden",
41
+ hideAll: !0
42
+ } : void 0
43
+ },
44
+ skip_quiz: {
45
+ run: "updateBeatContext",
46
+ params: {
47
+ fields: { [e.REVEALED]: !0 },
48
+ markCtaClicked: !0
49
+ },
50
+ disabledWhen: (t) => !!s(t)[e.CHECKED]
33
51
  },
34
52
  confirm_subscription_status: {
35
- ...n({
53
+ ...d({
36
54
  statusLabels: {
37
55
  positive: "subscribed",
38
56
  negative: "not_subscribed"
39
57
  },
40
58
  sx: {
41
59
  minHeight: 56,
42
- [`& .${r}`]: { gap: 10 },
60
+ [`& .${n}`]: { gap: 10 },
43
61
  "& > .MuiButton-root": {
44
62
  fontSize: 13,
45
63
  fontWeight: 600,
@@ -51,8 +69,8 @@ var u = ({ beat: t, stores: s }) => {
51
69
  },
52
70
  negativeSx: {
53
71
  bgcolor: "background.paper",
54
- borderColor: (t) => c(t.palette.text.primary, 0.5),
55
- [`& .${r} .MuiSvgIcon-root`]: { color: (t) => c(t.palette.text.primary, 0.7) }
72
+ borderColor: (t) => u(t.palette.text.primary, 0.5),
73
+ [`& .${n} .MuiSvgIcon-root`]: { color: (t) => u(t.palette.text.primary, 0.7) }
56
74
  },
57
75
  answeredTitle: (t) => t.insights_feed?.subscription_status_modal?.reviewed_title
58
76
  }),
@@ -60,7 +78,7 @@ var u = ({ beat: t, stores: s }) => {
60
78
  }
61
79
  };
62
80
  export {
63
- S as ctaActions
81
+ b as ctaActions
64
82
  };
65
83
 
66
84
  //# sourceMappingURL=ctaConfig.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ctaConfig.es.js","names":[],"sources":["../../../src/insights-v2/ctaActions/ctaConfig.ts"],"sourcesContent":["import { alpha, type Theme } from '@mui/material/styles'\n\nimport { ANALYTICS_EVENTS_CONFIG } from '../analytics/analyticsEventsConfig'\nimport { CTA_STATUS_CONTENT_CLASS } from '../components/CtaStatus'\nimport { HOST_ACTIONS } from './hostActions'\nimport { subscriptionEntryStep, subscriptionSurvey } from './subscriptionAnswer'\nimport type { CtaStateContext, CtaStep } from './types'\n\n/**\n * The account the svg_image_block picker wrote into this beat's context, and only while it is\n * still one the user can save into (visible, open, not deleted) — a pick that went stale between\n * pick and Save never reaches the API.\n */\nconst pickedSavingsAccountGuid = ({ beat, stores }: Pick<CtaStateContext, 'beat' | 'stores'>) => {\n const picked = stores.insightsV2Store.beatContext[beat.guid]?.selected_account_guid\n\n if (typeof picked !== 'string') return undefined\n\n const usable = stores.accountStore.visibleSavingsAccounts.some(\n (account) => account.guid === picked && !account.is_closed && !account.is_deleted,\n )\n\n return usable ? picked : undefined\n}\n\n/**\n * Steps keyed by the backend-named `cta.action_key` (ditto `*_cta_action`, via tupac). No key or\n * an unknown key = default: open the CTA's block drawer, if any. Its post message, when one\n * resolves (`cta.metadata` / `ctaPostMessages`), is sent either way. A new key is registered in\n * ditto and here in the same change; most CTAs need none. See README.md.\n */\nexport const ctaActions: Record<string, CtaStep> = {\n /** ConnectDiscoveredAccounts \"I don't have any\": dismiss through the host, then stop. */\n dismiss_beat: {\n run: 'delegateToHost',\n params: { hostAction: HOST_ACTIONS.dismissBeat },\n },\n\n /**\n * Designate Emergency Savings Account \"Save\": designates the account picked in the\n * svg_image_block picker (kept in the per-beat context), then refreshes the beat. The beat is\n * sampled, so the refresh re-reads its sample, which the backend rebuilds as the saved card\n * (change_account: \"Account Saved!\", no CTA). Disabled until a pick is made.\n */\n select_savings_account: {\n run: 'updateUserInsightProfile',\n params: (ctx) => ({\n fields: { emergency_savings_account_guid: pickedSavingsAccountGuid(ctx) },\n }),\n disabledWhen: (ctx) => !pickedSavingsAccountGuid(ctx),\n onSuccess: ['refreshBeat'],\n analytics: ANALYTICS_EVENTS_CONFIG.EMERGENCY_SAVINGS_ACCT_SAVED,\n },\n\n /**\n * Designate Emergency Savings Account \"Open a Savings Account\": no handler. The op_1 post\n * message comes from `ctaPostMessages`; this step adds the Created event.\n */\n open_savings_account: {\n analytics: ANALYTICS_EVENTS_CONFIG.EMERGENCY_SAVINGS_ACCT_CREATED,\n },\n\n /**\n * SetUpDirectDeposit `not_set_up`: hand the press to the host, which owns the Atomic SDK and its\n * lifecycle. No drawer, no `refreshBeat`, and no interim post message is registered for the\n * template (a backend-supplied `cta.metadata` would still post).\n */\n atomic_flow: {\n run: 'delegateToHost',\n params: { hostAction: HOST_ACTIONS.atomicTransact },\n },\n\n /**\n * SubscriptionDetected \"Does this look right?\": the shared subscription status CTA (every answer\n * counts, as pulse), answered through the survey.\n */\n confirm_subscription_detected: {\n ...subscriptionEntryStep({ statusLabels: { positive: 'confirmed', negative: 'incorrect' } }),\n surveyAnswer: subscriptionSurvey,\n },\n\n /** Unexpected Subscription Payment: Figma's status bar; mini and micro mirror it (`compactStatus`). */\n confirm_subscription_status: {\n ...subscriptionEntryStep({\n statusLabels: { positive: 'subscribed', negative: 'not_subscribed' },\n sx: {\n minHeight: 56,\n [`& .${CTA_STATUS_CONTENT_CLASS}`]: { gap: 10 },\n '& > .MuiButton-root': {\n fontSize: 13,\n fontWeight: 600,\n lineHeight: '16px',\n minWidth: 0,\n px: 8,\n py: 4,\n },\n },\n negativeSx: {\n bgcolor: 'background.paper',\n borderColor: (theme: Theme) => alpha(theme.palette.text.primary, 0.5),\n [`& .${CTA_STATUS_CONTENT_CLASS} .MuiSvgIcon-root`]: {\n color: (theme: Theme) => alpha(theme.palette.text.primary, 0.7),\n },\n },\n answeredTitle: (copy) => copy.insights_feed?.subscription_status_modal?.reviewed_title,\n }),\n compactStatus: true,\n },\n}\n"],"mappings":";;;;;AAaA,IAAM,IA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,QACN;AAAA,MACF;AAAA,MACA,YAAY;AAAA,QACV,SAAS;AAAA,QACT,aAAA,CAAc,MAAiB,EAAM,EAAM,QAAQ,KAAK,SAAS,GAAG;AAAA,QACnE,CAAA,MAAM,CAAA,mBAAyB,GAAqB,EACnD,OAAA,CAAQ,MAAiB,EAAM,EAAM,QAAQ,KAAK,SAAS,GAAG,EAChE;AAAA,MACF;AAAA,MACA,eAAA,CAAgB,MAAS,EAAK,eAAe,2BAA2B;AAAA,IAC1E,CAAC;AAAA,IACD,eAAe;AAAA,EACjB;AACF"}
1
+ {"version":3,"file":"ctaConfig.es.js","names":[],"sources":["../../../src/insights-v2/ctaActions/ctaConfig.ts"],"sourcesContent":["import { alpha, type Theme } from '@mui/material/styles'\n\nimport { ANALYTICS_EVENTS_CONFIG } from '../analytics/analyticsEventsConfig'\nimport { CTA_STATUS_CONTENT_CLASS } from '../components/CtaStatus'\nimport { QUIZ_CONTEXT } from '../blocks/ComponentBlocks/QuizBlock/quiz'\nimport { HOST_ACTIONS } from './hostActions'\nimport { subscriptionEntryStep, subscriptionSurvey } from './subscriptionAnswer'\nimport type { CtaStateContext, CtaStep } from './types'\n\nconst quizContext = ({ beat, stores }: Pick<CtaStateContext, 'beat' | 'stores'>) =>\n stores.insightsV2Store.beatContext[beat.guid] ?? {}\n\n/**\n * The account the svg_image_block picker wrote into this beat's context, and only while it is\n * still one the user can save into (visible, open, not deleted) — a pick that went stale between\n * pick and Save never reaches the API.\n */\nconst pickedSavingsAccountGuid = ({ beat, stores }: Pick<CtaStateContext, 'beat' | 'stores'>) => {\n const picked = stores.insightsV2Store.beatContext[beat.guid]?.selected_account_guid\n\n if (typeof picked !== 'string') return undefined\n\n const usable = stores.accountStore.visibleSavingsAccounts.some(\n (account) => account.guid === picked && !account.is_closed && !account.is_deleted,\n )\n\n return usable ? picked : undefined\n}\n\n/**\n * Steps keyed by the backend-named `cta.action_key` (ditto `*_cta_action`, via tupac). No key or\n * an unknown key = default: open the CTA's block drawer, if any. Its post message, when one\n * resolves (`cta.metadata` / `ctaPostMessages`), is sent either way. A new key is registered in\n * ditto and here in the same change; most CTAs need none. See README.md.\n */\nexport const ctaActions: Record<string, CtaStep> = {\n /** ConnectDiscoveredAccounts \"I don't have any\": dismiss through the host, then stop. */\n dismiss_beat: {\n run: 'delegateToHost',\n params: { hostAction: HOST_ACTIONS.dismissBeat },\n },\n\n /**\n * Designate Emergency Savings Account \"Save\": designates the account picked in the\n * svg_image_block picker (kept in the per-beat context), then refreshes the beat. The beat is\n * sampled, so the refresh re-reads its sample, which the backend rebuilds as the saved card\n * (change_account: \"Account Saved!\", no CTA). Disabled until a pick is made.\n */\n select_savings_account: {\n run: 'updateUserInsightProfile',\n params: (ctx) => ({\n fields: { emergency_savings_account_guid: pickedSavingsAccountGuid(ctx) },\n }),\n disabledWhen: (ctx) => !pickedSavingsAccountGuid(ctx),\n onSuccess: ['refreshBeat'],\n analytics: ANALYTICS_EVENTS_CONFIG.EMERGENCY_SAVINGS_ACCT_SAVED,\n },\n\n /**\n * Designate Emergency Savings Account \"Open a Savings Account\": no handler. The op_1 post\n * message comes from `ctaPostMessages`; this step adds the Created event.\n */\n open_savings_account: {\n analytics: ANALYTICS_EVENTS_CONFIG.EMERGENCY_SAVINGS_ACCT_CREATED,\n },\n\n /**\n * SetUpDirectDeposit `not_set_up`: hand the press to the host, which owns the Atomic SDK and its\n * lifecycle. No drawer, no `refreshBeat`, and no interim post message is registered for the\n * template (a backend-supplied `cta.metadata` would still post).\n */\n atomic_flow: {\n run: 'delegateToHost',\n params: { hostAction: HOST_ACTIONS.atomicTransact },\n },\n\n /**\n * SubscriptionDetected \"Does this look right?\": the shared subscription status CTA (every answer\n * counts, as pulse), answered through the survey.\n */\n confirm_subscription_detected: {\n ...subscriptionEntryStep({ statusLabels: { positive: 'confirmed', negative: 'incorrect' } }),\n surveyAnswer: subscriptionSurvey,\n },\n\n /** Monthly Top Transacted Merchant \"Check Answer\": the block plays the feedback, then the results. */\n check_quiz_answer: {\n run: 'updateBeatContext',\n params: { fields: { [QUIZ_CONTEXT.CHECKED]: true } },\n disabledWhen: (ctx) =>\n !quizContext(ctx)[QUIZ_CONTEXT.PICK] || !!quizContext(ctx)[QUIZ_CONTEXT.CHECKED],\n // Once the results show, the card has no buttons, as Figma's Results state.\n presenter: (ctx) =>\n quizContext(ctx)[QUIZ_CONTEXT.REVEALED] ? { kind: 'hidden', hideAll: true } : undefined,\n },\n\n /** Monthly Top Transacted Merchant \"Skip to Results\": shows the results and records `cta_clicked_at`. */\n skip_quiz: {\n run: 'updateBeatContext',\n params: { fields: { [QUIZ_CONTEXT.REVEALED]: true }, markCtaClicked: true },\n disabledWhen: (ctx) => !!quizContext(ctx)[QUIZ_CONTEXT.CHECKED],\n },\n\n /** Unexpected Subscription Payment: Figma's status bar; mini and micro mirror it (`compactStatus`). */\n confirm_subscription_status: {\n ...subscriptionEntryStep({\n statusLabels: { positive: 'subscribed', negative: 'not_subscribed' },\n sx: {\n minHeight: 56,\n [`& .${CTA_STATUS_CONTENT_CLASS}`]: { gap: 10 },\n '& > .MuiButton-root': {\n fontSize: 13,\n fontWeight: 600,\n lineHeight: '16px',\n minWidth: 0,\n px: 8,\n py: 4,\n },\n },\n negativeSx: {\n bgcolor: 'background.paper',\n borderColor: (theme: Theme) => alpha(theme.palette.text.primary, 0.5),\n [`& .${CTA_STATUS_CONTENT_CLASS} .MuiSvgIcon-root`]: {\n color: (theme: Theme) => alpha(theme.palette.text.primary, 0.7),\n },\n },\n answeredTitle: (copy) => copy.insights_feed?.subscription_status_modal?.reviewed_title,\n }),\n compactStatus: true,\n },\n}\n"],"mappings":";;;;;;AASA,IAAM,IAAA,CAAe,EAAE,MAAA,GAAM,QAAA,EAAA,MAC3B,EAAO,gBAAgB,YAAY,EAAK,IAAA,KAAS,CAAC,GAO9C,IAAA,CAA4B,EAAE,MAAA,GAAM,QAAA,EAAA,MAAuD;AAC/F,QAAM,IAAS,EAAO,gBAAgB,YAAY,EAAK,IAAA,G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AAa,QAAA,GAAW,GAAK;AAAA,MAAG,gBAAgB;AAAA,IAAK;AAAA,IAC1E,cAAA,CAAe,MAAQ,CAAC,CAAC,EAAY,CAAG,EAAE,EAAa,OAAA;AAAA,EACzD;AAAA,EAGA,6BAA6B;AAAA,IAC3B,GAAG,EAAsB;AAAA,MACvB,cAAc;AAAA,QAAE,UAAU;AAAA,QAAc,UAAU;AAAA,MAAiB;AAAA,MACnE,IAAI;AAAA,QACF,WAAW;AAAA,QACV,CAAA,MAAM,CAAA,EAAA,GAA6B,EAAE,KAAK,GAAG;AAAA,QAC9C,uBAAuB;AAAA,UACrB,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,YAAY;AAAA,UACZ,UAAU;AAAA,UACV,IAAI;AAAA,UACJ,IAAI;AAAA,QACN;AAAA,MACF;AAAA,MACA,YAAY;AAAA,QACV,SAAS;AAAA,QACT,aAAA,CAAc,MAAiB,EAAM,EAAM,QAAQ,KAAK,SAAS,GAAG;AAAA,QACnE,CAAA,MAAM,CAAA,mBAAyB,GAAqB,EACnD,OAAA,CAAQ,MAAiB,EAAM,EAAM,QAAQ,KAAK,SAAS,GAAG,EAChE;AAAA,MACF;AAAA,MACA,eAAA,CAAgB,MAAS,EAAK,eAAe,2BAA2B;AAAA,IAC1E,CAAC;AAAA,IACD,eAAe;AAAA,EACjB;AACF"}
@@ -33,6 +33,8 @@ export declare const ctaHandlers: {
33
33
  updateTransactionField: (ctx: CtaContext) => Promise<void>;
34
34
  /** `POST`/`PUT transaction_rules` so `params.categoryGuid` applies to future matches. */
35
35
  applyTransactionRule: (ctx: CtaContext) => Promise<void>;
36
+ /** Merges `params.fields` into beat context; `params.markCtaClicked` records `cta_clicked_at`. */
37
+ updateBeatContext: (ctx: CtaContext) => Promise<void>;
36
38
  delegateToHost: (ctx: CtaContext) => Promise<void>;
37
39
  };
38
40
  /** A registered handler name. */
@@ -1,9 +1,10 @@
1
- var d = (t, e) => t.params[e], n = (t, e) => {
2
- const r = d(t, e);
1
+ import { HOST_ACTIONS as g } from "./hostActions.es.js";
2
+ var s = (t, e) => t.params[e], n = (t, e) => {
3
+ const r = s(t, e);
3
4
  if (r == null || r === "") throw new Error(`CTA handler requires params.${e}`);
4
5
  return r;
5
- }, c = (t) => {
6
- const e = d(t, "fields");
6
+ }, u = (t) => {
7
+ const e = s(t, "fields");
7
8
  if (!e || Object.keys(e).length === 0) throw new Error("CTA handler requires params.fields");
8
9
  const r = Object.keys(e).filter((a) => e[a] === void 0);
9
10
  if (r.length > 0) throw new Error(`CTA handler could not resolve field(s): ${r.join(", ")}`);
@@ -12,9 +13,9 @@ var d = (t, e) => t.params[e], n = (t, e) => {
12
13
  const a = t.find(e);
13
14
  if (!a) throw new Error(`${r} not found in store`);
14
15
  return a;
15
- }, g = {
16
+ }, p = {
16
17
  updateUserInsightProfile: async (t) => {
17
- await t.stores.userStore.updateUserInsightProfile(c(t));
18
+ await t.stores.userStore.updateUserInsightProfile(u(t));
18
19
  },
19
20
  markOfferClicked: async ({ beat: t, stores: e }) => {
20
21
  await e.beatStore.updateOffer({
@@ -23,21 +24,21 @@ var d = (t, e) => t.params[e], n = (t, e) => {
23
24
  });
24
25
  },
25
26
  updateRepeatingTransactionResponse: async (t) => {
26
- const { beat: e, stores: r } = t, a = n(t, "userResponse"), o = d(t, "repeatingTransactionGuid") ?? e.primary_transaction?.repeating_transaction_guid;
27
+ const { beat: e, stores: r } = t, a = n(t, "userResponse"), o = s(t, "repeatingTransactionGuid") ?? e.primary_transaction?.repeating_transaction_guid;
27
28
  if (!o) throw new Error("No repeating transaction guid for beat");
28
- const s = i(r.recurringTransactionsStore.repeatingTransactions, (u) => u.guid === o, `Repeating transaction ${o}`);
29
+ const d = i(r.recurringTransactionsStore.repeatingTransactions, (c) => c.guid === o, `Repeating transaction ${o}`);
29
30
  if (!await r.recurringTransactionsStore.updateRepeatingTransaction({
30
- ...s,
31
+ ...d,
31
32
  user_response: a
32
33
  })) throw new Error("Failed to update repeating transaction");
33
34
  },
34
35
  updateAccountField: async (t) => {
35
- const { beat: e, stores: r } = t, a = d(t, "accountGuid") ?? e.primary_account_guid;
36
+ const { beat: e, stores: r } = t, a = s(t, "accountGuid") ?? e.primary_account_guid;
36
37
  if (!a) throw new Error("No account guid for beat");
37
- const o = i(r.accountStore.accounts, (s) => s.guid === a, `Account ${a}`);
38
+ const o = i(r.accountStore.accounts, (d) => d.guid === a, `Account ${a}`);
38
39
  if (!await r.accountStore.updateAccount({
39
40
  ...o,
40
- ...c(t)
41
+ ...u(t)
41
42
  })) throw new Error("Failed to update account");
42
43
  },
43
44
  updateNotificationProfileThreshold: async (t) => {
@@ -49,7 +50,7 @@ var d = (t, e) => t.params[e], n = (t, e) => {
49
50
  },
50
51
  createBudget: async (t) => {
51
52
  const e = n(t, "categoryGuid"), r = n(t, "amount"), a = i(t.stores.categoryStore.categories, (o) => o.guid === e, `Category ${e}`);
52
- if (!await t.stores.budgetsStore.addBudget(a, r, d(t, "parentGuid") ?? null)) throw new Error("Failed to create budget");
53
+ if (!await t.stores.budgetsStore.addBudget(a, r, s(t, "parentGuid") ?? null)) throw new Error("Failed to create budget");
53
54
  },
54
55
  updateBudget: async (t) => {
55
56
  const e = n(t, "budgetGuid"), r = n(t, "amount"), a = i(t.stores.budgetsStore.budgets, (o) => o.guid === e, `Budget ${e}`);
@@ -75,19 +76,30 @@ var d = (t, e) => t.params[e], n = (t, e) => {
75
76
  if (!(await t.stores.budgetsStore.deleteMerchantBudget(n(t, "merchantBudgetGuid")))?.isSuccess) throw new Error("Failed to delete merchant budget");
76
77
  },
77
78
  updateTransactionField: async (t) => {
78
- const { beat: e, stores: r } = t, a = d(t, "transactionGuid") ?? e.primary_transaction_guid;
79
+ const { beat: e, stores: r } = t, a = s(t, "transactionGuid") ?? e.primary_transaction_guid;
79
80
  if (!a) throw new Error("No transaction guid for beat");
80
- const o = i(r.transactionStore.transactions, (s) => s.guid === a, `Transaction ${a}`);
81
+ const o = i(r.transactionStore.transactions, (d) => d.guid === a, `Transaction ${a}`);
81
82
  if (!await r.transactionStore.updateTransaction({
82
83
  ...o,
83
- ...c(t)
84
+ ...u(t)
84
85
  })) throw new Error("Failed to update transaction");
85
86
  },
86
87
  applyTransactionRule: async (t) => {
87
- const { beat: e, stores: r } = t, a = n(t, "categoryGuid"), o = d(t, "transactionGuid") ?? e.primary_transaction_guid;
88
+ const { beat: e, stores: r } = t, a = n(t, "categoryGuid"), o = s(t, "transactionGuid") ?? e.primary_transaction_guid;
88
89
  if (!o) throw new Error("No transaction guid for beat");
89
- const s = i(r.transactionStore.transactions, (u) => u.guid === o, `Transaction ${o}`);
90
- if (!await r.transactionStore.addOrUpdateTransactionRule(a, s)) throw new Error("Failed to save transaction rule");
90
+ const d = i(r.transactionStore.transactions, (c) => c.guid === o, `Transaction ${o}`);
91
+ if (!await r.transactionStore.addOrUpdateTransactionRule(a, d)) throw new Error("Failed to save transaction rule");
92
+ },
93
+ updateBeatContext: async (t) => {
94
+ const { beat: e, hostActions: r, stores: a } = t;
95
+ a.insightsV2Store.setBeatContext(e.guid, u(t)), !(!s(t, "markCtaClicked") || e.cta_clicked_at) && Promise.resolve().then(() => r.onCtaAction?.({
96
+ beatGuid: e.guid,
97
+ name: g.markCtaClicked
98
+ })).catch((o) => a.captureException(o, {
99
+ store: "ctaActions",
100
+ template: e.template,
101
+ handler: "updateBeatContext"
102
+ }));
91
103
  },
92
104
  delegateToHost: async (t) => {
93
105
  const { hostAction: e, ...r } = t.params, a = typeof e == "string" ? e : "";
@@ -101,7 +113,7 @@ var d = (t, e) => t.params[e], n = (t, e) => {
101
113
  }
102
114
  };
103
115
  export {
104
- g as ctaHandlers
116
+ p as ctaHandlers
105
117
  };
106
118
 
107
119
  //# sourceMappingURL=ctaHandlers.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ctaHandlers.es.js","names":[],"sources":["../../../src/insights-v2/ctaActions/ctaHandlers.ts"],"sourcesContent":["import type { Account, Budget, MerchantBudget, Transaction, UserInsightProfile } from '../../core'\nimport type { CtaContext, CtaHandler } from './types'\n\n// Step side effects: call stores, throw on failure, read ctx.params.\n// Host-owned effects (beat endpoints, spending plan) use delegateToHost.\n\nconst param = <T>(ctx: CtaContext, key: string): T | undefined => ctx.params[key] as T | undefined\n\nconst requireParam = <T>(ctx: CtaContext, key: string): T => {\n const value = param<T>(ctx, key)\n\n if (value === undefined || value === null || value === '') {\n throw new Error(`CTA handler requires params.${key}`)\n }\n\n return value\n}\n\n// The write set under params.fields; throws if a pick is missing.\nconst requireFields = (ctx: CtaContext): Record<string, unknown> => {\n const fields = param<Record<string, unknown>>(ctx, 'fields')\n\n if (!fields || Object.keys(fields).length === 0) {\n throw new Error('CTA handler requires params.fields')\n }\n\n const missing = Object.keys(fields).filter((field) => fields[field] === undefined)\n\n if (missing.length > 0) {\n throw new Error(`CTA handler could not resolve field(s): ${missing.join(', ')}`)\n }\n\n return fields\n}\n\nconst findOrThrow = <T>(items: T[], predicate: (item: T) => boolean, what: string): T => {\n const found = items.find(predicate)\n\n if (!found) throw new Error(`${what} not found in store`)\n\n return found\n}\n\nexport const ctaHandlers = {\n /** `PUT user_insight_profile` (designate emergency savings, thresholds, safety net). */\n updateUserInsightProfile: async (ctx) => {\n await ctx.stores.userStore.updateUserInsightProfile(\n requireFields(ctx) as Partial<UserInsightProfile>,\n )\n },\n\n /** `PUT offers/:guid` flagging a marketing offer as clicked. */\n markOfferClicked: async ({ beat, stores }) => {\n await stores.beatStore.updateOffer({ ...beat, has_been_clicked: true } as typeof beat)\n },\n\n /**\n * `PUT repeating_transactions/:guid` writing `user_response`. Resolves the repeating\n * transaction from `params.repeatingTransactionGuid`, else the beat's primary transaction.\n */\n updateRepeatingTransactionResponse: async (ctx) => {\n const { beat, stores } = ctx\n const userResponse = requireParam<string>(ctx, 'userResponse')\n const guid =\n param<string>(ctx, 'repeatingTransactionGuid') ??\n beat.primary_transaction?.repeating_transaction_guid\n\n if (!guid) throw new Error('No repeating transaction guid for beat')\n\n const repeating = findOrThrow(\n stores.recurringTransactionsStore.repeatingTransactions,\n (rt) => rt.guid === guid,\n `Repeating transaction ${guid}`,\n )\n const ok = await stores.recurringTransactionsStore.updateRepeatingTransaction({\n ...repeating,\n user_response: userResponse,\n })\n\n if (!ok) throw new Error('Failed to update repeating transaction')\n },\n\n /** `PUT accounts/:guid` merging `params.fields`; `params.accountGuid` picks the account, else the beat's primary. */\n updateAccountField: async (ctx) => {\n const { beat, stores } = ctx\n const guid = param<string>(ctx, 'accountGuid') ?? beat.primary_account_guid\n\n if (!guid) throw new Error('No account guid for beat')\n\n const account = findOrThrow(\n stores.accountStore.accounts,\n (a) => a.guid === guid,\n `Account ${guid}`,\n )\n\n const ok = await stores.accountStore.updateAccount({\n ...account,\n ...requireFields(ctx),\n } as Account)\n\n if (!ok) throw new Error('Failed to update account')\n },\n\n /** `PUT notification_profiles/:guid` setting `threshold` on the named profile. */\n updateNotificationProfileThreshold: async (ctx) => {\n const profileGuid = requireParam<string>(ctx, 'profileGuid')\n const threshold = requireParam<number>(ctx, 'threshold')\n const profile = findOrThrow(\n ctx.stores.settingsStore.notificationProfiles,\n (p) => p.guid === profileGuid,\n `Notification profile ${profileGuid}`,\n )\n\n const ok = await ctx.stores.settingsStore.updateNotificationProfile({ ...profile, threshold })\n\n if (!ok) throw new Error('Failed to update notification profile')\n },\n\n /** `POST budgets` for `params.categoryGuid` with `params.amount` (+ optional parentGuid). */\n createBudget: async (ctx) => {\n const categoryGuid = requireParam<string>(ctx, 'categoryGuid')\n const amount = requireParam<number>(ctx, 'amount')\n const category = findOrThrow(\n ctx.stores.categoryStore.categories,\n (c) => c.guid === categoryGuid,\n `Category ${categoryGuid}`,\n )\n\n const ok = await ctx.stores.budgetsStore.addBudget(\n category,\n amount,\n param<string | null>(ctx, 'parentGuid') ?? null,\n )\n\n if (!ok) throw new Error('Failed to create budget')\n },\n\n /** `PUT budgets/:guid` setting `amount`. */\n updateBudget: async (ctx) => {\n const budgetGuid = requireParam<string>(ctx, 'budgetGuid')\n const amount = requireParam<number>(ctx, 'amount')\n const budget = findOrThrow(\n ctx.stores.budgetsStore.budgets,\n (b) => b.guid === budgetGuid,\n `Budget ${budgetGuid}`,\n )\n const ok = await ctx.stores.budgetsStore.updateBudget({ ...budget, amount } as Budget)\n\n if (!ok) throw new Error('Failed to update budget')\n },\n\n /** `DELETE budgets/:guid`. */\n deleteBudget: async (ctx) => {\n const ok = await ctx.stores.budgetsStore.deleteBudget(requireParam<string>(ctx, 'budgetGuid'))\n\n if (!ok) throw new Error('Failed to delete budget')\n },\n\n /** `POST merchant_budgets`. */\n createMerchantBudget: async (ctx) => {\n const result = await ctx.stores.budgetsStore.addMerchantBudget(\n requireParam<string>(ctx, 'merchantGuid'),\n requireParam<number>(ctx, 'amount'),\n )\n\n if (!result?.isSuccess) throw new Error('Failed to create merchant budget')\n },\n\n /** `PUT merchant_budgets/:guid` setting `amount`. */\n updateMerchantBudget: async (ctx) => {\n const guid = requireParam<string>(ctx, 'merchantBudgetGuid')\n const amount = requireParam<number>(ctx, 'amount')\n const merchantBudget = findOrThrow(\n ctx.stores.budgetsStore.merchantBudgets,\n (mb) => mb.guid === guid,\n `Merchant budget ${guid}`,\n )\n const result = await ctx.stores.budgetsStore.updateMerchantBudget({\n ...merchantBudget,\n amount,\n } as MerchantBudget)\n\n if (!result?.isSuccess) throw new Error('Failed to update merchant budget')\n },\n\n /** `DELETE merchant_budgets/:guid`. */\n deleteMerchantBudget: async (ctx) => {\n const result = await ctx.stores.budgetsStore.deleteMerchantBudget(\n requireParam<string>(ctx, 'merchantBudgetGuid'),\n )\n\n if (!result?.isSuccess) throw new Error('Failed to delete merchant budget')\n },\n\n /**\n * `PUT transactions/:guid` merging `params.fields` (category_guid, date, memo,\n * description, is_hidden...). Resolves the transaction from `params.transactionGuid`,\n * else the beat's primary transaction guid.\n */\n updateTransactionField: async (ctx) => {\n const { beat, stores } = ctx\n const guid = param<string>(ctx, 'transactionGuid') ?? beat.primary_transaction_guid\n\n if (!guid) throw new Error('No transaction guid for beat')\n\n const transaction = findOrThrow(\n stores.transactionStore.transactions,\n (t) => t.guid === guid,\n `Transaction ${guid}`,\n )\n\n const ok = await stores.transactionStore.updateTransaction({\n ...transaction,\n ...requireFields(ctx),\n } as Transaction)\n\n if (!ok) throw new Error('Failed to update transaction')\n },\n\n /** `POST`/`PUT transaction_rules` so `params.categoryGuid` applies to future matches. */\n applyTransactionRule: async (ctx) => {\n const { beat, stores } = ctx\n const categoryGuid = requireParam<string>(ctx, 'categoryGuid')\n const guid = param<string>(ctx, 'transactionGuid') ?? beat.primary_transaction_guid\n\n if (!guid) throw new Error('No transaction guid for beat')\n\n const transaction = findOrThrow(\n stores.transactionStore.transactions,\n (t) => t.guid === guid,\n `Transaction ${guid}`,\n )\n\n const ok = await stores.transactionStore.addOrUpdateTransactionRule(categoryGuid, transaction)\n\n if (!ok) throw new Error('Failed to save transaction rule')\n },\n\n // Hands a host-owned effect to the app via beatActions.onCtaAction.\n delegateToHost: async (ctx) => {\n const { hostAction, ...rest } = ctx.params\n const name = typeof hostAction === 'string' ? hostAction : ''\n\n if (!name) throw new Error('delegateToHost requires params.hostAction')\n if (!ctx.hostActions.onCtaAction) {\n throw new Error(`Host does not implement onCtaAction (needed for \"${name}\")`)\n }\n\n await ctx.hostActions.onCtaAction({ beatGuid: ctx.beat.guid, name, params: rest })\n },\n} satisfies Record<string, CtaHandler>\n\n/** A registered handler name. */\nexport type CtaHandlerName = keyof typeof ctaHandlers\n"],"mappings":"AAMA,IAAM,IAAA,CAAY,GAAiB,MAA+B,EAAI,OAAO,CAAA,GAEvE,IAAA,CAAmB,GAAiB,MAAmB;AAC3D,QAAM,IAAQ,EAAS,GAAK,CAAG;AAE/B,MAA2B,KAAU,QAAQ,MAAU,GACrD,OAAM,IAAI,MAAM,+BAA+B,CAAA,EAAK;AAGtD,SAAO;AACT,GAGM,IAAA,CAAiB,MAA6C;AAClE,QAAM,IAAS,EAA+B,GAAK,QAAQ;AAE3D,MAAI,CAAC,KAAU,OAA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AAe,CAAA,EACjB;AAOA,QAAI,CAAC,MALY,EAAO,iBAAiB,kBAAkB;AAAA,MACzD,GAAG;AAAA,MACH,GAAG,EAAc,CAAG;AAAA,IACtB,CAAgB,EAEP,OAAM,IAAI,MAAM,8BAA8B;AAAA,EACzD;AAAA,EAGA,sBAAsB,OAAO,MAAQ;AACnC,UAAM,EAAE,MAAA,GAAM,QAAA,EAAA,IAAW,GACnB,IAAe,EAAqB,GAAK,cAAc,GACvD,IAAO,EAAc,GAAK,iBAAiB,KAAK,EAAK;AAE3D,QAAI,CAAC,EAAM,OAAM,IAAI,MAAM,8BAA8B;AAEzD,UAAM,IAAc,EAClB,EAAO,iBAAiB,cAAA,CACvB,MAAM,EAAE,SAAS,GAClB,eAAe,CAAA,EACjB;AAIA,QAAI,CAAC,MAFY,EAAO,iBAAiB,2BAA2B,GAAc,CAAW,EAEpF,OAAM,IAAI,MAAM,iCAAiC;AAAA,EAC5D;AAAA,EAGA,gBAAgB,OAAO,MAAQ;AAC7B,UAAM,EAAE,YAAA,GAAY,GAAG,EAAA,IAAS,EAAI,QAC9B,IAAO,OAAO,KAAe,WAAW,IAAa;AAE3D,QAAI,CAAC,EAAM,OAAM,IAAI,MAAM,2CAA2C;AACtE,QAAI,CAAC,EAAI,YAAY,YACnB,OAAM,IAAI,MAAM,oDAAoD,CAAA,IAAQ;AAG9E,UAAM,EAAI,YAAY,YAAY;AAAA,MAAE,UAAU,EAAI,KAAK;AAAA,MAAM,MAAA;AAAA,MAAM,QAAQ;AAAA,IAAK,CAAC;AAAA,EACnF;AACF"}
1
+ {"version":3,"file":"ctaHandlers.es.js","names":[],"sources":["../../../src/insights-v2/ctaActions/ctaHandlers.ts"],"sourcesContent":["import type { Account, Budget, MerchantBudget, Transaction, UserInsightProfile } from '../../core'\nimport { HOST_ACTIONS } from './hostActions'\nimport type { CtaContext, CtaHandler } from './types'\n\n// Step side effects: call stores, throw on failure, read ctx.params.\n// Host-owned effects (beat endpoints, spending plan) use delegateToHost.\n\nconst param = <T>(ctx: CtaContext, key: string): T | undefined => ctx.params[key] as T | undefined\n\nconst requireParam = <T>(ctx: CtaContext, key: string): T => {\n const value = param<T>(ctx, key)\n\n if (value === undefined || value === null || value === '') {\n throw new Error(`CTA handler requires params.${key}`)\n }\n\n return value\n}\n\n// The write set under params.fields; throws if a pick is missing.\nconst requireFields = (ctx: CtaContext): Record<string, unknown> => {\n const fields = param<Record<string, unknown>>(ctx, 'fields')\n\n if (!fields || Object.keys(fields).length === 0) {\n throw new Error('CTA handler requires params.fields')\n }\n\n const missing = Object.keys(fields).filter((field) => fields[field] === undefined)\n\n if (missing.length > 0) {\n throw new Error(`CTA handler could not resolve field(s): ${missing.join(', ')}`)\n }\n\n return fields\n}\n\nconst findOrThrow = <T>(items: T[], predicate: (item: T) => boolean, what: string): T => {\n const found = items.find(predicate)\n\n if (!found) throw new Error(`${what} not found in store`)\n\n return found\n}\n\nexport const ctaHandlers = {\n /** `PUT user_insight_profile` (designate emergency savings, thresholds, safety net). */\n updateUserInsightProfile: async (ctx) => {\n await ctx.stores.userStore.updateUserInsightProfile(\n requireFields(ctx) as Partial<UserInsightProfile>,\n )\n },\n\n /** `PUT offers/:guid` flagging a marketing offer as clicked. */\n markOfferClicked: async ({ beat, stores }) => {\n await stores.beatStore.updateOffer({ ...beat, has_been_clicked: true } as typeof beat)\n },\n\n /**\n * `PUT repeating_transactions/:guid` writing `user_response`. Resolves the repeating\n * transaction from `params.repeatingTransactionGuid`, else the beat's primary transaction.\n */\n updateRepeatingTransactionResponse: async (ctx) => {\n const { beat, stores } = ctx\n const userResponse = requireParam<string>(ctx, 'userResponse')\n const guid =\n param<string>(ctx, 'repeatingTransactionGuid') ??\n beat.primary_transaction?.repeating_transaction_guid\n\n if (!guid) throw new Error('No repeating transaction guid for beat')\n\n const repeating = findOrThrow(\n stores.recurringTransactionsStore.repeatingTransactions,\n (rt) => rt.guid === guid,\n `Repeating transaction ${guid}`,\n )\n const ok = await stores.recurringTransactionsStore.updateRepeatingTransaction({\n ...repeating,\n user_response: userResponse,\n })\n\n if (!ok) throw new Error('Failed to update repeating transaction')\n },\n\n /** `PUT accounts/:guid` merging `params.fields`; `params.accountGuid` picks the account, else the beat's primary. */\n updateAccountField: async (ctx) => {\n const { beat, stores } = ctx\n const guid = param<string>(ctx, 'accountGuid') ?? beat.primary_account_guid\n\n if (!guid) throw new Error('No account guid for beat')\n\n const account = findOrThrow(\n stores.accountStore.accounts,\n (a) => a.guid === guid,\n `Account ${guid}`,\n )\n\n const ok = await stores.accountStore.updateAccount({\n ...account,\n ...requireFields(ctx),\n } as Account)\n\n if (!ok) throw new Error('Failed to update account')\n },\n\n /** `PUT notification_profiles/:guid` setting `threshold` on the named profile. */\n updateNotificationProfileThreshold: async (ctx) => {\n const profileGuid = requireParam<string>(ctx, 'profileGuid')\n const threshold = requireParam<number>(ctx, 'threshold')\n const profile = findOrThrow(\n ctx.stores.settingsStore.notificationProfiles,\n (p) => p.guid === profileGuid,\n `Notification profile ${profileGuid}`,\n )\n\n const ok = await ctx.stores.settingsStore.updateNotificationProfile({ ...profile, threshold })\n\n if (!ok) throw new Error('Failed to update notification profile')\n },\n\n /** `POST budgets` for `params.categoryGuid` with `params.amount` (+ optional parentGuid). */\n createBudget: async (ctx) => {\n const categoryGuid = requireParam<string>(ctx, 'categoryGuid')\n const amount = requireParam<number>(ctx, 'amount')\n const category = findOrThrow(\n ctx.stores.categoryStore.categories,\n (c) => c.guid === categoryGuid,\n `Category ${categoryGuid}`,\n )\n\n const ok = await ctx.stores.budgetsStore.addBudget(\n category,\n amount,\n param<string | null>(ctx, 'parentGuid') ?? null,\n )\n\n if (!ok) throw new Error('Failed to create budget')\n },\n\n /** `PUT budgets/:guid` setting `amount`. */\n updateBudget: async (ctx) => {\n const budgetGuid = requireParam<string>(ctx, 'budgetGuid')\n const amount = requireParam<number>(ctx, 'amount')\n const budget = findOrThrow(\n ctx.stores.budgetsStore.budgets,\n (b) => b.guid === budgetGuid,\n `Budget ${budgetGuid}`,\n )\n const ok = await ctx.stores.budgetsStore.updateBudget({ ...budget, amount } as Budget)\n\n if (!ok) throw new Error('Failed to update budget')\n },\n\n /** `DELETE budgets/:guid`. */\n deleteBudget: async (ctx) => {\n const ok = await ctx.stores.budgetsStore.deleteBudget(requireParam<string>(ctx, 'budgetGuid'))\n\n if (!ok) throw new Error('Failed to delete budget')\n },\n\n /** `POST merchant_budgets`. */\n createMerchantBudget: async (ctx) => {\n const result = await ctx.stores.budgetsStore.addMerchantBudget(\n requireParam<string>(ctx, 'merchantGuid'),\n requireParam<number>(ctx, 'amount'),\n )\n\n if (!result?.isSuccess) throw new Error('Failed to create merchant budget')\n },\n\n /** `PUT merchant_budgets/:guid` setting `amount`. */\n updateMerchantBudget: async (ctx) => {\n const guid = requireParam<string>(ctx, 'merchantBudgetGuid')\n const amount = requireParam<number>(ctx, 'amount')\n const merchantBudget = findOrThrow(\n ctx.stores.budgetsStore.merchantBudgets,\n (mb) => mb.guid === guid,\n `Merchant budget ${guid}`,\n )\n const result = await ctx.stores.budgetsStore.updateMerchantBudget({\n ...merchantBudget,\n amount,\n } as MerchantBudget)\n\n if (!result?.isSuccess) throw new Error('Failed to update merchant budget')\n },\n\n /** `DELETE merchant_budgets/:guid`. */\n deleteMerchantBudget: async (ctx) => {\n const result = await ctx.stores.budgetsStore.deleteMerchantBudget(\n requireParam<string>(ctx, 'merchantBudgetGuid'),\n )\n\n if (!result?.isSuccess) throw new Error('Failed to delete merchant budget')\n },\n\n /**\n * `PUT transactions/:guid` merging `params.fields` (category_guid, date, memo,\n * description, is_hidden...). Resolves the transaction from `params.transactionGuid`,\n * else the beat's primary transaction guid.\n */\n updateTransactionField: async (ctx) => {\n const { beat, stores } = ctx\n const guid = param<string>(ctx, 'transactionGuid') ?? beat.primary_transaction_guid\n\n if (!guid) throw new Error('No transaction guid for beat')\n\n const transaction = findOrThrow(\n stores.transactionStore.transactions,\n (t) => t.guid === guid,\n `Transaction ${guid}`,\n )\n\n const ok = await stores.transactionStore.updateTransaction({\n ...transaction,\n ...requireFields(ctx),\n } as Transaction)\n\n if (!ok) throw new Error('Failed to update transaction')\n },\n\n /** `POST`/`PUT transaction_rules` so `params.categoryGuid` applies to future matches. */\n applyTransactionRule: async (ctx) => {\n const { beat, stores } = ctx\n const categoryGuid = requireParam<string>(ctx, 'categoryGuid')\n const guid = param<string>(ctx, 'transactionGuid') ?? beat.primary_transaction_guid\n\n if (!guid) throw new Error('No transaction guid for beat')\n\n const transaction = findOrThrow(\n stores.transactionStore.transactions,\n (t) => t.guid === guid,\n `Transaction ${guid}`,\n )\n\n const ok = await stores.transactionStore.addOrUpdateTransactionRule(categoryGuid, transaction)\n\n if (!ok) throw new Error('Failed to save transaction rule')\n },\n\n /** Merges `params.fields` into beat context; `params.markCtaClicked` records `cta_clicked_at`. */\n updateBeatContext: async (ctx) => {\n const { beat, hostActions, stores } = ctx\n stores.insightsV2Store.setBeatContext(beat.guid, requireFields(ctx))\n\n if (!param<boolean>(ctx, 'markCtaClicked') || beat.cta_clicked_at) return\n\n // Fire-and-forget, like the runner's markCtaClicked: a failed write must not fail the press.\n Promise.resolve()\n .then(() =>\n hostActions.onCtaAction?.({ beatGuid: beat.guid, name: HOST_ACTIONS.markCtaClicked }),\n )\n .catch((error) =>\n stores.captureException(error, {\n store: 'ctaActions',\n template: beat.template,\n handler: 'updateBeatContext',\n }),\n )\n },\n\n // Hands a host-owned effect to the app via beatActions.onCtaAction.\n delegateToHost: async (ctx) => {\n const { hostAction, ...rest } = ctx.params\n const name = typeof hostAction === 'string' ? hostAction : ''\n\n if (!name) throw new Error('delegateToHost requires params.hostAction')\n if (!ctx.hostActions.onCtaAction) {\n throw new Error(`Host does not implement onCtaAction (needed for \"${name}\")`)\n }\n\n await ctx.hostActions.onCtaAction({ beatGuid: ctx.beat.guid, name, params: rest })\n },\n} satisfies Record<string, CtaHandler>\n\n/** A registered handler name. */\nexport type CtaHandlerName = keyof typeof ctaHandlers\n"],"mappings":";AAOA,IAAM,I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MACN,EAAO,iBAAiB,GAAO;AAAA,MAC7B,OAAO;AAAA,MACP,UAAU,EAAK;AAAA,MACf,SAAS;AAAA,IACX,CAAC,CACH;AAAA,EACJ;AAAA,EAGA,gBAAgB,OAAO,MAAQ;AAC7B,UAAM,EAAE,YAAA,GAAY,GAAG,EAAA,IAAS,EAAI,QAC9B,IAAO,OAAO,KAAe,WAAW,IAAa;AAE3D,QAAI,CAAC,EAAM,OAAM,IAAI,MAAM,2CAA2C;AACtE,QAAI,CAAC,EAAI,YAAY,YACnB,OAAM,IAAI,MAAM,oDAAoD,CAAA,IAAQ;AAG9E,UAAM,EAAI,YAAY,YAAY;AAAA,MAAE,UAAU,EAAI,KAAK;AAAA,MAAM,MAAA;AAAA,MAAM,QAAQ;AAAA,IAAK,CAAC;AAAA,EACnF;AACF"}
@@ -3,7 +3,7 @@
3
3
  * (`HOST_CTA_ACTIONS` in `src/hooks/useBeatActions.js`): add names on both sides together.
4
4
  */
5
5
  export declare const HOST_ACTIONS: {
6
- /** First primary click (`cta_clicked_at`); fired by the runner, not by steps. */
6
+ /** `cta_clicked_at`: fired by the runner on the first primary click, or by `updateBeatContext` when asked. */
7
7
  readonly markCtaClicked: "markCtaClicked";
8
8
  readonly dismissBeat: "dismissBeat";
9
9
  readonly updateBeat: "updateBeat";
@@ -1 +1 @@
1
- {"version":3,"file":"hostActions.es.js","names":[],"sources":["../../../src/insights-v2/ctaActions/hostActions.ts"],"sourcesContent":["/**\n * Host-owned effects requested via `beatActions.onCtaAction`. Contract with pulse\n * (`HOST_CTA_ACTIONS` in `src/hooks/useBeatActions.js`): add names on both sides together.\n */\nexport const HOST_ACTIONS = {\n /** First primary click (`cta_clicked_at`); fired by the runner, not by steps. */\n markCtaClicked: 'markCtaClicked',\n dismissBeat: 'dismissBeat',\n updateBeat: 'updateBeat',\n readBeatSummary: 'readBeatSummary',\n sendBeatFeedback: 'sendBeatFeedback',\n disableBeatTemplate: 'disableBeatTemplate',\n spendingPlanItemCreate: 'spendingPlanItem.create',\n spendingPlanItemEdit: 'spendingPlanItem.edit',\n spendingPlanItemDelete: 'spendingPlanItem.delete',\n /** Set Up Direct Deposit: the host fetches the Atomic SDK token and runs the flow. */\n atomicTransact: 'atomicTransact',\n /** A mini link's tap, handled by the host as a card tap. */\n cardClick: 'cardClick',\n} as const\n\nexport type HostActionName = (typeof HOST_ACTIONS)[keyof typeof HOST_ACTIONS]\n"],"mappings":"AAIA,IAAa,IAAe;AAAA,EAE1B,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,wBAAwB;AAAA,EACxB,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EAExB,gBAAgB;AAAA,EAEhB,WAAW;AACb"}
1
+ {"version":3,"file":"hostActions.es.js","names":[],"sources":["../../../src/insights-v2/ctaActions/hostActions.ts"],"sourcesContent":["/**\n * Host-owned effects requested via `beatActions.onCtaAction`. Contract with pulse\n * (`HOST_CTA_ACTIONS` in `src/hooks/useBeatActions.js`): add names on both sides together.\n */\nexport const HOST_ACTIONS = {\n /** `cta_clicked_at`: fired by the runner on the first primary click, or by `updateBeatContext` when asked. */\n markCtaClicked: 'markCtaClicked',\n dismissBeat: 'dismissBeat',\n updateBeat: 'updateBeat',\n readBeatSummary: 'readBeatSummary',\n sendBeatFeedback: 'sendBeatFeedback',\n disableBeatTemplate: 'disableBeatTemplate',\n spendingPlanItemCreate: 'spendingPlanItem.create',\n spendingPlanItemEdit: 'spendingPlanItem.edit',\n spendingPlanItemDelete: 'spendingPlanItem.delete',\n /** Set Up Direct Deposit: the host fetches the Atomic SDK token and runs the flow. */\n atomicTransact: 'atomicTransact',\n /** A mini link's tap, handled by the host as a card tap. */\n cardClick: 'cardClick',\n} as const\n\nexport type HostActionName = (typeof HOST_ACTIONS)[keyof typeof HOST_ACTIONS]\n"],"mappings":"AAIA,IAAa,IAAe;AAAA,EAE1B,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,wBAAwB;AAAA,EACxB,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EAExB,gBAAgB;AAAA,EAEhB,WAAW;AACb"}
@@ -16,9 +16,9 @@ import V from "./components/DirectDepositCard.es.js";
16
16
  import { detailedAccountVariant as G, directDepositVariant as _, isDetailedAccountVariant as F } from "./blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js";
17
17
  import N from "./blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js";
18
18
  import W from "./blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js";
19
- import q from "./components/TransferLogoCard.es.js";
20
- import J from "./blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js";
21
- import { BudgetBlock as Q } from "./blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js";
19
+ import Q from "./components/TransferLogoCard.es.js";
20
+ import q from "./blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js";
21
+ import { BudgetBlock as K } from "./blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js";
22
22
  import Y from "./components/DebtPayoffCard.es.js";
23
23
  import $ from "./components/InsightTransactionRow.es.js";
24
24
  import ro from "./components/TransactionListCard.es.js";
@@ -33,111 +33,113 @@ import ko from "./components/MerchantHighlightCard.es.js";
33
33
  import Do from "./components/P2PLogoStack.es.js";
34
34
  import Ao from "./blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js";
35
35
  import Io from "./blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendDaysBlock.es.js";
36
- import To from "./components/UpcomingBillCard.es.js";
37
- import yo from "./blocks/ComponentBlocks/RepeatingTransactionBlock/RepeatingTransactionBlock.es.js";
38
- import Ro from "./components/SaveAnExtraCard.es.js";
39
- import Ho from "./blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
40
- import Oo from "./components/SavingsOpportunityCard.es.js";
41
- import Eo from "./blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.es.js";
42
- import _o from "./blocks/ComponentBlocks/SavingsSummaryBlock/SavingsSummaryBlock.es.js";
43
- import xo from "./components/StatusMessageCard.es.js";
44
- import { transactionBlockVariant as Uo } from "./blocks/ComponentBlocks/TransactionBlock/layout.es.js";
36
+ import To from "./blocks/ComponentBlocks/QuizBlock/QuizBlock.es.js";
37
+ import yo from "./components/UpcomingBillCard.es.js";
38
+ import Ro from "./blocks/ComponentBlocks/RepeatingTransactionBlock/RepeatingTransactionBlock.es.js";
39
+ import Ho from "./components/SaveAnExtraCard.es.js";
40
+ import Oo from "./blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
41
+ import Eo from "./components/SavingsOpportunityCard.es.js";
42
+ import _o from "./blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.es.js";
43
+ import xo from "./blocks/ComponentBlocks/SavingsSummaryBlock/SavingsSummaryBlock.es.js";
44
+ import Uo from "./components/StatusMessageCard.es.js";
45
+ import { transactionBlockVariant as zo } from "./blocks/ComponentBlocks/TransactionBlock/layout.es.js";
45
46
  import { TransactionBlock as jo } from "./blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js";
46
- import zo from "./components/SubscriptionHeroCard.es.js";
47
- import Ko from "./blocks/ComponentBlocks/UpcomingSubscriptionBlock/UpcomingSubscriptionBlock.es.js";
48
- import Xo from "./blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.es.js";
49
- import Zo from "./components/WithdrawalCard.es.js";
50
- import or from "./blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js";
51
- import tr from "./components/DesignateEmergencySavingsCard.es.js";
52
- import { SVGImageBlock as ir } from "./blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
53
- import pr from "./components/shared/StatusSnackbar.es.js";
54
- import fr from "./components/FeedbackDialog.es.js";
55
- import cr from "./components/FeedbackModal.es.js";
56
- import sr from "./components/ConnectionDetailDrillDown.es.js";
57
- import Br from "./components/SurveyModal.es.js";
58
- import Cr from "./components/InsightErrorCard.es.js";
59
- import { ErrorCard as kr } from "./components/ErrorCard.es.js";
60
- import Dr from "./components/AmountBreakdownCard.es.js";
61
- import Ar from "./components/BadgedTile.es.js";
62
- import { OverflowMenu as Ir } from "./components/OverflowMenu.es.js";
63
- import { InsightOptionsMenu as Tr } from "./components/InsightOptionsMenu.es.js";
64
- import yr from "./components/StatusBadge.es.js";
65
- import Rr from "./components/CompactInsightCard.es.js";
66
- import { FeedbackBar as Hr } from "./components/FeedbackBar.es.js";
67
- import { DismissInsightDialog as Or } from "./components/DismissInsightDialog.es.js";
68
- import { HiddenConfirmationCard as Er } from "./components/HiddenConfirmationCard.es.js";
69
- import { LoadingCard as _r } from "./components/LoadingCard.es.js";
70
- import { ObsolesceBanner as xr } from "./components/ObsolesceBanner.es.js";
71
- import Ur from "./components/BaseLayout.es.js";
47
+ import Jo from "./components/SubscriptionHeroCard.es.js";
48
+ import Xo from "./blocks/ComponentBlocks/UpcomingSubscriptionBlock/UpcomingSubscriptionBlock.es.js";
49
+ import Zo from "./blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.es.js";
50
+ import or from "./components/WithdrawalCard.es.js";
51
+ import tr from "./blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js";
52
+ import ir from "./components/DesignateEmergencySavingsCard.es.js";
53
+ import { SVGImageBlock as pr } from "./blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
54
+ import fr from "./components/shared/StatusSnackbar.es.js";
55
+ import cr from "./components/FeedbackDialog.es.js";
56
+ import sr from "./components/FeedbackModal.es.js";
57
+ import Br from "./components/ConnectionDetailDrillDown.es.js";
58
+ import Cr from "./components/SurveyModal.es.js";
59
+ import kr from "./components/InsightErrorCard.es.js";
60
+ import { ErrorCard as Dr } from "./components/ErrorCard.es.js";
61
+ import Ar from "./components/AmountBreakdownCard.es.js";
62
+ import Ir from "./components/BadgedTile.es.js";
63
+ import { OverflowMenu as Tr } from "./components/OverflowMenu.es.js";
64
+ import { InsightOptionsMenu as yr } from "./components/InsightOptionsMenu.es.js";
65
+ import Rr from "./components/StatusBadge.es.js";
66
+ import Hr from "./components/CompactInsightCard.es.js";
67
+ import { FeedbackBar as Or } from "./components/FeedbackBar.es.js";
68
+ import { DismissInsightDialog as Er } from "./components/DismissInsightDialog.es.js";
69
+ import { HiddenConfirmationCard as _r } from "./components/HiddenConfirmationCard.es.js";
70
+ import { LoadingCard as xr } from "./components/LoadingCard.es.js";
71
+ import { ObsolesceBanner as Ur } from "./components/ObsolesceBanner.es.js";
72
+ import zr from "./components/BaseLayout.es.js";
72
73
  export {
73
74
  W as AccountBlock,
74
75
  M as AccountHeroCard,
75
- J as AccountSwitchBlock,
76
- Dr as AmountBreakdownCard,
76
+ q as AccountSwitchBlock,
77
+ Ar as AmountBreakdownCard,
77
78
  Co as AmountPill,
78
79
  e as BAR_ARIA_LABEL,
79
80
  f as BAR_CHART_VARIANTS,
80
- Ar as BadgedTile,
81
+ Ir as BadgedTile,
81
82
  D as BarchartBlock,
82
- Ur as BaseLayout,
83
- Q as BudgetBlock,
84
- Rr as CompactInsightCard,
85
- sr as ConnectionDetailDrillDown,
83
+ zr as BaseLayout,
84
+ K as BudgetBlock,
85
+ Hr as CompactInsightCard,
86
+ Br as ConnectionDetailDrillDown,
86
87
  Y as DebtPayoffCard,
87
88
  mo as DebtsBlock,
88
- tr as DesignateEmergencySavingsCard,
89
+ ir as DesignateEmergencySavingsCard,
89
90
  N as DetailedAccountBlock,
90
91
  N as DirectDepositBlock,
91
92
  V as DirectDepositCard,
92
- Or as DismissInsightDialog,
93
+ Er as DismissInsightDialog,
93
94
  T as DonutChartBlock,
94
95
  A as DoubleBarChartBlock,
95
96
  y as DoubleProgressBarBlock,
96
- kr as ErrorCard,
97
- Hr as FeedbackBar,
98
- fr as FeedbackDialog,
99
- cr as FeedbackModal,
97
+ Dr as ErrorCard,
98
+ Or as FeedbackBar,
99
+ cr as FeedbackDialog,
100
+ sr as FeedbackModal,
100
101
  ao as GasPurchaseBlock,
101
102
  eo as GoalProgressCard,
102
103
  no as GoalsBlock,
103
104
  d as HOST_ACTIONS,
104
- Er as HiddenConfirmationCard,
105
- Cr as InsightErrorCard,
106
- Tr as InsightOptionsMenu,
105
+ _r as HiddenConfirmationCard,
106
+ kr as InsightErrorCard,
107
+ yr as InsightOptionsMenu,
107
108
  $ as InsightTransactionRow,
108
- _r as LoadingCard,
109
+ xr as LoadingCard,
109
110
  Bo as LogoClusterCard,
110
111
  R as LogoFromGuid,
111
112
  lo as LogoTile,
112
113
  Ao as MerchantBlock,
113
114
  ko as MerchantHighlightCard,
114
115
  Io as NoSpendDaysBlock,
115
- xr as ObsolesceBanner,
116
- Ir as OverflowMenu,
116
+ Ur as ObsolesceBanner,
117
+ Tr as OverflowMenu,
117
118
  Do as P2PLogoStack,
118
- yo as RepeatingTransactionBlock,
119
- ir as SVGImageBlock,
120
- Ro as SaveAnExtraCard,
121
- Ho as SaveExtraBlock,
122
- Eo as SavingsOpportunityBlock,
123
- Oo as SavingsOpportunityCard,
124
- _o as SavingsSummaryBlock,
125
- yr as StatusBadge,
126
- xo as StatusMessageCard,
119
+ To as QuizBlock,
120
+ Ro as RepeatingTransactionBlock,
121
+ pr as SVGImageBlock,
122
+ Ho as SaveAnExtraCard,
123
+ Oo as SaveExtraBlock,
124
+ _o as SavingsOpportunityBlock,
125
+ Eo as SavingsOpportunityCard,
126
+ xo as SavingsSummaryBlock,
127
+ Rr as StatusBadge,
128
+ Uo as StatusMessageCard,
127
129
  r as StatusPill,
128
- pr as StatusSnackbar,
130
+ fr as StatusSnackbar,
129
131
  I as StepChartBlock,
130
- zo as SubscriptionHeroCard,
131
- Br as SurveyModal,
132
+ Jo as SubscriptionHeroCard,
133
+ Cr as SurveyModal,
132
134
  jo as TransactionBlock,
133
135
  ro as TransactionListCard,
134
- q as TransferLogoCard,
135
- yo as UpcomingBillBlock,
136
- To as UpcomingBillCard,
137
- Ko as UpcomingSubscriptionBlock,
138
- Xo as WeeklySmallPurchasesBlock,
139
- or as WithdrawalBlock,
140
- Zo as WithdrawalCard,
136
+ Q as TransferLogoCard,
137
+ Ro as UpcomingBillBlock,
138
+ yo as UpcomingBillCard,
139
+ Xo as UpcomingSubscriptionBlock,
140
+ Zo as WeeklySmallPurchasesBlock,
141
+ tr as WithdrawalBlock,
142
+ or as WithdrawalCard,
141
143
  n as barChartVariant,
142
144
  c as buildChartData,
143
145
  l as buildDataSeries,
@@ -147,7 +149,7 @@ export {
147
149
  w as isLogoGuid,
148
150
  m as resolveInsightRender,
149
151
  u as runInDescriptionCta,
150
- Uo as transactionBlockVariant,
152
+ zo as transactionBlockVariant,
151
153
  a as useBeatActions,
152
154
  g as useBeatCtaActions,
153
155
  k as useCtaHandler
@@ -22,4 +22,5 @@ export declare const actionBlocksKey: {
22
22
  ACCOUNT_DETAILS_ACTION_BLOCK: string;
23
23
  ACCOUNT_LIST_ACTION_BLOCK: string;
24
24
  HELP_ACTION_BLOCK: string;
25
+ QUIZ_MERCHANT_ACTION_BLOCK: string;
25
26
  };
@@ -21,7 +21,8 @@ var _ = {
21
21
  BUDGET_DETAILS_ACTION_BLOCK: "budget_details_block",
22
22
  ACCOUNT_DETAILS_ACTION_BLOCK: "account_details_block",
23
23
  ACCOUNT_LIST_ACTION_BLOCK: "account_list_block",
24
- HELP_ACTION_BLOCK: "help_block"
24
+ HELP_ACTION_BLOCK: "help_block",
25
+ QUIZ_MERCHANT_ACTION_BLOCK: "quiz_merchant_block"
25
26
  };
26
27
  export {
27
28
  _ 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 SUBSCRIPTION_STATUS_MODAL_ACTION_BLOCK: 'subscription_status_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 SAFETY_NET_ACTION_BLOCK: 'safety_net_block',\n OVERDRAFT_ACTION_BLOCK: 'transparent_overdraft_block',\n CREDIT_UTILIZATION_ACTION_BLOCK: 'credit_utilization_block',\n EMERGENCY_SAVINGS_ACTION_BLOCK: 'emergency_savings_block',\n PAYOFF_CALCULATOR_ACTION_BLOCK: 'payoff_calculator_block',\n BUDGET_DETAILS_ACTION_BLOCK: 'budget_details_block',\n ACCOUNT_DETAILS_ACTION_BLOCK: 'account_details_block',\n ACCOUNT_LIST_ACTION_BLOCK: 'account_list_block',\n HELP_ACTION_BLOCK: 'help_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,wCAAwC;AAAA,EACxC,oCAAoC;AAAA,EACpC,+BAA+B;AAAA,EAC/B,6BAA6B;AAAA,EAC7B,iCAAiC;AAAA,EACjC,yBAAyB;AAAA,EACzB,wBAAwB;AAAA,EACxB,iCAAiC;AAAA,EACjC,gCAAgC;AAAA,EAChC,gCAAgC;AAAA,EAChC,6BAA6B;AAAA,EAC7B,8BAA8B;AAAA,EAC9B,2BAA2B;AAAA,EAC3B,mBAAmB;AACrB"}
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 SUBSCRIPTION_STATUS_MODAL_ACTION_BLOCK: 'subscription_status_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 SAFETY_NET_ACTION_BLOCK: 'safety_net_block',\n OVERDRAFT_ACTION_BLOCK: 'transparent_overdraft_block',\n CREDIT_UTILIZATION_ACTION_BLOCK: 'credit_utilization_block',\n EMERGENCY_SAVINGS_ACTION_BLOCK: 'emergency_savings_block',\n PAYOFF_CALCULATOR_ACTION_BLOCK: 'payoff_calculator_block',\n BUDGET_DETAILS_ACTION_BLOCK: 'budget_details_block',\n ACCOUNT_DETAILS_ACTION_BLOCK: 'account_details_block',\n ACCOUNT_LIST_ACTION_BLOCK: 'account_list_block',\n HELP_ACTION_BLOCK: 'help_block',\n QUIZ_MERCHANT_ACTION_BLOCK: 'quiz_merchant_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,wCAAwC;AAAA,EACxC,oCAAoC;AAAA,EACpC,+BAA+B;AAAA,EAC/B,6BAA6B;AAAA,EAC7B,iCAAiC;AAAA,EACjC,yBAAyB;AAAA,EACzB,wBAAwB;AAAA,EACxB,iCAAiC;AAAA,EACjC,gCAAgC;AAAA,EAChC,gCAAgC;AAAA,EAChC,6BAA6B;AAAA,EAC7B,8BAA8B;AAAA,EAC9B,2BAA2B;AAAA,EAC3B,mBAAmB;AAAA,EACnB,4BAA4B;AAC9B"}