@mx-cartographer/experiences 9.7.70 → 9.7.71-alpha-ram-usp-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/core/stores/GlobalCopyStore.d.ts +6 -0
- package/dist/core/stores/GlobalCopyStore.es.js +14 -8
- package/dist/core/stores/GlobalCopyStore.es.js.map +1 -1
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +24 -0
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.d.ts +6 -0
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js +168 -0
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +11 -11
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js +3 -3
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +92 -59
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.d.ts +9 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js +9 -5
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js +5 -5
- package/dist/insights-v2/components/AccountHeroCard.es.js +7 -5
- package/dist/insights-v2/components/AccountHeroCard.es.js.map +1 -1
- package/dist/insights-v2/components/BaseLayout.es.js +157 -138
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/CtaStatus.d.ts +14 -1
- package/dist/insights-v2/components/CtaStatus.es.js +76 -38
- package/dist/insights-v2/components/CtaStatus.es.js.map +1 -1
- package/dist/insights-v2/components/InsightTransactionRow.d.ts +3 -1
- package/dist/insights-v2/components/InsightTransactionRow.es.js +36 -20
- package/dist/insights-v2/components/InsightTransactionRow.es.js.map +1 -1
- package/dist/insights-v2/components/StatusPill.es.js +12 -11
- package/dist/insights-v2/components/StatusPill.es.js.map +1 -1
- package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.d.ts +4 -0
- package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.es.js +10 -0
- package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.es.js.map +1 -0
- package/dist/insights-v2/components/TransactionListCard.d.ts +5 -1
- package/dist/insights-v2/components/TransactionListCard.es.js +69 -49
- package/dist/insights-v2/components/TransactionListCard.es.js.map +1 -1
- package/dist/insights-v2/components/shared/StatusSnackbar.d.ts +10 -1
- package/dist/insights-v2/components/shared/StatusSnackbar.es.js +27 -11
- package/dist/insights-v2/components/shared/StatusSnackbar.es.js.map +1 -1
- package/dist/insights-v2/components/shared/elevation.d.ts +16 -0
- package/dist/insights-v2/components/shared/elevation.es.js +15 -0
- package/dist/insights-v2/components/shared/elevation.es.js.map +1 -0
- package/dist/insights-v2/ctaActions/ctaConfig.es.js +23 -9
- package/dist/insights-v2/ctaActions/ctaConfig.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/runCtaAction.d.ts +7 -0
- package/dist/insights-v2/ctaActions/runCtaAction.es.js +73 -62
- package/dist/insights-v2/ctaActions/runCtaAction.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/subscriptionAnswer.d.ts +10 -1
- package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js +115 -0
- package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js.map +1 -0
- package/dist/insights-v2/ctaActions/types.d.ts +5 -2
- package/dist/insights-v2/ctaActions/useCtaAction.d.ts +6 -0
- package/dist/insights-v2/ctaActions/useCtaAction.es.js +32 -27
- package/dist/insights-v2/ctaActions/useCtaAction.es.js.map +1 -1
- package/dist/insights-v2/mappings/actionBlocksKey.d.ts +1 -0
- package/dist/insights-v2/mappings/actionBlocksKey.es.js +1 -0
- package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
- package/dist/insights-v2/mappings/blocks.es.js +74 -68
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/dist/microinsights/MicroCardTemplate.es.js +21 -17
- package/dist/microinsights/MicroCardTemplate.es.js.map +1 -1
- package/dist/microinsights/cards/InsightCard.es.js +91 -86
- package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
- package/dist/microinsights/cards/MicroCtaStatus.d.ts +18 -0
- package/dist/microinsights/cards/MicroCtaStatus.es.js +44 -0
- package/dist/microinsights/cards/MicroCtaStatus.es.js.map +1 -0
- package/dist/microinsights/stores/CopyStore.d.ts +4 -1
- package/dist/microinsights/stores/CopyStore.es.js +13 -10
- package/dist/microinsights/stores/CopyStore.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [9.7.72] - 11-02-2026
|
|
2
|
+
|
|
3
|
+
- **ADDED** - Unexpected Subscription Payment on the shared subscription status CTA (WEC-2126): `confirm_subscription_status` registers `subscriptionEntryStep({ statusLabels: { positive: 'subscribed', negative: 'not_subscribed' } })`, so the card follows the live repeating transaction as pulse did (none / `USER_RESPONSE_UNKNOWN` → Confirm Status, `CONFIRMED` → "Subscribed | Undo", any other answer → "Not subscribed | Undo"). New `subscription_status_modal_block`, a centred modal every widget's "Confirm Status" opens: the row from the opening CTA's `drilldown_data` with the live frequency, "I'm Subscribed" / "I'm Not Subscribed", then the three reasons; it saves through `answerSubscription`, reports the "No" press, and shows a success snackbar or an error one with Try Again. Words from the new optional `insights_feed.subscription_status_modal` copy (`SubscriptionStatusModalCopy`); a missing word renders nothing
|
|
4
|
+
- **ADDED** - `transaction_block` / `warning_wash` follows the beat's live repeating transaction (`followsSubscription`): the frequency word under the amount (`InsightTransactionRow` `amountCaption`), a status badge over the row (`TransactionListCard` `badge`: `data.icon` flag, `data.reviewed_icon` tick once subscribed) and the answered wash. It only reads the store
|
|
5
|
+
- **ADDED** - The micro card resolves its `in_description_cta` through the CTA layer (`MicroCtaStatusGate`): answered, it shows the opening block's `answeredTitle` (USP: "Unexpected Charge Reviewed"), `data.reviewed_icon` and the presenter's "Undo", and a tap goes to the host instead of re-opening the block; with missing data it shows no action
|
|
6
|
+
- **CHANGED** - Subscription Status dialogs: fixed `xs` width, white paper, 4px radius, full-bleed wash; reasons as 44px rows with inset dividers. `CtaStatus` neutral tone is the white alert (paper fill, 50% black border). The `warning_wash` badge is a 32px palette disc with a `contrastText` glyph; `TransactionListCard` gains `elevated`
|
|
7
|
+
- **CHANGED** - `useBeatCtaActions` prepares the CTA the card has: the primary one, else the in-description one, so a step's data also loads on mini (which has no primary CTA)
|
|
8
|
+
|
|
9
|
+
## [9.7.71] - 10-30-2026
|
|
10
|
+
|
|
11
|
+
- **FIXED** - The Direct Deposit account name wraps instead of truncating, status pill labels are regular weight, and the mini card call-to-action is a text link, matching Figma (WEC-2182, WEC-2183)
|
|
12
|
+
|
|
1
13
|
## [9.7.70] - 10-30-2026
|
|
2
14
|
|
|
3
15
|
- **CHANGED** - goals mini widget naming to match its design (MEW-4114)
|
|
@@ -10,5 +10,11 @@ export declare class GlobalCopyStore {
|
|
|
10
10
|
constructor(globalStore: GlobalStore);
|
|
11
11
|
loadCopy: () => Promise<void>;
|
|
12
12
|
getCopy: (namespace: string, translationKey?: string) => Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Merges an already-loaded section into `copy` (no request), for a host that did not load the
|
|
15
|
+
* copy, e.g. the micro widget handing over the insights_feed it loaded with its own copy. A
|
|
16
|
+
* section the store already has is kept.
|
|
17
|
+
*/
|
|
18
|
+
setSection: <K extends keyof GlobalCopy>(key: K, section: GlobalCopy[K] | undefined) => void;
|
|
13
19
|
private captureError;
|
|
14
20
|
}
|
|
@@ -1,36 +1,42 @@
|
|
|
1
|
-
import { GlobalCopyApi as
|
|
2
|
-
import { makeAutoObservable as a, runInAction as
|
|
3
|
-
var
|
|
1
|
+
import { GlobalCopyApi as i } from "../api/GlobalCopyApi.es.js";
|
|
2
|
+
import { makeAutoObservable as a, runInAction as r } from "mobx";
|
|
3
|
+
var c = class {
|
|
4
4
|
globalStore;
|
|
5
|
-
api = new
|
|
5
|
+
api = new i("/", "");
|
|
6
6
|
copy = {};
|
|
7
7
|
featureNamespace = "experiences";
|
|
8
8
|
isInitialized = !1;
|
|
9
9
|
constructor(t) {
|
|
10
|
-
this.globalStore = t, this.api = new
|
|
10
|
+
this.globalStore = t, this.api = new i(t.endpoint, t.sessionToken, t.onError), a(this);
|
|
11
11
|
}
|
|
12
12
|
loadCopy = async () => {
|
|
13
|
-
await this.getCopy(this.featureNamespace),
|
|
13
|
+
await this.getCopy(this.featureNamespace), r(() => {
|
|
14
14
|
this.isInitialized = !0;
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
getCopy = async (t, o = "") => {
|
|
18
18
|
try {
|
|
19
19
|
const e = await this.api.getGlobalCopy(t, o);
|
|
20
|
-
|
|
20
|
+
r(() => {
|
|
21
21
|
this.copy = e[t];
|
|
22
22
|
});
|
|
23
23
|
} catch (e) {
|
|
24
24
|
this.captureError("getCopy", e);
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
+
setSection = (t, o) => {
|
|
28
|
+
!o || this.copy?.[t] || (this.copy = {
|
|
29
|
+
...this.copy,
|
|
30
|
+
[t]: o
|
|
31
|
+
});
|
|
32
|
+
};
|
|
27
33
|
captureError = (t, o) => this.globalStore.captureException(o, {
|
|
28
34
|
store: "GlobalCopyStore",
|
|
29
35
|
action: t
|
|
30
36
|
});
|
|
31
37
|
};
|
|
32
38
|
export {
|
|
33
|
-
|
|
39
|
+
c as GlobalCopyStore
|
|
34
40
|
};
|
|
35
41
|
|
|
36
42
|
//# sourceMappingURL=GlobalCopyStore.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalCopyStore.es.js","names":[],"sources":["../../../src/core/stores/GlobalCopyStore.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from 'mobx'\n\nimport { GlobalCopyApi } from '../api'\nimport { GlobalCopy } from '../types'\n\nimport { GlobalStore } from './GlobalStore'\n\nexport class GlobalCopyStore {\n globalStore: GlobalStore\n api: GlobalCopyApi = new GlobalCopyApi('/', '')\n\n copy: GlobalCopy = {} as GlobalCopy\n featureNamespace = 'experiences'\n\n isInitialized = false\n\n constructor(globalStore: GlobalStore) {\n this.globalStore = globalStore\n this.api = new GlobalCopyApi(\n globalStore.endpoint,\n globalStore.sessionToken,\n globalStore.onError,\n )\n\n makeAutoObservable(this)\n }\n\n loadCopy = async () => {\n await this.getCopy(this.featureNamespace)\n\n runInAction(() => {\n this.isInitialized = true\n })\n }\n\n getCopy = async (namespace: string, translationKey: string = '') => {\n try {\n const newCopy = await this.api.getGlobalCopy(namespace, translationKey)\n\n runInAction(() => {\n this.copy = newCopy[namespace]\n })\n } catch (error) {\n this.captureError('getCopy', error)\n }\n }\n\n private captureError = (action: string, error: unknown) =>\n this.globalStore.captureException(error, { store: 'GlobalCopyStore', action })\n}\n"],"mappings":";;AAOA,IAAa,IAAb,MAA6B;AAAA,EAC3B;AAAA,EACA,MAAqB,IAAI,EAAc,KAAK,EAAE;AAAA,EAE9C,OAAmB,CAAC;AAAA,EACpB,mBAAmB;AAAA,EAEnB,gBAAgB;AAAA,EAEhB,YAAY,GAA0B;AACpC,SAAK,cAAc,GACnB,KAAK,MAAM,IAAI,EACb,EAAY,UACZ,EAAY,cACZ,EAAY,OACd,GAEA,EAAmB,IAAI;AAAA,EACzB;AAAA,EAEA,WAAW,YAAY;AACrB,UAAM,KAAK,QAAQ,KAAK,gBAAgB,GAExC,EAAA,MAAkB;AAChB,WAAK,gBAAgB;AAAA,IACvB,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,OAAO,GAAmB,IAAyB,OAAO;AAClE,QAAI;AACF,YAAM,IAAU,MAAM,KAAK,IAAI,cAAc,GAAW,CAAc;AAEtE,MAAA,EAAA,MAAkB;AAChB,aAAK,OAAO,EAAQ,CAAA;AAAA,MACtB,CAAC;AAAA,IACH,SAAS,GAAO;AACd,WAAK,aAAa,WAAW,CAAK;AAAA,IACpC;AAAA,EACF;AAAA,EAEA,eAAA,CAAwB,GAAgB,MACtC,KAAK,YAAY,iBAAiB,GAAO;AAAA,IAAE,OAAO;AAAA,IAAmB,QAAA;AAAA,EAAO,CAAC;AACjF"}
|
|
1
|
+
{"version":3,"file":"GlobalCopyStore.es.js","names":[],"sources":["../../../src/core/stores/GlobalCopyStore.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from 'mobx'\n\nimport { GlobalCopyApi } from '../api'\nimport { GlobalCopy } from '../types'\n\nimport { GlobalStore } from './GlobalStore'\n\nexport class GlobalCopyStore {\n globalStore: GlobalStore\n api: GlobalCopyApi = new GlobalCopyApi('/', '')\n\n copy: GlobalCopy = {} as GlobalCopy\n featureNamespace = 'experiences'\n\n isInitialized = false\n\n constructor(globalStore: GlobalStore) {\n this.globalStore = globalStore\n this.api = new GlobalCopyApi(\n globalStore.endpoint,\n globalStore.sessionToken,\n globalStore.onError,\n )\n\n makeAutoObservable(this)\n }\n\n loadCopy = async () => {\n await this.getCopy(this.featureNamespace)\n\n runInAction(() => {\n this.isInitialized = true\n })\n }\n\n getCopy = async (namespace: string, translationKey: string = '') => {\n try {\n const newCopy = await this.api.getGlobalCopy(namespace, translationKey)\n\n runInAction(() => {\n this.copy = newCopy[namespace]\n })\n } catch (error) {\n this.captureError('getCopy', error)\n }\n }\n\n /**\n * Merges an already-loaded section into `copy` (no request), for a host that did not load the\n * copy, e.g. the micro widget handing over the insights_feed it loaded with its own copy. A\n * section the store already has is kept.\n */\n setSection = <K extends keyof GlobalCopy>(key: K, section: GlobalCopy[K] | undefined) => {\n if (!section || this.copy?.[key]) return\n\n this.copy = { ...this.copy, [key]: section }\n }\n\n private captureError = (action: string, error: unknown) =>\n this.globalStore.captureException(error, { store: 'GlobalCopyStore', action })\n}\n"],"mappings":";;AAOA,IAAa,IAAb,MAA6B;AAAA,EAC3B;AAAA,EACA,MAAqB,IAAI,EAAc,KAAK,EAAE;AAAA,EAE9C,OAAmB,CAAC;AAAA,EACpB,mBAAmB;AAAA,EAEnB,gBAAgB;AAAA,EAEhB,YAAY,GAA0B;AACpC,SAAK,cAAc,GACnB,KAAK,MAAM,IAAI,EACb,EAAY,UACZ,EAAY,cACZ,EAAY,OACd,GAEA,EAAmB,IAAI;AAAA,EACzB;AAAA,EAEA,WAAW,YAAY;AACrB,UAAM,KAAK,QAAQ,KAAK,gBAAgB,GAExC,EAAA,MAAkB;AAChB,WAAK,gBAAgB;AAAA,IACvB,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,OAAO,GAAmB,IAAyB,OAAO;AAClE,QAAI;AACF,YAAM,IAAU,MAAM,KAAK,IAAI,cAAc,GAAW,CAAc;AAEtE,MAAA,EAAA,MAAkB;AAChB,aAAK,OAAO,EAAQ,CAAA;AAAA,MACtB,CAAC;AAAA,IACH,SAAS,GAAO;AACd,WAAK,aAAa,WAAW,CAAK;AAAA,IACpC;AAAA,EACF;AAAA,EAOA,aAAA,CAA0C,GAAQ,MAAuC;AACvF,IAAI,CAAC,KAAW,KAAK,OAAO,CAAA,MAE5B,KAAK,OAAO;AAAA,MAAE,GAAG,KAAK;AAAA,MAAO,CAAA,CAAA,GAAM;AAAA,IAAQ;AAAA,EAC7C;AAAA,EAEA,eAAA,CAAwB,GAAgB,MACtC,KAAK,YAAY,iBAAiB,GAAO;AAAA,IAAE,OAAO;AAAA,IAAmB,QAAA;AAAA,EAAO,CAAC;AACjF"}
|
|
@@ -194,6 +194,28 @@ export interface SurveyModalCopy {
|
|
|
194
194
|
/** ARIA label for the snackbar close button. */
|
|
195
195
|
toast_close_aria: string;
|
|
196
196
|
}
|
|
197
|
+
/** Subscription Status modal words. */
|
|
198
|
+
export interface SubscriptionStatusModalCopy {
|
|
199
|
+
/** Dialog title. */
|
|
200
|
+
title: string;
|
|
201
|
+
/** Positive answer. */
|
|
202
|
+
subscribed_answer: string;
|
|
203
|
+
/** Negative answer; opens the reasons. */
|
|
204
|
+
not_subscribed_answer: string;
|
|
205
|
+
/** Reasons. */
|
|
206
|
+
never_subscribed: string;
|
|
207
|
+
cancelled: string;
|
|
208
|
+
one_time_purchase: string;
|
|
209
|
+
/** Micro title once answered. */
|
|
210
|
+
reviewed_title: string;
|
|
211
|
+
/** Snackbar words. */
|
|
212
|
+
success_message: string;
|
|
213
|
+
error_message: string;
|
|
214
|
+
try_again: string;
|
|
215
|
+
/** Close labels. */
|
|
216
|
+
close_aria: string;
|
|
217
|
+
toast_close_aria: string;
|
|
218
|
+
}
|
|
197
219
|
/** Connection-details education drilldown (`connection_detail_block`). */
|
|
198
220
|
export interface ConnectionDetailsCopy {
|
|
199
221
|
aria_label_thumbs_down: string;
|
|
@@ -423,6 +445,8 @@ export interface InsightsFeedCopy {
|
|
|
423
445
|
connection_details?: ConnectionDetailsCopy;
|
|
424
446
|
/** Optional: every caller already null-guards (`copyStore.insights_feed?.survey_modal`). */
|
|
425
447
|
survey_modal?: SurveyModalCopy;
|
|
448
|
+
/** Subscription Status modal words. */
|
|
449
|
+
subscription_status_modal?: SubscriptionStatusModalCopy;
|
|
426
450
|
feedback_bar: FeedbackBarCopy;
|
|
427
451
|
dismiss: DismissInsightCopy;
|
|
428
452
|
/** Optional until the localized-content service ships the namespace. */
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ActionBlockProps } from '../mappings/blocks';
|
|
2
|
+
/** Unexpected Subscription Payment's Subscription Status modal. */
|
|
3
|
+
export declare const SubscriptionStatusModalBlock: (({ beat, }: ActionBlockProps) => import("react/jsx-runtime").JSX.Element | null) & {
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
6
|
+
export default SubscriptionStatusModalBlock;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { useGlobalCopyStore as G, useGlobalStore as P, useInsightsV2Store as W } from "../../common/context/hooks.es.js";
|
|
2
|
+
import { slot as a } from "../../core/types/Insights.es.js";
|
|
3
|
+
import { formatCurrency as F } from "../../core/utils/NumberFormatting.es.js";
|
|
4
|
+
import A from "../../common/components/dialog/Dialog.es.js";
|
|
5
|
+
import { useBeatActions as j } from "../beatActions.es.js";
|
|
6
|
+
import { USER_RESPONSE as c, answerSubscription as H, repeatingTransactionOf as U, reportSubscriptionMarkedIncorrect as V } from "../ctaActions/subscriptionAnswer.es.js";
|
|
7
|
+
import z from "../components/LogoFromGuid.es.js";
|
|
8
|
+
import "../components/celebrationGradients.es.js";
|
|
9
|
+
import { ELEVATION_SHADOW as X } from "../components/shared/elevation.es.js";
|
|
10
|
+
import $ from "../components/TransactionListCard.es.js";
|
|
11
|
+
import { subscriptionFrequency as q } from "../components/SubscriptionStatus/subscriptionFrequency.es.js";
|
|
12
|
+
import Z from "../components/shared/StatusSnackbar.es.js";
|
|
13
|
+
import { getDynamicCtaBasedOnTriggers as J } from "./util.es.js";
|
|
14
|
+
import { useRef as K, useState as x } from "react";
|
|
15
|
+
import { observer as Q } from "mobx-react-lite";
|
|
16
|
+
import C from "@mui/material/Stack";
|
|
17
|
+
import { Text as Y } from "@mxenabled/mxui";
|
|
18
|
+
import { Icon as oo } from "@mxenabled/mx-icons";
|
|
19
|
+
import { Fragment as ro, jsx as r, jsxs as _ } from "react/jsx-runtime";
|
|
20
|
+
import to from "@mui/material/Divider";
|
|
21
|
+
import eo from "@mui/material/ButtonBase";
|
|
22
|
+
var so = 32, D = {
|
|
23
|
+
backgroundColor: "background.paper",
|
|
24
|
+
borderRadius: 1,
|
|
25
|
+
boxShadow: X[16]
|
|
26
|
+
}, E = {
|
|
27
|
+
"& .MuiDialog-paper": D,
|
|
28
|
+
"& .MuiDialogContent-root": { p: 0 },
|
|
29
|
+
"& .MuiDialogActions-root .MuiButton-root": {
|
|
30
|
+
px: 16,
|
|
31
|
+
py: 12
|
|
32
|
+
}
|
|
33
|
+
}, Io = Q(function({ beat: g }) {
|
|
34
|
+
const O = P(), { insights_feed: w, recurring: I } = G(), { actionDrawer: R, closeActionDrawer: N } = W(), T = j(), [b, l] = x("answers"), [e, u] = x(null), s = K(!1), o = w?.subscription_status_modal, i = g.insights_payload;
|
|
35
|
+
if (!i || !o || !Object.values(o).every((t) => typeof t == "string" && t.trim())) return null;
|
|
36
|
+
const m = {
|
|
37
|
+
beat: g,
|
|
38
|
+
stores: O,
|
|
39
|
+
hostActions: T
|
|
40
|
+
}, n = J(R, i.primary_cta, i.secondary_cta, i.in_description_cta)?.drilldown_data ?? {}, y = a(n, "logo"), p = a(n, "primary_text"), S = a(n, "amount"), d = async (t) => {
|
|
41
|
+
l("saving");
|
|
42
|
+
try {
|
|
43
|
+
await H(m, t), u({ severity: "success" });
|
|
44
|
+
} catch {
|
|
45
|
+
u({
|
|
46
|
+
severity: "error",
|
|
47
|
+
retry: t
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
l("done");
|
|
51
|
+
}, f = () => {
|
|
52
|
+
u(null), N();
|
|
53
|
+
}, k = () => {
|
|
54
|
+
s.current = !0, V(m), l("reasons");
|
|
55
|
+
}, B = () => {
|
|
56
|
+
s.current = !0, d(c.CONFIRMED);
|
|
57
|
+
}, M = () => {
|
|
58
|
+
if (s.current) {
|
|
59
|
+
s.current = !1;
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
f();
|
|
63
|
+
}, h = [
|
|
64
|
+
{
|
|
65
|
+
label: o.never_subscribed,
|
|
66
|
+
userResponse: c.NEVER_SUBSCRIBED
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: o.cancelled,
|
|
70
|
+
userResponse: c.CANCELLED
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
label: o.one_time_purchase,
|
|
74
|
+
userResponse: c.ONE_TIME_PURCHASE
|
|
75
|
+
}
|
|
76
|
+
];
|
|
77
|
+
return /* @__PURE__ */ _(ro, { children: [
|
|
78
|
+
/* @__PURE__ */ r(A, {
|
|
79
|
+
copy: {
|
|
80
|
+
title: o.title,
|
|
81
|
+
close_aria: o.close_aria
|
|
82
|
+
},
|
|
83
|
+
fullWidth: !0,
|
|
84
|
+
isOpen: b === "answers",
|
|
85
|
+
onClose: M,
|
|
86
|
+
onPrimaryAction: B,
|
|
87
|
+
onSecondaryAction: k,
|
|
88
|
+
primaryText: o.subscribed_answer,
|
|
89
|
+
secondaryText: o.not_subscribed_answer,
|
|
90
|
+
sx: E,
|
|
91
|
+
children: typeof p == "string" && p && /* @__PURE__ */ r($, {
|
|
92
|
+
background: "linear-gradient(201deg, rgba(255, 170, 0, 0.25) 1.86%, rgba(255, 68, 0, 0.25) 101.54%)",
|
|
93
|
+
elevated: !0,
|
|
94
|
+
rows: [{
|
|
95
|
+
amount: typeof S == "number" ? F(S, "0,0.00") : "",
|
|
96
|
+
amountCaption: q(I, U(m)),
|
|
97
|
+
leading: y ? /* @__PURE__ */ r(z, {
|
|
98
|
+
logo: y,
|
|
99
|
+
size: so
|
|
100
|
+
}) : void 0,
|
|
101
|
+
subtitle: a(n, "secondary_text") ?? "",
|
|
102
|
+
title: p
|
|
103
|
+
}]
|
|
104
|
+
})
|
|
105
|
+
}),
|
|
106
|
+
/* @__PURE__ */ r(A, {
|
|
107
|
+
copy: {
|
|
108
|
+
title: o.title,
|
|
109
|
+
close_aria: o.close_aria
|
|
110
|
+
},
|
|
111
|
+
fullWidth: !0,
|
|
112
|
+
isOpen: b === "reasons",
|
|
113
|
+
onClose: f,
|
|
114
|
+
showActions: !1,
|
|
115
|
+
sx: {
|
|
116
|
+
...E,
|
|
117
|
+
"& .MuiDialog-paper": {
|
|
118
|
+
...D,
|
|
119
|
+
pb: 16
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
children: /* @__PURE__ */ r(C, { children: h.map(({ label: t, userResponse: v }, L) => /* @__PURE__ */ _(C, { children: [/* @__PURE__ */ _(eo, {
|
|
123
|
+
onClick: () => {
|
|
124
|
+
d(v);
|
|
125
|
+
},
|
|
126
|
+
sx: {
|
|
127
|
+
gap: 12,
|
|
128
|
+
justifyContent: "space-between",
|
|
129
|
+
minHeight: 44,
|
|
130
|
+
px: 24,
|
|
131
|
+
py: 8,
|
|
132
|
+
textAlign: "left",
|
|
133
|
+
width: "100%"
|
|
134
|
+
},
|
|
135
|
+
children: [/* @__PURE__ */ r(Y, {
|
|
136
|
+
variant: "body1",
|
|
137
|
+
children: t
|
|
138
|
+
}), /* @__PURE__ */ r(oo, {
|
|
139
|
+
"aria-hidden": !0,
|
|
140
|
+
name: "chevron_right",
|
|
141
|
+
size: 24,
|
|
142
|
+
sx: { color: "action.active" }
|
|
143
|
+
})]
|
|
144
|
+
}), L < h.length - 1 && /* @__PURE__ */ r(to, { sx: {
|
|
145
|
+
ml: 24,
|
|
146
|
+
mt: "-1px"
|
|
147
|
+
} })] }, v)) })
|
|
148
|
+
}),
|
|
149
|
+
e && /* @__PURE__ */ r(Z, {
|
|
150
|
+
actionText: e.retry ? o.try_again : void 0,
|
|
151
|
+
closeAriaLabel: o.toast_close_aria,
|
|
152
|
+
message: e.severity === "success" ? o.success_message : o.error_message,
|
|
153
|
+
onActionClick: e.retry ? () => {
|
|
154
|
+
d(e.retry);
|
|
155
|
+
} : void 0,
|
|
156
|
+
onClose: f,
|
|
157
|
+
open: !0,
|
|
158
|
+
severity: e.severity,
|
|
159
|
+
variant: "strong"
|
|
160
|
+
})
|
|
161
|
+
] });
|
|
162
|
+
});
|
|
163
|
+
export {
|
|
164
|
+
Io as SubscriptionStatusModalBlock,
|
|
165
|
+
Io as default
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
//# sourceMappingURL=SubscriptionStatusModalBlock.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubscriptionStatusModalBlock.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/SubscriptionStatusModalBlock.tsx"],"sourcesContent":["import { useRef, useState } from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport ButtonBase from '@mui/material/ButtonBase'\nimport Divider from '@mui/material/Divider'\nimport Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { Text } from '@mxenabled/mxui'\n\nimport { Dialog, useGlobalCopyStore, useGlobalStore, useInsightsV2Store } from '../../common'\nimport { slot } from '../../core'\nimport type { LogoRef } from '../../core'\nimport { formatCurrency } from '../../core/utils/NumberFormatting'\nimport { useBeatActions } from '../beatActions'\nimport { WARNING_WASH_GRADIENT } from '../components/celebrationGradients'\nimport LogoFromGuid from '../components/LogoFromGuid'\nimport { ELEVATION_SHADOW } from '../components/shared/elevation'\nimport StatusSnackbar from '../components/shared/StatusSnackbar'\nimport { subscriptionFrequency } from '../components/SubscriptionStatus/subscriptionFrequency'\nimport TransactionListCard from '../components/TransactionListCard'\nimport {\n answerSubscription,\n repeatingTransactionOf,\n reportSubscriptionMarkedIncorrect,\n USER_RESPONSE,\n} from '../ctaActions/subscriptionAnswer'\nimport type { ActionBlockProps } from '../mappings/blocks'\nimport { getDynamicCtaBasedOnTriggers } from './util'\n\nconst ROW_LOGO_SIZE = 32\n\n// Figma Dialog: white paper, 4px radius, elevation/16; full-bleed content; 12/16 action buttons.\nconst DIALOG_PAPER_SX = {\n backgroundColor: 'background.paper',\n borderRadius: 1,\n boxShadow: ELEVATION_SHADOW[16],\n}\nconst SUBSCRIPTION_DIALOG_SX = {\n '& .MuiDialog-paper': DIALOG_PAPER_SX,\n '& .MuiDialogContent-root': { p: 0 },\n '& .MuiDialogActions-root .MuiButton-root': { px: 16, py: 12 },\n}\n\ntype Phase = 'answers' | 'reasons' | 'saving' | 'done'\ninterface Notice {\n severity: 'success' | 'error'\n retry?: string\n}\n\n/** Unexpected Subscription Payment's Subscription Status modal. */\nexport const SubscriptionStatusModalBlock = observer(function SubscriptionStatusModalBlock({\n beat,\n}: ActionBlockProps) {\n const stores = useGlobalStore()\n const { insights_feed, recurring } = useGlobalCopyStore()\n const { actionDrawer, closeActionDrawer } = useInsightsV2Store()\n const beatActions = useBeatActions()\n const [phase, setPhase] = useState<Phase>('answers')\n const [notice, setNotice] = useState<Notice | null>(null)\n // The Dialog calls onClose after its actions; keep the flow open.\n const actionTaken = useRef(false)\n\n const copy = insights_feed?.subscription_status_modal\n const payload = beat.insights_payload\n\n if (\n !payload ||\n !copy ||\n !Object.values(copy).every((word) => typeof word === 'string' && word.trim())\n ) {\n return null\n }\n\n const ctx = { beat, stores, hostActions: beatActions }\n const cta = getDynamicCtaBasedOnTriggers(\n actionDrawer,\n payload.primary_cta,\n payload.secondary_cta,\n payload.in_description_cta,\n )\n const row = cta?.drilldown_data ?? {}\n const logo = slot<LogoRef>(row, 'logo')\n const title = slot<string>(row, 'primary_text')\n const amount = slot<number>(row, 'amount')\n\n const save = async (userResponse: string) => {\n setPhase('saving')\n try {\n await answerSubscription(ctx, userResponse)\n setNotice({ severity: 'success' })\n } catch {\n setNotice({ severity: 'error', retry: userResponse })\n }\n setPhase('done')\n }\n\n const finish = () => {\n setNotice(null)\n closeActionDrawer()\n }\n\n const chooseNotSubscribed = () => {\n actionTaken.current = true\n reportSubscriptionMarkedIncorrect(ctx)\n setPhase('reasons')\n }\n\n const chooseSubscribed = () => {\n actionTaken.current = true\n void save(USER_RESPONSE.CONFIRMED)\n }\n\n const closeAnswers = () => {\n if (actionTaken.current) {\n actionTaken.current = false\n return\n }\n finish()\n }\n\n const reasons = [\n { label: copy.never_subscribed, userResponse: USER_RESPONSE.NEVER_SUBSCRIBED },\n { label: copy.cancelled, userResponse: USER_RESPONSE.CANCELLED },\n { label: copy.one_time_purchase, userResponse: USER_RESPONSE.ONE_TIME_PURCHASE },\n ]\n\n return (\n <>\n <Dialog\n copy={{ title: copy.title, close_aria: copy.close_aria }}\n // Fixed xs width.\n fullWidth={true}\n isOpen={phase === 'answers'}\n onClose={closeAnswers}\n onPrimaryAction={chooseSubscribed}\n onSecondaryAction={chooseNotSubscribed}\n primaryText={copy.subscribed_answer}\n secondaryText={copy.not_subscribed_answer}\n // Full-bleed wash between title and actions.\n sx={SUBSCRIPTION_DIALOG_SX}\n >\n {typeof title === 'string' && title && (\n <TransactionListCard\n background={WARNING_WASH_GRADIENT}\n elevated={true}\n rows={[\n {\n amount: typeof amount === 'number' ? formatCurrency(amount, '0,0.00') : '',\n amountCaption: subscriptionFrequency(recurring, repeatingTransactionOf(ctx)),\n leading: logo ? <LogoFromGuid logo={logo} size={ROW_LOGO_SIZE} /> : undefined,\n subtitle: slot<string>(row, 'secondary_text') ?? '',\n title,\n },\n ]}\n />\n )}\n </Dialog>\n\n <Dialog\n copy={{ title: copy.title, close_aria: copy.close_aria }}\n fullWidth={true}\n isOpen={phase === 'reasons'}\n onClose={finish}\n showActions={false}\n // Space under the list.\n sx={{ ...SUBSCRIPTION_DIALOG_SX, '& .MuiDialog-paper': { ...DIALOG_PAPER_SX, pb: 16 } }}\n >\n <Stack>\n {reasons.map(({ label, userResponse }, index) => (\n <Stack key={userResponse}>\n <ButtonBase\n onClick={() => void save(userResponse)}\n sx={{\n gap: 12,\n justifyContent: 'space-between',\n minHeight: 44,\n px: 24,\n py: 8,\n textAlign: 'left',\n width: '100%',\n }}\n >\n <Text variant=\"body1\">{label}</Text>\n <Icon\n aria-hidden={true}\n name=\"chevron_right\"\n size={24}\n sx={{ color: 'action.active' }}\n />\n </ButtonBase>\n {/* Between rows only, drawn over the row edge (as Figma) so rows stay 44px apart. */}\n {index < reasons.length - 1 && <Divider sx={{ ml: 24, mt: '-1px' }} />}\n </Stack>\n ))}\n </Stack>\n </Dialog>\n\n {notice && (\n <StatusSnackbar\n actionText={notice.retry ? copy.try_again : undefined}\n closeAriaLabel={copy.toast_close_aria}\n message={notice.severity === 'success' ? copy.success_message : copy.error_message}\n onActionClick={notice.retry ? () => void save(notice.retry as string) : undefined}\n onClose={finish}\n open={true}\n severity={notice.severity}\n variant=\"strong\"\n />\n )}\n </>\n )\n})\n\nexport default SubscriptionStatusModalBlock\n"],"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,MAAO,EAAI,CAAA,CAChE,EAAA,GAvBK,CAuBL,CACR,EACI,CAAA;AAAA,IACD,CAAA;AAAA,IAEP,KACC,gBAAA,EAAC,GAAD;AAAA,MACE,YAAY,EAAO,QAAQ,EAAK,YAAY;AAAA,MAC5C,gBAAgB,EAAK;AAAA,MACrB,SAAS,EAAO,aAAa,YAAY,EAAK,kBAAkB,EAAK;AAAA,MACrE,eAAe,EAAO,QAAA,MAAA;AAAc,QAAK,EAAK,EAAO,KAAe;AAAA,UAAI;AAAA,MACxE,SAAS;AAAA,MACT,MAAM;AAAA,MACN,UAAU,EAAO;AAAA,MACjB,SAAQ;AAAA,IACT,CAAA;AAAA,EAEH,EAAA,CAAA;AAEN,CAAC"}
|
|
@@ -9,25 +9,25 @@ import { ANALYTICS_EVENTS_CONFIG as P } from "../../analytics/analyticsEventsCon
|
|
|
9
9
|
import { useAnalyticsEvent as Lt } from "../../analytics/useAnalyticsEvent.es.js";
|
|
10
10
|
import { DoubleBarChart as It } from "../../components/chartblocks/DoubleBarChart.es.js";
|
|
11
11
|
import { toLegendItems as xt } from "../../blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils.es.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
12
|
+
import { getDynamicCtaBasedOnTriggers as Et } from "../util.es.js";
|
|
13
|
+
import { TransactionDrillDown as Rt } from "./TransactionDrillDown.es.js";
|
|
14
|
+
import { getDefaultSelection as Ot, getDrillDownConfig as jt, getFlattenedDataSeries as Ft, resolveDrillDownSubHeader as Gt, splitProjectedTransaction as Ht, toStoreFilter as wt } from "./utils.es.js";
|
|
15
|
+
import { useTransactionHistory as kt } from "./useTransactionHistory.es.js";
|
|
16
16
|
import { TransactionDetailsBlock as Nt } from "../TransactionDetailsBlock/TransactionDetailsBlock.es.js";
|
|
17
17
|
import { useLayoutEffect as Kt, useState as m } from "react";
|
|
18
18
|
import { observer as Mt } from "mobx-react-lite";
|
|
19
19
|
import { Fragment as Pt, jsx as r, jsxs as Vt } from "react/jsx-runtime";
|
|
20
20
|
import { useTheme as zt } from "@mui/material/styles";
|
|
21
21
|
var ge = Mt(({ beat: s }) => {
|
|
22
|
-
const D = zt(), { actionDrawer: B, setActionContext: S } = Ct(), { insights_payload: c } = s, V =
|
|
22
|
+
const D = zt(), { actionDrawer: B, setActionContext: S } = Ct(), { insights_payload: c } = s, V = Et(B, c?.primary_cta, c?.secondary_cta, c?.in_description_cta)?.variant, { top: e, filterMode: u, header: z, colors: U, filterStrategy: W, tipSection: v, subTabAriaLabels: Y, slotData: $, beatTransactions: q } = jt(V ?? ""), { instanceSlotData: a, beatTransactions: g, spendCategoryGuids: L, allAccountGuids: I, categoryName: J, displayedDateRange: f, transactionStore: Q } = kt(s, {
|
|
23
23
|
slotData: $,
|
|
24
24
|
beatTransactions: q
|
|
25
|
-
}), { common: X, insights_feed: n } = _t(), { isCopyLoaded: Z } = Tt(), [tt, x] = m(!1), [et, ot] = m(!1), E = Lt(), { dataSeries: p, chartData: b, comparisonBars: i } =
|
|
25
|
+
}), { common: X, insights_feed: n } = _t(), { isCopyLoaded: Z } = Tt(), [tt, x] = m(!1), [et, ot] = m(!1), E = Lt(), { dataSeries: p, chartData: b, comparisonBars: i } = Ft({
|
|
26
26
|
data: a?.data_series,
|
|
27
27
|
ariaLabel: e === "doubleBar" ? n?.general?.in_month_you_had_a_category_of_amount ?? "_1{month}, _2{category}: _3{amount}" : Bt,
|
|
28
28
|
top: e,
|
|
29
29
|
beatTransactions: g
|
|
30
|
-
}), d = e === "doubleBar", at = e === "tabsOnly", l = d ? i : b, { chartBarIndex: R, subTabIndex: nt } =
|
|
30
|
+
}), d = e === "doubleBar", at = e === "tabsOnly", l = d ? i : b, { chartBarIndex: R, subTabIndex: nt } = Ot({
|
|
31
31
|
chartTabCount: b.length,
|
|
32
32
|
comparisonTabCount: i.length,
|
|
33
33
|
actionDrawer: B,
|
|
@@ -46,7 +46,7 @@ var ge = Mt(({ beat: s }) => {
|
|
|
46
46
|
spendCategoryGuids: L,
|
|
47
47
|
displayedDateRange: f
|
|
48
48
|
}), it = g.map((t) => t.guid).join(","), lt = L.join(","), ct = I.join(","), dt = e === "list" || e === "tabsOnly" || e === "monthTabs" || p.length > 0, j = () => {
|
|
49
|
-
u !== "store" || !dt || Q.setFilter(
|
|
49
|
+
u !== "store" || !dt || Q.setFilter(wt(C(o), {
|
|
50
50
|
allAccountGuids: I,
|
|
51
51
|
displayedDateRange: f
|
|
52
52
|
}));
|
|
@@ -66,14 +66,14 @@ var ge = Mt(({ beat: s }) => {
|
|
|
66
66
|
it,
|
|
67
67
|
e
|
|
68
68
|
]);
|
|
69
|
-
const F =
|
|
69
|
+
const F = Gt(c), y = z?.({
|
|
70
70
|
title: c?.title,
|
|
71
71
|
subHeader: F,
|
|
72
72
|
categoryName: J,
|
|
73
73
|
selectedDate: b[o]?.date ?? void 0
|
|
74
74
|
}), G = U(D, a?.category_guid);
|
|
75
75
|
if (!Z) return /* @__PURE__ */ r(Dt, {});
|
|
76
|
-
const [H, w] = a?.legends ?? [], mt = u === "local" ? (t) => C(t).custom ?? (() => !0) : void 0, { transactions: ut, projectedTransaction: A } =
|
|
76
|
+
const [H, w] = a?.legends ?? [], mt = u === "local" ? (t) => C(t).custom ?? (() => !0) : void 0, { transactions: ut, projectedTransaction: A } = Ht(g), gt = u === "local" ? ut : void 0, k = n.general.projected_amount, pt = A && k && C(o).custom?.(A) ? {
|
|
77
77
|
heading: k,
|
|
78
78
|
transaction: A
|
|
79
79
|
} : void 0, N = (t, h) => {
|
|
@@ -116,7 +116,7 @@ var ge = Mt(({ beat: s }) => {
|
|
|
116
116
|
selectedTabIndex: o,
|
|
117
117
|
trendAmountLabel: w?.label ?? n.general.trend
|
|
118
118
|
}) : /* @__PURE__ */ r(vt, {}) : null;
|
|
119
|
-
return /* @__PURE__ */ Vt(Pt, { children: [/* @__PURE__ */ r(
|
|
119
|
+
return /* @__PURE__ */ Vt(Pt, { children: [/* @__PURE__ */ r(Rt, {
|
|
120
120
|
baseTransactions: gt,
|
|
121
121
|
projectedRow: pt,
|
|
122
122
|
heading: y?.heading,
|
package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useInsightsV2Store as d, useTransactionStore as f } from "../../../common/context/hooks.es.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { getDynamicCtaBasedOnTriggers as g } from "../util.es.js";
|
|
3
|
+
import { getDrillDownConfig as m, guidListOf as p } from "./utils.es.js";
|
|
4
4
|
import l from "react";
|
|
5
5
|
var w = ({ beat: t }) => {
|
|
6
6
|
const { isTransactionDataLoaded: o, loadMissingTransactionData: s, loadTransactionsByGuids: n } = f(), { actionDrawer: r } = d();
|
|
7
7
|
l.useEffect(() => {
|
|
8
|
-
const a = t?.insights_payload, c =
|
|
8
|
+
const a = t?.insights_payload, c = g(r, a?.primary_cta, a?.secondary_cta, a?.in_description_cta)?.variant, { fetchMissingTransactions: e } = m(c ?? ""), i = p(e?.(t));
|
|
9
9
|
(async () => (o || await s(), i && await n(i)))();
|
|
10
10
|
}, []);
|
|
11
11
|
};
|
|
@@ -1,95 +1,128 @@
|
|
|
1
|
-
import { useCategoryStore as
|
|
2
|
-
import { slot as
|
|
3
|
-
import { formatCurrency as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
1
|
+
import { useCategoryStore as F, useGlobalCopyStore as M, useGlobalStore as Z } from "../../../../common/context/hooks.es.js";
|
|
2
|
+
import { slot as a } from "../../../../core/types/Insights.es.js";
|
|
3
|
+
import { formatCurrency as h } from "../../../../core/utils/NumberFormatting.es.js";
|
|
4
|
+
import { useBeatActions as $ } from "../../../beatActions.es.js";
|
|
5
|
+
import { USER_RESPONSE as j, repeatingTransactionOf as D } from "../../../ctaActions/subscriptionAnswer.es.js";
|
|
6
|
+
import { logoFromRef as H } from "../../../components/shared/EntityLogo.es.js";
|
|
7
|
+
import P from "../../../components/LogoFromGuid.es.js";
|
|
8
|
+
import { statusIconName as V, statusIconPalette as x } from "../../../components/statusIcon.es.js";
|
|
9
|
+
import { resolveVariantConfig as q } from "../../resolveVariantConfig.es.js";
|
|
10
|
+
import U from "../../../components/TransactionListCard.es.js";
|
|
11
|
+
import W from "../../../components/StatusMessageCard.es.js";
|
|
12
|
+
import { subscriptionFrequency as Y } from "../../../components/SubscriptionStatus/subscriptionFrequency.es.js";
|
|
13
|
+
import { getLayoutConfig as J, transactionBlockVariant as K } from "./layout.es.js";
|
|
14
|
+
import { observer as Q } from "mobx-react-lite";
|
|
15
|
+
import { CategoryIcon as X, InstitutionLogo as tt, MerchantLogo as ot } from "@mxenabled/mxui";
|
|
16
|
+
import { Icon as b } from "@mxenabled/mx-icons";
|
|
13
17
|
import { jsx as o } from "react/jsx-runtime";
|
|
14
|
-
import { useTheme as
|
|
15
|
-
import
|
|
16
|
-
var
|
|
17
|
-
const
|
|
18
|
+
import { useTheme as rt } from "@mui/material/styles";
|
|
19
|
+
import u from "@mui/material/Box";
|
|
20
|
+
var s = 32, et = Math.round(s * 0.625), nt = 20, v = 32, it = 20, at = ({ icon: e }) => {
|
|
21
|
+
const n = V(e?.guid);
|
|
22
|
+
return n ? /* @__PURE__ */ o(u, {
|
|
23
|
+
"aria-hidden": !0,
|
|
24
|
+
"data-icon": n,
|
|
25
|
+
"data-testid": "subscription-badge",
|
|
26
|
+
sx: {
|
|
27
|
+
alignItems: "center",
|
|
28
|
+
bgcolor: `${x(e?.color)}.main`,
|
|
29
|
+
borderRadius: "50%",
|
|
30
|
+
display: "flex",
|
|
31
|
+
height: v,
|
|
32
|
+
justifyContent: "center",
|
|
33
|
+
width: v
|
|
34
|
+
},
|
|
35
|
+
children: /* @__PURE__ */ o(b, {
|
|
36
|
+
fill: !0,
|
|
37
|
+
name: n,
|
|
38
|
+
size: it,
|
|
39
|
+
sx: { color: `${x(e?.color)}.contrastText` }
|
|
40
|
+
})
|
|
41
|
+
}) : null;
|
|
42
|
+
}, st = (e, n) => {
|
|
43
|
+
const t = H(e.logo, e.primary_text);
|
|
18
44
|
if (t) {
|
|
19
|
-
if (t.logo_name) return /* @__PURE__ */ o(
|
|
45
|
+
if (t.logo_name) return /* @__PURE__ */ o(u, {
|
|
20
46
|
sx: {
|
|
21
47
|
alignItems: "center",
|
|
22
48
|
display: "flex",
|
|
23
|
-
height:
|
|
49
|
+
height: s,
|
|
24
50
|
justifyContent: "center",
|
|
25
|
-
width:
|
|
51
|
+
width: s
|
|
26
52
|
},
|
|
27
|
-
children: /* @__PURE__ */ o(
|
|
53
|
+
children: /* @__PURE__ */ o(b, {
|
|
28
54
|
name: t.logo_name,
|
|
29
|
-
size:
|
|
55
|
+
size: et,
|
|
30
56
|
sx: { color: t.logo_color }
|
|
31
57
|
})
|
|
32
58
|
});
|
|
33
|
-
if (t.merchant_guid) return /* @__PURE__ */ o(
|
|
59
|
+
if (t.merchant_guid) return /* @__PURE__ */ o(ot, {
|
|
34
60
|
alt: t.merchant_name ?? "",
|
|
35
|
-
categoryGuid: t.category_guid ?
|
|
61
|
+
categoryGuid: t.category_guid ? n(t.category_guid) : "",
|
|
36
62
|
merchantGuid: t.merchant_guid,
|
|
37
|
-
size:
|
|
63
|
+
size: s
|
|
38
64
|
});
|
|
39
|
-
if (t.institution_guid) return /* @__PURE__ */ o(
|
|
65
|
+
if (t.institution_guid) return /* @__PURE__ */ o(tt, {
|
|
40
66
|
alt: t.institution_name ?? "",
|
|
41
67
|
institutionGuid: t.institution_guid,
|
|
42
|
-
size:
|
|
68
|
+
size: s
|
|
43
69
|
});
|
|
44
70
|
if (t.category_guid) {
|
|
45
|
-
const
|
|
46
|
-
return /* @__PURE__ */ o(
|
|
47
|
-
"data-testid": `category-icon-${
|
|
71
|
+
const c = n(t.category_guid);
|
|
72
|
+
return /* @__PURE__ */ o(u, {
|
|
73
|
+
"data-testid": `category-icon-${c}`,
|
|
48
74
|
sx: { display: "flex" },
|
|
49
|
-
children: /* @__PURE__ */ o(
|
|
50
|
-
categoryGuid:
|
|
51
|
-
size:
|
|
75
|
+
children: /* @__PURE__ */ o(X, {
|
|
76
|
+
categoryGuid: c,
|
|
77
|
+
size: s
|
|
52
78
|
})
|
|
53
79
|
});
|
|
54
80
|
}
|
|
55
81
|
}
|
|
56
|
-
},
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
82
|
+
}, Tt = Q(({ payload: e }) => {
|
|
83
|
+
const n = rt(), { getTopLevelCategoryGuid: t } = F(), c = Z(), { recurring: I } = M(), { beat: g } = $(), { data: i, variant: S } = e.instance_slot, { answeredBackground: l, background: C, cardVariant: G, elevated: E, followsSubscription: f, showFooter: T, sx: B, showHeader: L, statusMessage: O } = q(J(n), S, K.NoHeader, "TransactionBlock"), m = f && g ? g : void 0, p = m ? D({
|
|
84
|
+
beat: m,
|
|
85
|
+
stores: c
|
|
86
|
+
}) : void 0, _ = p?.user_response === j.CONFIRMED;
|
|
87
|
+
if (O) {
|
|
88
|
+
const r = a(i, "message");
|
|
89
|
+
return typeof r != "string" || !r.trim() ? (console.warn("[TransactionBlock] status_message has no message — rendering nothing."), null) : /* @__PURE__ */ o(W, {
|
|
90
|
+
icon: /* @__PURE__ */ o(u, {
|
|
62
91
|
"aria-hidden": "true",
|
|
63
92
|
sx: { display: "flex" },
|
|
64
|
-
children: /* @__PURE__ */ o(
|
|
65
|
-
logo: i
|
|
66
|
-
size:
|
|
93
|
+
children: /* @__PURE__ */ o(P, {
|
|
94
|
+
logo: a(i, "icon"),
|
|
95
|
+
size: nt
|
|
67
96
|
})
|
|
68
97
|
}),
|
|
69
|
-
message:
|
|
98
|
+
message: r
|
|
70
99
|
});
|
|
71
100
|
}
|
|
72
|
-
const
|
|
73
|
-
if (!Array.isArray(
|
|
74
|
-
const
|
|
75
|
-
label:
|
|
76
|
-
amount:
|
|
77
|
-
} : void 0;
|
|
78
|
-
return /* @__PURE__ */ o(
|
|
79
|
-
background:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
101
|
+
const d = a(i, "series"), y = a(i, "header_text");
|
|
102
|
+
if (!Array.isArray(d) || !d.length) return null;
|
|
103
|
+
const k = L && typeof y == "string" ? y : void 0, R = a(i, "footer_text"), A = a(i, "footer_amount"), z = T ? {
|
|
104
|
+
label: R,
|
|
105
|
+
amount: h(A, "0,0.00")
|
|
106
|
+
} : void 0, N = m ? Y(I, p) : void 0, w = f ? /* @__PURE__ */ o(at, { icon: a(i, _ ? "reviewed_icon" : "icon") }) : void 0;
|
|
107
|
+
return /* @__PURE__ */ o(U, {
|
|
108
|
+
background: _ && l ? l : C,
|
|
109
|
+
badge: w,
|
|
110
|
+
elevated: E,
|
|
111
|
+
footer: z,
|
|
112
|
+
header: k,
|
|
113
|
+
sx: B,
|
|
114
|
+
variant: G,
|
|
115
|
+
rows: d.map((r) => ({
|
|
116
|
+
amount: typeof r.amount == "number" ? h(r.amount, "0,0.00") : "",
|
|
117
|
+
amountCaption: N,
|
|
118
|
+
leading: st(r, t),
|
|
119
|
+
subtitle: r.secondary_text ?? "",
|
|
120
|
+
title: r.primary_text ?? ""
|
|
88
121
|
}))
|
|
89
122
|
});
|
|
90
123
|
});
|
|
91
124
|
export {
|
|
92
|
-
|
|
125
|
+
Tt as TransactionBlock
|
|
93
126
|
};
|
|
94
127
|
|
|
95
128
|
//# sourceMappingURL=TransactionBlock.es.js.map
|