@mx-cartographer/experiences 9.7.114 → 9.7.115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.d.ts +4 -3
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.es.js +21 -20
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js +33 -33
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## [9.7.115] - 11-06-2026
|
|
2
|
+
|
|
3
|
+
- **CHANGED** - Insights 2.0 drawers read their data from the CTA that opened them: the Transaction List drawer lists the clicked CTA's `drilldown_data.transaction_guids`, and Transaction Details opens the clicked CTA's `drilldown_data.transaction_guid`, before falling back to the card-level `drilldown_data` / `primary_transaction_guid`, so existing beats are unchanged (Peer-To-Peer Categorization V2, WEC-2238)
|
|
4
|
+
|
|
1
5
|
## [9.7.114] - 11-06-2026
|
|
2
6
|
|
|
3
7
|
- **FIXED** - The Weekly New Merchants "Others" row icon tile has the 4px corner radius of the row's other logo tiles (was 8px)
|
package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.d.ts
CHANGED
|
@@ -11,11 +11,12 @@ interface TransactionDetailsBlockState {
|
|
|
11
11
|
/**
|
|
12
12
|
* Resolves which transaction this drawer is about, and which inline actions it offers.
|
|
13
13
|
*
|
|
14
|
-
* The subject comes from
|
|
14
|
+
* The subject comes from the first of:
|
|
15
15
|
* 1. `actionContext.transaction_guid` — set by a parent drawer (e.g. a row tapped in
|
|
16
16
|
* `TransactionHistoryBlock`) when this drawer is opened nested.
|
|
17
|
-
* 2. `
|
|
18
|
-
*
|
|
17
|
+
* 2. the clicked CTA's `drilldown_data.transaction_guid` — each drawer's data rides on the CTA
|
|
18
|
+
* that opens it (ditto's `primary_cta.drilldown_data`).
|
|
19
|
+
* 3. `insights_payload.primary_transaction_guid` — for beats whose CTA carries no drilldown guid.
|
|
19
20
|
*
|
|
20
21
|
* The guid is then looked up in `transactionStore.detailedTransactions` rather than used directly,
|
|
21
22
|
* because `TransactionDetails` needs the *detailed* shape (account + category + taggings joined in)
|
package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.es.js
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
import { useActionContext as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { useActionContext as v, useGlobalStore as h, useInsightsV2Store as T, useTransactionStore as A } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import { getDynamicCtaBasedOnTriggers as B } from "../util.es.js";
|
|
3
|
+
import { getBottomActionsByVariant as D } from "./util.es.js";
|
|
4
|
+
import { resolveTopActions as S } from "./transactionDetailsActions.es.js";
|
|
5
|
+
import u from "react";
|
|
6
|
+
var L = (a) => {
|
|
7
|
+
const { detailedTransactions: g, isTransactionDataLoaded: p, transactions: m } = A(), { emitUpdate: r } = h(), { actionDrawer: c } = T(), { transaction_guid: _ } = v() ?? {}, o = a.insights_payload, e = B(c, o?.primary_cta, o?.secondary_cta, o?.in_description_cta)?.drilldown_data, f = typeof e?.transaction_guid == "string" ? e.transaction_guid : void 0, t = _ ?? f ?? o?.primary_transaction_guid, l = t ? g.find((n) => n.guid === t) : void 0, d = t ? m.find((n) => n.guid === t) : void 0, i = d ? JSON.stringify(d) : void 0, s = u.useRef({
|
|
7
8
|
guid: t,
|
|
8
|
-
snapshot:
|
|
9
|
+
snapshot: i
|
|
9
10
|
});
|
|
10
|
-
return
|
|
11
|
-
if (!
|
|
12
|
-
const n = s.current.guid === t && s.current.snapshot !== void 0,
|
|
11
|
+
return u.useEffect(() => {
|
|
12
|
+
if (!i) return;
|
|
13
|
+
const n = s.current.guid === t && s.current.snapshot !== void 0, y = s.current.snapshot !== i;
|
|
13
14
|
s.current = {
|
|
14
15
|
guid: t,
|
|
15
|
-
snapshot:
|
|
16
|
-
}, n &&
|
|
16
|
+
snapshot: i
|
|
17
|
+
}, n && y && r({ staleBeatGuid: a.guid });
|
|
17
18
|
}, [
|
|
18
19
|
t,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
i,
|
|
21
|
+
a.guid,
|
|
22
|
+
r
|
|
22
23
|
]), {
|
|
23
|
-
bottomActions:
|
|
24
|
-
isLoading: !
|
|
25
|
-
topActions:
|
|
26
|
-
transaction:
|
|
24
|
+
bottomActions: D(c, o?.primary_cta, o?.secondary_cta, o?.in_description_cta),
|
|
25
|
+
isLoading: !p,
|
|
26
|
+
topActions: S(),
|
|
27
|
+
transaction: l
|
|
27
28
|
};
|
|
28
29
|
};
|
|
29
30
|
export {
|
|
30
|
-
|
|
31
|
+
L as useTransactionDetailsBlock
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
//# sourceMappingURL=useTransactionDetailsBlock.es.js.map
|
package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTransactionDetailsBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.ts"],"sourcesContent":["import React from 'react'\n\nimport {\n useActionContext,\n useGlobalStore,\n useInsightsV2Store,\n useTransactionStore,\n} from '../../../common'\nimport type { Beat, Transaction, DrilldownPayload } from '../../../core'\nimport type { BottomActions, TopActions } from '../../../transactions/constants/Actions'\nimport { getBottomActionsByVariant } from './util'\nimport { resolveTopActions } from './transactionDetailsActions'\n\ninterface TransactionDetailsBlockState {\n bottomActions: BottomActions[]\n /** True while the store is still loading; the block shows a loader instead of an empty state. */\n isLoading: boolean\n topActions: TopActions[]\n /** `undefined` once loading finishes means the transaction could not be resolved. */\n transaction?: Transaction\n}\n\n/**\n * Resolves which transaction this drawer is about, and which inline actions it offers.\n *\n * The subject comes from
|
|
1
|
+
{"version":3,"file":"useTransactionDetailsBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.ts"],"sourcesContent":["import React from 'react'\n\nimport {\n useActionContext,\n useGlobalStore,\n useInsightsV2Store,\n useTransactionStore,\n} from '../../../common'\nimport type { Beat, Transaction, DrilldownPayload } from '../../../core'\nimport type { BottomActions, TopActions } from '../../../transactions/constants/Actions'\nimport { getDynamicCtaBasedOnTriggers } from '../util'\nimport { getBottomActionsByVariant } from './util'\nimport { resolveTopActions } from './transactionDetailsActions'\n\ninterface TransactionDetailsBlockState {\n bottomActions: BottomActions[]\n /** True while the store is still loading; the block shows a loader instead of an empty state. */\n isLoading: boolean\n topActions: TopActions[]\n /** `undefined` once loading finishes means the transaction could not be resolved. */\n transaction?: Transaction\n}\n\n/**\n * Resolves which transaction this drawer is about, and which inline actions it offers.\n *\n * The subject comes from the first of:\n * 1. `actionContext.transaction_guid` — set by a parent drawer (e.g. a row tapped in\n * `TransactionHistoryBlock`) when this drawer is opened nested.\n * 2. the clicked CTA's `drilldown_data.transaction_guid` — each drawer's data rides on the CTA\n * that opens it (ditto's `primary_cta.drilldown_data`).\n * 3. `insights_payload.primary_transaction_guid` — for beats whose CTA carries no drilldown guid.\n *\n * The guid is then looked up in `transactionStore.detailedTransactions` rather than used directly,\n * because `TransactionDetails` needs the *detailed* shape (account + category + taggings joined in)\n * and edits must write through to the same store object the rest of the app renders. `buildDetailed\n * Transactions` inside the store is this repo's equivalent of pulse's `buildTransactionDetails`.\n * A guid the store does not have resolves to `undefined` (the block's error state) rather than to\n * any beat-level snapshot, so inline edits can never be made against a stale copy.\n *\n * An edit made here (category, date, memo...) replaces the transaction in the store. The beat's card\n * is built from live data (a sampled beat's count), so the host is told the beat is stale, the same\n * signal a CTA's `refreshBeat` effect sends; pulse refetches the sample on it, as its legacy cards do\n * through `shouldUpdateOnTransactionChange`.\n *\n * Actions are not beat-configurable on the v2 contract: `instance_slot_data` is not part of it (the\n * LargeTransactionV2 payload omits the key entirely), so top actions are always the defaults and\n * bottom actions are derived from the triggering CTA's variant.\n */\nexport const useTransactionDetailsBlock = (beat: Beat): TransactionDetailsBlockState => {\n const { detailedTransactions, isTransactionDataLoaded, transactions } = useTransactionStore()\n const { emitUpdate } = useGlobalStore()\n\n const { actionDrawer } = useInsightsV2Store()\n\n const { transaction_guid } = useActionContext<DrilldownPayload>() ?? {}\n const payload = beat.insights_payload\n\n const ctaDrilldown = getDynamicCtaBasedOnTriggers(\n actionDrawer,\n payload?.primary_cta,\n payload?.secondary_cta,\n payload?.in_description_cta,\n )?.drilldown_data\n const ctaGuid =\n typeof ctaDrilldown?.transaction_guid === 'string' ? ctaDrilldown.transaction_guid : undefined\n\n const guid = transaction_guid ?? ctaGuid ?? payload?.primary_transaction_guid\n\n const transaction = guid\n ? detailedTransactions.find((transaction) => transaction.guid === guid)\n : undefined\n\n // Every store load swaps in new objects, so an edit is a change in the transaction's content, not\n // its identity. The snapshot is per guid: opening another transaction is not an edit of the last.\n const stored = guid ? transactions.find((transaction) => transaction.guid === guid) : undefined\n const snapshot = stored ? JSON.stringify(stored) : undefined\n const seen = React.useRef({ guid, snapshot })\n\n React.useEffect(() => {\n if (!snapshot) return\n\n const isEdit = seen.current.guid === guid && seen.current.snapshot !== undefined\n const changed = seen.current.snapshot !== snapshot\n seen.current = { guid, snapshot }\n if (isEdit && changed) emitUpdate({ staleBeatGuid: beat.guid })\n }, [guid, snapshot, beat.guid, emitUpdate])\n\n const bottomActions = getBottomActionsByVariant(\n actionDrawer,\n payload?.primary_cta,\n payload?.secondary_cta,\n payload?.in_description_cta,\n )\n return {\n bottomActions,\n isLoading: !isTransactionDataLo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ACF;AACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useGlobalCopyStore as
|
|
1
|
+
import { useGlobalCopyStore as b, useInsightsV2Store as M, useTransactionStore as j } from "../../../common/context/hooks.es.js";
|
|
2
2
|
import u from "../../../common/components/drawer/Drawer.es.js";
|
|
3
|
-
import
|
|
4
|
-
import { selectTransactionsByGuids as
|
|
3
|
+
import x from "../../../transactions/components/shared/TransactionList.es.js";
|
|
4
|
+
import { selectTransactionsByGuids as A } from "../../CommonUtils.es.js";
|
|
5
5
|
import { getDynamicCtaBasedOnTriggers as G } from "../util.es.js";
|
|
6
6
|
import { TransactionDetailsBlock as I } from "../TransactionDetailsBlock/TransactionDetailsBlock.es.js";
|
|
7
7
|
import { HelpBlock as F } from "../HelpBlock/HelpBlock.es.js";
|
|
@@ -10,48 +10,48 @@ import { TransactionListHelpHeader as z } from "./TransactionListHelpHeader.es.j
|
|
|
10
10
|
import { TransactionListSummaryCard as V } from "./TransactionListSummaryCard.es.js";
|
|
11
11
|
import _ from "react";
|
|
12
12
|
import { observer as q } from "mobx-react-lite";
|
|
13
|
-
import { Fragment as E, jsx as
|
|
14
|
-
var K = (
|
|
15
|
-
const
|
|
16
|
-
if (
|
|
17
|
-
if (K(
|
|
18
|
-
console.warn(`[TransactionListBlock] ${
|
|
13
|
+
import { Fragment as E, jsx as a, jsxs as J } from "react/jsx-runtime";
|
|
14
|
+
var K = (o) => Array.isArray(o) && o.every((t) => typeof t == "string"), N = (o, t) => {
|
|
15
|
+
const n = o.insights_payload?.drilldown_data, i = o.insights_payload?.instance_slot_data ?? {}, [e, s] = t && Object.hasOwn(t, "transaction_guids") ? ["cta.drilldown_data", t.transaction_guids] : n && Object.hasOwn(n, "transaction_guids") ? ["drilldown_data", n.transaction_guids] : ["instance_slot_data", i.transaction_guids];
|
|
16
|
+
if (s != null) {
|
|
17
|
+
if (K(s)) return s;
|
|
18
|
+
console.warn(`[TransactionListBlock] ${e}.transaction_guids is not a list of guids — listing no transactions.`);
|
|
19
19
|
}
|
|
20
20
|
}, it = q(function({ beat: t }) {
|
|
21
|
-
const { common:
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
|
|
21
|
+
const { common: n, insights_feed: i } = b(), { actionDrawer: e, setActionContext: s } = M(), g = j(), [f, m] = _.useState(!1), [y, p] = _.useState(!1), { primary_cta: h, secondary_cta: C, in_description_cta: T, is_zero_state: w, drilldown_data: O, title: H } = t.insights_payload ?? {}, l = G(e, h, C, T), c = N(t, l?.drilldown_data), L = A(g.detailedTransactions, c), d = $(l), S = d?.count ?? c?.length ?? 0, v = d !== void 0 && !w && (c?.length ?? 0) > 0, r = R(l, O), k = (D) => {
|
|
22
|
+
s({ transaction_guid: D }), m(!0);
|
|
23
|
+
}, B = () => {
|
|
24
|
+
m(!1), s({ transaction_guid: void 0 });
|
|
25
25
|
};
|
|
26
26
|
return /* @__PURE__ */ J(E, { children: [
|
|
27
|
-
|
|
27
|
+
v && /* @__PURE__ */ a(V, {
|
|
28
28
|
copy: i.general,
|
|
29
|
-
count:
|
|
30
|
-
summary:
|
|
29
|
+
count: S,
|
|
30
|
+
summary: d
|
|
31
31
|
}),
|
|
32
|
-
|
|
33
|
-
descriptionHtml:
|
|
34
|
-
learnMoreLabel:
|
|
35
|
-
onLearnMore: () =>
|
|
36
|
-
title:
|
|
32
|
+
r && /* @__PURE__ */ a(z, {
|
|
33
|
+
descriptionHtml: r.descriptionHtml,
|
|
34
|
+
learnMoreLabel: r.learnMore?.label,
|
|
35
|
+
onLearnMore: () => p(!0),
|
|
36
|
+
title: H ?? ""
|
|
37
37
|
}),
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
onClick:
|
|
40
|
-
transaction:
|
|
38
|
+
/* @__PURE__ */ a(x, {
|
|
39
|
+
onClick: k,
|
|
40
|
+
transaction: L
|
|
41
41
|
}),
|
|
42
|
-
|
|
43
|
-
ariaLabelClose:
|
|
42
|
+
r?.learnMore && /* @__PURE__ */ a(u, {
|
|
43
|
+
ariaLabelClose: n.close_aria,
|
|
44
44
|
isOpen: y,
|
|
45
|
-
onClose: () =>
|
|
46
|
-
title:
|
|
47
|
-
children: /* @__PURE__ */
|
|
45
|
+
onClose: () => p(!1),
|
|
46
|
+
title: r.learnMore.label,
|
|
47
|
+
children: /* @__PURE__ */ a(F, { beat: t })
|
|
48
48
|
}),
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
ariaLabelClose:
|
|
49
|
+
/* @__PURE__ */ a(u, {
|
|
50
|
+
ariaLabelClose: n.close_aria,
|
|
51
51
|
isOpen: f,
|
|
52
|
-
onClose:
|
|
52
|
+
onClose: B,
|
|
53
53
|
title: i.general.transaction_details_title,
|
|
54
|
-
children: /* @__PURE__ */
|
|
54
|
+
children: /* @__PURE__ */ a(I, { beat: t })
|
|
55
55
|
})
|
|
56
56
|
] });
|
|
57
57
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionListBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.tsx"],"sourcesContent":["import React from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport {\n Drawer,\n useGlobalCopyStore,\n useInsightsV2Store,\n useTransactionStore,\n} from '../../../common'\nimport type { Beat } from '../../../core'\nimport type { InsightsInstanceSlotData } from '../../../core/types/InsightsInstanceSlotData'\nimport { TransactionDetailsBlock } from '../TransactionDetailsBlock'\nimport { TransactionList } from '../../../transactions'\nimport { selectTransactionsByGuids } from '../../CommonUtils'\nimport { getDynamicCtaBasedOnTriggers } from '../util'\nimport { HelpBlock } from '../HelpBlock'\nimport { readHelpHeader, readSummary } from './layout'\nimport { TransactionListHelpHeader } from './TransactionListHelpHeader'\nimport { TransactionListSummaryCard } from './TransactionListSummaryCard'\n\nconst isStringArray = (value: unknown): value is string[] =>\n Array.isArray(value) && value.every((item) => typeof item === 'string')\n\n/**\n * The guids the drawer lists
|
|
1
|
+
{"version":3,"file":"TransactionListBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.tsx"],"sourcesContent":["import React from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport {\n Drawer,\n useGlobalCopyStore,\n useInsightsV2Store,\n useTransactionStore,\n} from '../../../common'\nimport type { Beat } from '../../../core'\nimport type { InsightsInstanceSlotData } from '../../../core/types/InsightsInstanceSlotData'\nimport { TransactionDetailsBlock } from '../TransactionDetailsBlock'\nimport { TransactionList } from '../../../transactions'\nimport { selectTransactionsByGuids } from '../../CommonUtils'\nimport { getDynamicCtaBasedOnTriggers } from '../util'\nimport { HelpBlock } from '../HelpBlock'\nimport { readHelpHeader, readSummary } from './layout'\nimport { TransactionListHelpHeader } from './TransactionListHelpHeader'\nimport { TransactionListSummaryCard } from './TransactionListSummaryCard'\n\nconst isStringArray = (value: unknown): value is string[] =>\n Array.isArray(value) && value.every((item) => typeof item === 'string')\n\n/**\n * The guids the drawer lists, from the first source that names them: the clicked CTA's own\n * `drilldown_data` (each drawer's data rides on the CTA that opens it), then the card-level\n * `drilldown_data`, then V1's `instance_slot_data`. The payload is untrusted, so a present but\n * malformed list fails closed (no rows, and a warning) rather than showing another source's rows; a\n * non-array would otherwise reach new Set() inside selectTransactionsByGuids and match per-character.\n */\nconst resolveTransactionGuids = (\n beat: Beat,\n ctaDrilldown: Record<string, unknown> | undefined,\n): string[] | undefined => {\n const drilldown = beat.insights_payload?.drilldown_data\n const slotData = (beat.insights_payload?.instance_slot_data ?? {}) as InsightsInstanceSlotData\n const [source, value]: [string, unknown] =\n ctaDrilldown && Object.hasOwn(ctaDrilldown, 'transaction_guids')\n ? ['cta.drilldown_data', ctaDrilldown.transaction_guids]\n : drilldown && Object.hasOwn(drilldown, 'transaction_guids')\n ? ['drilldown_data', drilldown.transaction_guids]\n : ['instance_slot_data', slotData.transaction_guids]\n\n if (value == null) return undefined\n if (isStringArray(value)) return value\n\n console.warn(\n `[TransactionListBlock] ${source}.transaction_guids is not a list of guids — listing no transactions.`,\n )\n return undefined\n}\n\nexport interface TransactionListBlockProps {\n beat: Beat\n}\n\n/**\n * Opens a date-grouped list of the transactions a beat points at. Tapping a row stacks\n * the Transaction Details drawer over the list.\n *\n * ActionBlockLayer owns the outer Drawer (title, close button, copy-loaded gate).\n */\nexport const TransactionListBlock = observer(function TransactionListBlock({\n beat,\n}: TransactionListBlockProps) {\n const { common: commonCopy, insights_feed: insightsCopy } = useGlobalCopyStore()\n const { actionDrawer, setActionContext } = useInsightsV2Store()\n const transactionStore = useTransactionStore()\n\n const [isDetailsOpen, setIsDetailsOpen] = React.useState(false)\n const [isHelpOpen, setIsHelpOpen] = React.useState(false)\n\n // The clicked CTA carries the drawer's own data (its guids, and the summary figures), so resolve\n // which CTA opened this drawer first. `readSummary` fails closed (no finite `amount` -> undefined),\n // so a plain list renders no card. A zero-state envelope, or one naming no transactions, has no\n // figures to head.\n const { primary_cta, secondary_cta, in_description_cta, is_zero_state, drilldown_data, title } =\n beat.insights_payload ?? {}\n const currentCta = getDynamicCtaBasedOnTriggers(\n actionDrawer,\n primary_cta,\n secondary_cta,\n in_description_cta,\n )\n\n const guids = resolveTransactionGuids(beat, currentCta?.drilldown_data)\n const transactions = selectTransactionsByGuids(transactionStore.detailedTransactions, guids)\n const summary = readSummary(currentCta)\n // Count comes from the CTA's `drilldown_data`; fall back to the named guid count so the pill never\n // flashes \"0 transactions\" if the payload omits it.\n const count = summary?.count ?? guids?.length ?? 0\n const showSummary = summary !== undefined && !is_zero_state && (guids?.length ?? 0) > 0\n const helpHeader = readHelpHeader(currentCta, drilldown_data)\n\n const handleRowClick = (guid: string) => {\n setActionContext({ transaction_guid: guid })\n setIsDetailsOpen(true)\n }\n\n const handleDetailsClose = () => {\n setIsDetailsOpen(false)\n // Clear only the key this nested drawer owns — same convention as TransactionHistoryBlock.\n // `setActionContext` merges, so an explicit `{}` would be a no-op; naming the key keeps the\n // outer drawer's own context intact.\n setActionContext({ transaction_guid: undefined })\n }\n\n return (\n <>\n {showSummary && (\n <TransactionListSummaryCard copy={insightsCopy.general} count={count} summary={summary} />\n )}\n {helpHeader && (\n <TransactionListHelpHeader\n descriptionHtml={helpHeader.descriptionHtml}\n learnMoreLabel={helpHeader.learnMore?.label}\n onLearnMore={() => setIsHelpOpen(true)}\n title={title ?? ''}\n />\n )}\n <TransactionList onClick={handleRowClick} transaction={transactions} />\n {helpHeader?.learnMore && (\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={isHelpOpen}\n onClose={() => setIsHelpOpen(false)}\n title={helpHeader.learnMore.label}\n >\n <HelpBlock beat={beat} />\n </Drawer>\n )}\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={isDetailsOpen}\n onClose={handleDetailsClose}\n title={insightsCopy.general.transaction_details_title}\n >\n <TransactionDetailsBlock beat={beat} />\n </Drawer>\n </>\n )\n})\n"],"mappings":";;;;;;;;;;;;;AAqBA,IAAM,IAAA,CAAiB,MACrB,MAAM,QAAQ,CAAK,KAAK,EAAM,MAAA,CAAO,MAAS,OAAO,KAAS,QAAQ,GASlE,IAAA,CACJ,GACA,MACyB;AACzB,QAAM,IAAY,EAAK,kBAAkB,gBACnC,IAAY,EAAK,kBAAkB,sBAAsB,CAAC,GAC1D,CAAC,GAAQ,CAAA,IACb,KAAgB,OAAO,OAAO,GAAc,mBAAmB,IAC3D,CAAC,sBAAsB,EAAa,iBAAiB,IACrD,KAAa,OAAO,OAAO,GAAW,mBAAmB,IACvD,CAAC,kBAAkB,EAAU,iBAAiB,IAC9C,CAAC,sBAAsB,EAAS,iBAAiB;AAEzD,MAAI,KAAS,MACb;AAAA,QAAI,EAAc,CAAK,EAAG,QAAO;AAEjC,YAAQ,KACN,0BAA0B,CAAA,sEAC5B;AAAA;AAEF,GAYa,KAAuB,EAAS,SAA8B,EACzE,MAAA,EAAA,GAC4B;AAC5B,QAAM,EAAE,QAAQ,GAAY,eAAe,EAAA,IAAiB,EAAmB,GACzE,EAAE,cAAA,GAAc,kBAAA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