@mx-cartographer/experiences 7.2.5-alpha.mm1 → 7.2.5-alpha.mm2

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.
@@ -1,5 +1,5 @@
1
1
  import { jsx as e, jsxs as v } from "react/jsx-runtime";
2
- import u, { useState as te, useEffect as oe } from "react";
2
+ import p, { useState as te, useEffect as oe } from "react";
3
3
  import { observer as G } from "mobx-react-lite";
4
4
  import Pe from "@mui/material/Button";
5
5
  import K from "@mui/material/Stack";
@@ -21,8 +21,8 @@ import { G as _e, a as Je, u as et, b as tt } from "./useCombineEvents-BUDIR1ba.
21
21
  import { B as Ce } from "./BeatApi-DhJpgCLz.mjs";
22
22
  import it from "@mui/material/Card";
23
23
  import ot from "@mui/material/CardActions";
24
- import rt from "@mui/material/CardContent";
25
- import lt from "@mui/material/CardHeader";
24
+ import lt from "@mui/material/CardContent";
25
+ import rt from "@mui/material/CardHeader";
26
26
  const fe = {
27
27
  featureVersion: "spendVsIncomeTrends"
28
28
  };
@@ -56,7 +56,7 @@ class nt {
56
56
  return this.copyObject.zero_state;
57
57
  }
58
58
  }
59
- const he = {
59
+ const Ee = {
60
60
  BillAmountNotStandard: "BillAmountNotStandard",
61
61
  CanadianUpcomingDeadlineAlert: "CanadianUpcomingDeadlineAlert",
62
62
  DuplicatePaymentV2: "DuplicatePaymentV2",
@@ -75,35 +75,35 @@ const he = {
75
75
  MonthlySpendToIncomeComparison: "MonthlySpendToIncomeComparison"
76
76
  }, M = window?.app?.clientConfig?.microwidget_instance_id || "", me = {
77
77
  INSIGHTS_MICRO_WIDGET: "/micro-insights-carousel"
78
- }, Te = (i) => `on${i}Click`, We = (i) => `on${i}View`, we = (i) => `on${i}ViewFirstTime`, Ee = (i) => i.replace(/([a-z])([A-Z])/g, "$1 $2"), at = () => Object.values(he).reduce(
78
+ }, Te = (i) => `on${i}Click`, We = (i) => `on${i}View`, we = (i) => `on${i}ViewFirstTime`, he = (i) => i.replace(/([a-z])([A-Z])/g, "$1 $2"), at = () => Object.values(Ee).reduce(
79
79
  (i, o) => ({
80
80
  ...i,
81
81
  [Te(o)]: {
82
82
  action: w.MICRO_BEAT_CLICKED,
83
83
  category: W.BEAT_INTERACTION,
84
- label: Ee(o),
84
+ label: he(o),
85
85
  value: M
86
86
  }
87
87
  }),
88
88
  {}
89
- ), ct = () => Object.values(he).reduce(
89
+ ), ct = () => Object.values(Ee).reduce(
90
90
  (i, o) => ({
91
91
  ...i,
92
92
  [We(o)]: {
93
93
  action: w.MICRO_BEAT_DISPLAYED,
94
94
  category: W.BEAT_INTERACTION,
95
- label: Ee(o),
95
+ label: he(o),
96
96
  value: M
97
97
  }
98
98
  }),
99
99
  {}
100
- ), st = () => Object.values(he).reduce(
100
+ ), st = () => Object.values(Ee).reduce(
101
101
  (i, o) => ({
102
102
  ...i,
103
103
  [we(o)]: {
104
104
  action: w.MICRO_BEAT_DISPLAYED_FIRST_TIME,
105
105
  category: W.BEAT_INTERACTION,
106
- label: Ee(o),
106
+ label: he(o),
107
107
  value: M
108
108
  }
109
109
  }),
@@ -123,7 +123,7 @@ const he = {
123
123
  ON_CAROUSEL_FORWARD_SWIPE: "onCarouselForwardSwipe",
124
124
  ON_NO_RELEVANT_INSIGHTS_CLICKED: "onNoRelevantInsightsClicked",
125
125
  ON_VIEW_MORE_CLICKED: "onViewMoreClicked"
126
- }, De = {
126
+ }, xe = {
127
127
  ON_VIEW_MORE_VIEWED: "onViewMoreCardView"
128
128
  }, w = {
129
129
  CONTROL_BACKWARD: "Control Backward",
@@ -191,7 +191,7 @@ const he = {
191
191
  label: T.VIEW_MORE,
192
192
  value: M
193
193
  },
194
- [De.ON_VIEW_MORE_VIEWED]: {
194
+ [xe.ON_VIEW_MORE_VIEWED]: {
195
195
  action: w.MICRO_BEAT_DISPLAYED,
196
196
  category: W.BEAT_INTERACTION,
197
197
  label: T.VIEW_MORE,
@@ -212,14 +212,14 @@ class dt {
212
212
  constructor() {
213
213
  de(this);
214
214
  }
215
- initialize = async (o, t, r) => {
216
- this.onAnalyticEvent = (n, l) => {
217
- Ie(n, l).then((a) => a).catch((a) => {
218
- throw a.status === 401 && r(), a;
215
+ initialize = async (o, t, l) => {
216
+ this.onAnalyticEvent = (n, r) => {
217
+ Ie(n, r).then((a) => a).catch((a) => {
218
+ throw a.status === 401 && l(), a;
219
219
  });
220
- }, this.onAnalyticPageView = (n, l) => {
221
- ye(n, l).then((a) => a).catch((a) => {
222
- throw a.status === 401 && r(), a;
220
+ }, this.onAnalyticPageView = (n, r) => {
221
+ ye(n, r).then((a) => a).catch((a) => {
222
+ throw a.status === 401 && l(), a;
223
223
  });
224
224
  }, this.beatApi = new Ce(o, t);
225
225
  };
@@ -230,7 +230,7 @@ class dt {
230
230
  this.beatApi.updateOffer(o);
231
231
  };
232
232
  }
233
- class ht {
233
+ class Et {
234
234
  copyStore;
235
235
  endpoint = "/";
236
236
  insightsMicroWidgetStore;
@@ -240,40 +240,40 @@ class ht {
240
240
  constructor() {
241
241
  this.copyStore = new nt(), this.insightsMicroWidgetStore = new dt(), de(this);
242
242
  }
243
- initialize = async (o, t, r) => {
244
- await this.copyStore.initialize(o, t), await this.insightsMicroWidgetStore.initialize(o, t, r);
243
+ initialize = async (o, t, l) => {
244
+ await this.copyStore.initialize(o, t), await this.insightsMicroWidgetStore.initialize(o, t, l);
245
245
  const n = await Je(o, t, "1.0.0", "Micro Insights Carousel");
246
246
  Oe(() => {
247
247
  this.session = n, this.isInitialized = !0;
248
248
  });
249
249
  };
250
250
  }
251
- const $ = u.createContext(null), Et = ({
251
+ const $ = p.createContext(null), ht = ({
252
252
  onEvent: i,
253
253
  onPageview: o,
254
254
  store: t,
255
- children: r
256
- }) => /* @__PURE__ */ e($.Provider, { value: { onEvent: i, onPageview: o, store: t, children: r }, children: r }), re = u.forwardRef(
255
+ children: l
256
+ }) => /* @__PURE__ */ e($.Provider, { value: { onEvent: i, onPageview: o, store: t, children: l }, children: l }), le = p.forwardRef(
257
257
  function({
258
258
  actionText: o,
259
259
  ariaLabel: t,
260
- backgroundColor: r,
260
+ backgroundColor: l,
261
261
  description: n,
262
- heightOverrides: l,
262
+ heightOverrides: r,
263
263
  icon: a,
264
264
  isActiveCard: d,
265
- isZeroState: p,
266
- onCardClick: _ = () => {
265
+ isZeroState: _,
266
+ onCardClick: E = () => {
267
267
  },
268
268
  showIcon: C,
269
269
  style: f = {},
270
270
  fontColors: h = {},
271
271
  title: m,
272
272
  variant: c,
273
- widthOverrides: E
273
+ widthOverrides: u
274
274
  }, g) {
275
- console.log("MicroInsightCard", { heightOverrides: l });
276
- const I = se(), [D, O] = u.useState(!1), { cardStyle: y, linkTextStyle: F } = f, z = c ? y : { border: "none", boxShadow: "none", ...y }, R = /* @__PURE__ */ e(
275
+ console.log("MicroInsightCard", { heightOverrides: r });
276
+ const I = se(), [x, O] = p.useState(!1), { cardStyle: y, linkTextStyle: F } = f, z = c ? y : { border: "none", boxShadow: "none", ...y }, R = /* @__PURE__ */ e(
277
277
  Ke,
278
278
  {
279
279
  className: "mx-micro-card-description",
@@ -284,8 +284,8 @@ const $ = u.createContext(null), Et = ({
284
284
  letterSpacing: 0.48,
285
285
  lineHeight: "20px",
286
286
  overflow: "hidden",
287
- pl: p ? 0 : 28,
288
- pr: p ? 0 : 8,
287
+ pl: _ ? 0 : 28,
288
+ pr: _ ? 0 : 8,
289
289
  WebkitBoxOrient: "vertical",
290
290
  WebkitLineClamp: 2,
291
291
  wordWrap: "break-word"
@@ -310,7 +310,7 @@ const $ = u.createContext(null), Et = ({
310
310
  role: "group",
311
311
  sx: {
312
312
  height: "100%",
313
- minWidth: E ? `${E}px` : "100%",
313
+ minWidth: u ? `${u}px` : "100%",
314
314
  fontFamily: I.typography.fontFamily
315
315
  },
316
316
  children: /* @__PURE__ */ e(
@@ -319,13 +319,13 @@ const $ = u.createContext(null), Et = ({
319
319
  "aria-hidden": !d,
320
320
  "aria-label": t,
321
321
  id: "divButton",
322
- onClick: () => _(),
322
+ onClick: () => E(),
323
323
  onKeyDown: () => O(!1),
324
324
  onKeyUp: () => O(!0),
325
325
  ref: g,
326
326
  role: "button",
327
327
  sx: {
328
- border: D ? "1px solid rgba(82, 138, 224, 0.8)" : void 0,
328
+ border: x ? "1px solid rgba(82, 138, 224, 0.8)" : void 0,
329
329
  borderRadius: "8px",
330
330
  height: "100%"
331
331
  },
@@ -338,9 +338,9 @@ const $ = u.createContext(null), Et = ({
338
338
  id: "MicroInsightCard",
339
339
  role: "group",
340
340
  sx: {
341
- backgroundColor: r,
341
+ backgroundColor: l,
342
342
  cursor: "pointer",
343
- height: l ? "100%" : 124,
343
+ height: r ? "100%" : 124,
344
344
  p: 16,
345
345
  ...z,
346
346
  "& .MuiCardHeader-avatar": {
@@ -358,16 +358,16 @@ const $ = u.createContext(null), Et = ({
358
358
  },
359
359
  children: [
360
360
  /* @__PURE__ */ e(
361
- lt,
361
+ rt,
362
362
  {
363
363
  avatar: C && a,
364
- subheader: p && R,
364
+ subheader: _ && R,
365
365
  sx: { color: h.headerColor, p: 0 },
366
366
  title: m,
367
367
  titleTypographyProps: { fontSize: 15, fontWeight: 600, variant: "h3" }
368
368
  }
369
369
  ),
370
- /* @__PURE__ */ e(rt, { sx: { p: 0 }, children: !p && R }),
370
+ /* @__PURE__ */ e(lt, { sx: { p: 0 }, children: !_ && R }),
371
371
  !!o && /* @__PURE__ */ e(
372
372
  ot,
373
373
  {
@@ -378,12 +378,12 @@ const $ = u.createContext(null), Et = ({
378
378
  children: /* @__PURE__ */ e(
379
379
  b,
380
380
  {
381
- sx: (x) => ({
382
- color: h.buttonColor ? h.buttonColor : x.palette.primary.main,
381
+ sx: (D) => ({
382
+ color: h.buttonColor ? h.buttonColor : D.palette.primary.main,
383
383
  fontSize: 14,
384
384
  fontWeight: "bold",
385
385
  px: 28,
386
- fontFamily: x.typography.fontFamily,
386
+ fontFamily: D.typography.fontFamily,
387
387
  ...F
388
388
  }),
389
389
  children: o
@@ -426,9 +426,9 @@ const $ = u.createContext(null), Et = ({
426
426
  color: i = "currentColor",
427
427
  height: o,
428
428
  size: t = 16,
429
- styles: r,
429
+ styles: l,
430
430
  viewBox: n = "0 0 16 16",
431
- width: l
431
+ width: r
432
432
  }) => /* @__PURE__ */ e(
433
433
  "svg",
434
434
  {
@@ -436,9 +436,9 @@ const $ = u.createContext(null), Et = ({
436
436
  className: "kyper-icon",
437
437
  focusable: !1,
438
438
  height: o || t,
439
- style: r,
439
+ style: l,
440
440
  viewBox: n,
441
- width: l || t,
441
+ width: r || t,
442
442
  xmlns: "http://www.w3.org/2000/svg",
443
443
  children: /* @__PURE__ */ e(
444
444
  "path",
@@ -450,16 +450,16 @@ const $ = u.createContext(null), Et = ({
450
450
  }
451
451
  ), mt = (i) => i ? i.data ? i.data.map((o) => {
452
452
  const t = {};
453
- return i.names?.map((r, n) => {
454
- t[r] = o[n];
453
+ return i.names?.map((l, n) => {
454
+ t[l] = o[n];
455
455
  }), t;
456
456
  }) : [] : [], gt = (i, o) => {
457
- const t = mt(i), r = t.length / 2, n = t.slice(0, r), l = t.slice(r);
458
- return !n.length || !l.length ? o.Color.Primary300 : n[0].amount > l[0].amount ? o.Color.Error300 : n[0].amount < l[0].amount ? o.Color.Success300 : o.Color.Primary300;
457
+ const t = mt(i), l = t.length / 2, n = t.slice(0, l), r = t.slice(l);
458
+ return !n.length || !r.length ? o.Color.Primary300 : n[0].amount > r[0].amount ? o.Color.Error300 : n[0].amount < r[0].amount ? o.Color.Success300 : o.Color.Primary300;
459
459
  }, Rt = ({ beat: i }) => {
460
460
  const o = Ae(), t = gt(i.data_series, o);
461
461
  return /* @__PURE__ */ e(ie, { name: "bar_chart", sx: { color: t } });
462
- }, xe = () => /* @__PURE__ */ v("svg", { fill: "none", height: "36", viewBox: "0 0 40 36", width: "40", xmlns: "http://www.w3.org/2000/svg", children: [
462
+ }, De = () => /* @__PURE__ */ v("svg", { fill: "none", height: "36", viewBox: "0 0 40 36", width: "40", xmlns: "http://www.w3.org/2000/svg", children: [
463
463
  /* @__PURE__ */ e(
464
464
  "path",
465
465
  {
@@ -1240,37 +1240,37 @@ const $ = u.createContext(null), Et = ({
1240
1240
  }
1241
1241
  )
1242
1242
  ] })
1243
- ] }), ve = ({ beat: i, clientColorScheme: o, color: t, type: r }) => {
1244
- const n = se(), l = o?.primary_300 ? o.primary_300 : n.palette.primary.main;
1245
- return r === 0 ? /* @__PURE__ */ e(ie, { fill: !0, name: "error", sx: { color: t || l } }) : r === 1 && i ? /* @__PURE__ */ e(ut, { beat: i }) : r === 2 && i ? /* @__PURE__ */ e(Ct, { beat: i }) : r === 3 && i ? /* @__PURE__ */ e(Rt, { beat: i }) : r === 5 && i ? /* @__PURE__ */ e(ie, { name: "campaign" }) : /* @__PURE__ */ e(
1243
+ ] }), ve = ({ beat: i, clientColorScheme: o, color: t, type: l }) => {
1244
+ const n = se(), r = o?.primary_300 ? o.primary_300 : n.palette.primary.main;
1245
+ return l === 0 ? /* @__PURE__ */ e(ie, { fill: !0, name: "error", sx: { color: t || r } }) : l === 1 && i ? /* @__PURE__ */ e(ut, { beat: i }) : l === 2 && i ? /* @__PURE__ */ e(Ct, { beat: i }) : l === 3 && i ? /* @__PURE__ */ e(Rt, { beat: i }) : l === 5 && i ? /* @__PURE__ */ e(ie, { name: "campaign" }) : /* @__PURE__ */ e(
1246
1246
  ie,
1247
1247
  {
1248
1248
  fill: !0,
1249
1249
  name: "info",
1250
1250
  sx: {
1251
- color: l
1251
+ color: r
1252
1252
  }
1253
1253
  }
1254
1254
  );
1255
1255
  }, k = () => {
1256
- const i = u.useContext($);
1256
+ const i = p.useContext($);
1257
1257
  if (!i)
1258
1258
  throw new Error("useCopyStore() must be used within the InsightsMicroWidgetDataProvider");
1259
1259
  return i.store.copyStore;
1260
1260
  }, It = () => {
1261
- const i = u.useContext($);
1261
+ const i = p.useContext($);
1262
1262
  if (!i?.store?.insightsMicroWidgetStore)
1263
1263
  throw new Error(
1264
1264
  "useInsightsMicroWidgetStore() must be used within the InsightsMicroWidgetDataProvider"
1265
1265
  );
1266
1266
  return i.store.insightsMicroWidgetStore;
1267
1267
  }, Y = () => {
1268
- const i = u.useContext($);
1268
+ const i = p.useContext($);
1269
1269
  if (!i)
1270
1270
  throw new Error("useEvent() must be used within the InsightsMicroWidgetDataProvider");
1271
1271
  return { onEvent: i.onEvent };
1272
1272
  }, Le = () => {
1273
- const i = u.useContext($);
1273
+ const i = p.useContext($);
1274
1274
  if (!i)
1275
1275
  throw new Error("usePageview() must be used within the InsightsMicroWidgetDataProvider");
1276
1276
  return { onPageview: i.onPageview };
@@ -1283,23 +1283,23 @@ const $ = u.createContext(null), Et = ({
1283
1283
  ariaLabel: i,
1284
1284
  backgroundColor: o,
1285
1285
  beat: t,
1286
- clientColorScheme: r,
1286
+ clientColorScheme: l,
1287
1287
  showCTAColocatedWithText: n = !0,
1288
- heightOverrides: l,
1288
+ heightOverrides: r,
1289
1289
  index: a,
1290
1290
  isActiveCard: d,
1291
- onCardClick: p,
1292
- posthog: _,
1291
+ onCardClick: _,
1292
+ posthog: E,
1293
1293
  showIcon: C,
1294
1294
  variant: f,
1295
1295
  widthOverrides: h
1296
1296
  }) => {
1297
- console.log("BeatCard", { heightOverrides: l });
1297
+ console.log("BeatCard", { heightOverrides: r });
1298
1298
  const { ref: m, inView: c } = Se({
1299
1299
  threshold: Ve
1300
- }), { cardsCopy: E } = k(), { onEvent: g } = Y(), { updateBeat: I, updateOffer: D } = It();
1300
+ }), { cardsCopy: u } = k(), { onEvent: g } = Y(), { updateBeat: I, updateOffer: x } = It();
1301
1301
  oe(() => {
1302
- c && (t.has_been_displayed ? g(We(t.template)) : (t.guid.startsWith("OFR") ? D({
1302
+ c && (t.has_been_displayed ? g(We(t.template)) : (t.guid.startsWith("OFR") ? x({
1303
1303
  ...t,
1304
1304
  has_been_displayed: !0
1305
1305
  }) : I({
@@ -1310,54 +1310,54 @@ const $ = u.createContext(null), Et = ({
1310
1310
  if (c && t)
1311
1311
  if (t.template === "MarketingOffer") {
1312
1312
  const y = t;
1313
- _?.capture("viewed_messaging_insight", {
1313
+ E?.capture("viewed_messaging_insight", {
1314
1314
  template: t.template,
1315
1315
  campaign_guid: y.campaign_guid,
1316
1316
  campaign_name: y.pulse_campaign_name
1317
1317
  });
1318
1318
  } else
1319
- _?.capture("viewed_insight", {
1319
+ E?.capture("viewed_insight", {
1320
1320
  beat_guid: t.guid,
1321
1321
  template: t.template,
1322
1322
  position: a
1323
1323
  });
1324
1324
  }, [t, a, c]);
1325
1325
  const O = () => {
1326
- if (p && p(t), g(Te(t.template)), t.template === "MarketingOffer") {
1326
+ if (_ && _(t), g(Te(t.template)), t.template === "MarketingOffer") {
1327
1327
  const y = t;
1328
- _?.capture("clicked_messaging_insight", {
1328
+ E?.capture("clicked_messaging_insight", {
1329
1329
  template: t.template,
1330
1330
  campaign_guid: y.campaign_guid,
1331
1331
  campaign_name: y.pulse_campaign_name
1332
1332
  });
1333
1333
  } else
1334
- _?.capture("clicked_insight", {
1334
+ E?.capture("clicked_insight", {
1335
1335
  beat_guid: t.guid,
1336
1336
  template: t.template,
1337
1337
  position: a
1338
1338
  });
1339
1339
  };
1340
1340
  return /* @__PURE__ */ e(
1341
- re,
1341
+ le,
1342
1342
  {
1343
- actionText: t.micro_call_to_action || E.micro_card_cta,
1343
+ actionText: t.micro_call_to_action || u.micro_card_cta,
1344
1344
  ariaLabel: i,
1345
1345
  backgroundColor: o,
1346
1346
  description: t?.html_micro_description && t?.html_micro_description.length > 0 ? t.html_micro_description : t.html_description,
1347
- fontColors: { buttonColor: r?.primary_300 },
1348
- heightOverrides: l,
1347
+ fontColors: { buttonColor: l?.primary_300 },
1348
+ heightOverrides: r,
1349
1349
  icon: ve && /* @__PURE__ */ e(
1350
1350
  ve,
1351
1351
  {
1352
1352
  beat: t,
1353
- clientColorScheme: r,
1353
+ clientColorScheme: l,
1354
1354
  color: t?.icon_color,
1355
1355
  type: t?.icon_type
1356
1356
  }
1357
1357
  ),
1358
1358
  isActiveCard: d,
1359
1359
  onCardClick: O,
1360
- posthog: _,
1360
+ posthog: E,
1361
1361
  ref: m,
1362
1362
  showCTAColocatedWithText: n,
1363
1363
  showIcon: C,
@@ -1370,14 +1370,14 @@ const $ = u.createContext(null), Et = ({
1370
1370
  clientColorScheme: i,
1371
1371
  currentBeatIndex: o,
1372
1372
  numBeats: t,
1373
- onNextClick: r,
1373
+ onNextClick: l,
1374
1374
  onPreviousClick: n,
1375
- scrollRightBoundary: l,
1375
+ scrollRightBoundary: r,
1376
1376
  scrollX: a,
1377
1377
  shouldApplyNewAnimation: d = !1,
1378
- visibleCardsCount: p = 1
1378
+ visibleCardsCount: _ = 1
1379
1379
  }) => {
1380
- const _ = ze(), { carouselCopy: C } = k(), f = Math.floor(a) > l || o - p + 1 === 0, h = a < 0 || t - 1 === o, m = _.palette.grey[500], c = i?.primary_300 ?? _.palette.primary.main;
1380
+ const E = ze(), { carouselCopy: C } = k(), f = Math.floor(a) > r || o - _ + 1 === 0, h = a < 0 || t - 1 === o, m = E.palette.grey[500], c = i?.primary_300 ?? E.palette.primary.main;
1381
1381
  return /* @__PURE__ */ v(
1382
1382
  K,
1383
1383
  {
@@ -1410,7 +1410,7 @@ const $ = u.createContext(null), Et = ({
1410
1410
  )
1411
1411
  }
1412
1412
  ),
1413
- Array.from({ length: t }).map((E, g) => {
1413
+ Array.from({ length: t }).map((u, g) => {
1414
1414
  const I = g === o;
1415
1415
  return /* @__PURE__ */ e(
1416
1416
  b,
@@ -1442,7 +1442,7 @@ const $ = u.createContext(null), Et = ({
1442
1442
  "aria-disabled": h,
1443
1443
  "aria-label": C.next_insight_cta_aria,
1444
1444
  disabled: h,
1445
- onClick: r,
1445
+ onClick: l,
1446
1446
  children: /* @__PURE__ */ e(
1447
1447
  Me,
1448
1448
  {
@@ -1460,13 +1460,13 @@ const $ = u.createContext(null), Et = ({
1460
1460
  analyticsMetadata: i,
1461
1461
  allowSingleCardPeeking: o = !1,
1462
1462
  beats: t = [],
1463
- clientColorScheme: r,
1463
+ clientColorScheme: l,
1464
1464
  showCTAColocatedWithText: n,
1465
- heightOverrides: l,
1465
+ heightOverrides: r,
1466
1466
  onCardClick: a,
1467
1467
  posthog: d,
1468
- shouldApplyNewAnimation: p = !1,
1469
- showCarouselControls: _,
1468
+ shouldApplyNewAnimation: _ = !1,
1469
+ showCarouselControls: E,
1470
1470
  showIcon: C,
1471
1471
  showWithMargin: f = !0,
1472
1472
  variant: h,
@@ -1474,20 +1474,20 @@ const $ = u.createContext(null), Et = ({
1474
1474
  visibleCardsCount: c = 1
1475
1475
  // Default to 1 card visible
1476
1476
  }) => {
1477
- console.log("MicroBeatCarousel", { heightOverrides: l });
1478
- const E = u.useRef(null), g = u.useRef(null), [I, D] = u.useState(0), [O, y] = u.useState(null), [F, z] = u.useState(null), [R, x] = u.useState(null), [U, B] = u.useState(p), { carouselCopy: j } = k(), { onEvent: Z } = Y();
1479
- u.useEffect(() => {
1480
- if (E.current && !o) {
1481
- const s = E.current.offsetWidth, A = 8;
1477
+ console.log("MicroBeatCarousel", { heightOverrides: r });
1478
+ const u = p.useRef(null), g = p.useRef(null), [I, x] = p.useState(0), [O, y] = p.useState(null), [F, z] = p.useState(null), [R, D] = p.useState(null), [U, B] = p.useState(_), { carouselCopy: j } = k(), { onEvent: Z } = Y();
1479
+ p.useEffect(() => {
1480
+ if (u.current && !o) {
1481
+ const s = u.current.offsetWidth, A = 8;
1482
1482
  let N;
1483
1483
  if (c > 1) {
1484
1484
  const J = (s - (c - 1) * A) / c / 3;
1485
1485
  N = (s - J - (c - 1) * A) / c;
1486
1486
  } else
1487
1487
  N = s;
1488
- x(N);
1488
+ D(N);
1489
1489
  }
1490
- }, [c, E.current?.offsetWidth]), u.useEffect(() => {
1490
+ }, [c, u.current?.offsetWidth]), p.useEffect(() => {
1491
1491
  const s = g.current?.offsetWidth;
1492
1492
  if (typeof s == "number" && o) {
1493
1493
  const A = (P) => {
@@ -1501,10 +1501,10 @@ const $ = u.createContext(null), Et = ({
1501
1501
  ].find((ce) => P <= ce.maxWidth);
1502
1502
  return ee ? ee.cardWidth : 750;
1503
1503
  };
1504
- x(A(s));
1504
+ D(A(s));
1505
1505
  const N = () => {
1506
1506
  const P = g.current?.offsetWidth;
1507
- typeof P == "number" && x(A(P));
1507
+ typeof P == "number" && D(A(P));
1508
1508
  };
1509
1509
  return window.addEventListener("resize", N), () => {
1510
1510
  window.removeEventListener("resize", N);
@@ -1512,19 +1512,19 @@ const $ = u.createContext(null), Et = ({
1512
1512
  }
1513
1513
  }, [o, g]);
1514
1514
  const X = () => {
1515
- Z(S.ON_CAROUSEL_FORWARD_CLICK, i), E.current && R && E.current.scrollTo({
1515
+ Z(S.ON_CAROUSEL_FORWARD_CLICK, i), u.current && R && u.current.scrollTo({
1516
1516
  left: I + R + 8,
1517
1517
  top: 0,
1518
1518
  behavior: "smooth"
1519
1519
  });
1520
- }, le = () => {
1521
- Z(S.ON_CAROUSEL_BACK_CLICK, i), E.current && R && E.current.scrollTo({
1520
+ }, re = () => {
1521
+ Z(S.ON_CAROUSEL_BACK_CLICK, i), u.current && R && u.current.scrollTo({
1522
1522
  left: Math.max(0, I - (R + 8)),
1523
1523
  top: 0,
1524
1524
  behavior: "smooth"
1525
1525
  });
1526
1526
  }, ne = () => {
1527
- E.current && D(E.current.scrollLeft);
1527
+ u.current && x(u.current.scrollLeft);
1528
1528
  }, Q = () => {
1529
1529
  if (!F || !O) return;
1530
1530
  F - O > yt ? Z(S.ON_CAROUSEL_FORWARD_SWIPE, i) : Z(S.ON_CAROUSEL_BACK_SWIPE, i);
@@ -1533,13 +1533,13 @@ const $ = u.createContext(null), Et = ({
1533
1533
  }, L = (s) => {
1534
1534
  y(null), z(s.targetTouches[0].clientX);
1535
1535
  }, ue = {
1536
- clientColorScheme: r,
1536
+ clientColorScheme: l,
1537
1537
  showCTAColocatedWithText: n,
1538
- heightOverrides: l,
1538
+ heightOverrides: r,
1539
1539
  posthog: d,
1540
1540
  showIcon: C,
1541
1541
  variant: h
1542
- }, ae = R ? Math.round(I / (R + 8)) : 0, Fe = E.current ? E.current.scrollWidth - E.current.offsetWidth : 0;
1542
+ }, ae = R ? Math.round(I / (R + 8)) : 0, Fe = u.current ? u.current.scrollWidth - u.current.offsetWidth : 0;
1543
1543
  return /* @__PURE__ */ v(
1544
1544
  K,
1545
1545
  {
@@ -1551,7 +1551,7 @@ const $ = u.createContext(null), Et = ({
1551
1551
  sx: {
1552
1552
  alignItems: "center",
1553
1553
  boxSizing: "border-box",
1554
- height: l,
1554
+ height: r,
1555
1555
  width: m || "100%"
1556
1556
  },
1557
1557
  children: [
@@ -1563,10 +1563,13 @@ const $ = u.createContext(null), Et = ({
1563
1563
  onTouchEnd: Q,
1564
1564
  onTouchMove: q,
1565
1565
  onTouchStart: L,
1566
- ref: E,
1566
+ ref: u,
1567
1567
  sx: {
1568
1568
  alignItems: "center",
1569
- height: l && "100%",
1569
+ height: (
1570
+ // eslint-disable-next-line no-nested-ternary
1571
+ r && E ? "calc(100% - 48px)" : r ? "100%" : void 0
1572
+ ),
1570
1573
  gap: 8,
1571
1574
  listStyleType: "none",
1572
1575
  m: 0,
@@ -1614,14 +1617,14 @@ const $ = u.createContext(null), Et = ({
1614
1617
  ]
1615
1618
  }
1616
1619
  ),
1617
- _ && /* @__PURE__ */ e(
1620
+ E && /* @__PURE__ */ e(
1618
1621
  Mt,
1619
1622
  {
1620
- clientColorScheme: r,
1623
+ clientColorScheme: l,
1621
1624
  currentBeatIndex: ae + c - 1,
1622
1625
  numBeats: t.length + 1,
1623
1626
  onNextClick: X,
1624
- onPreviousClick: le,
1627
+ onPreviousClick: re,
1625
1628
  scrollRightBoundary: Fe,
1626
1629
  scrollX: I,
1627
1630
  shouldApplyNewAnimation: U,
@@ -1635,13 +1638,13 @@ const $ = u.createContext(null), Et = ({
1635
1638
  analyticsMetadata: i,
1636
1639
  clientColorScheme: o,
1637
1640
  onCardClick: t,
1638
- posthog: r,
1641
+ posthog: l,
1639
1642
  widthOverrides: n
1640
1643
  }) => {
1641
- const { carouselCopy: l } = k(), { onEvent: a } = Y(), d = () => {
1642
- a && (a(S.ON_VIEW_MORE_CLICKED, i), t(), r?.capture("clicked_view_more"));
1644
+ const { carouselCopy: r } = k(), { onEvent: a } = Y(), d = () => {
1645
+ a && (a(S.ON_VIEW_MORE_CLICKED, i), t(), l?.capture("clicked_view_more"));
1643
1646
  };
1644
- return l ? /* @__PURE__ */ v(
1647
+ return r ? /* @__PURE__ */ v(
1645
1648
  K,
1646
1649
  {
1647
1650
  alignItems: "center",
@@ -1663,7 +1666,7 @@ const $ = u.createContext(null), Et = ({
1663
1666
  lineHeight: "24px"
1664
1667
  },
1665
1668
  variant: "h3",
1666
- children: l.carousel_title
1669
+ children: r.carousel_title
1667
1670
  }
1668
1671
  ),
1669
1672
  /* @__PURE__ */ e(
@@ -1676,7 +1679,7 @@ const $ = u.createContext(null), Et = ({
1676
1679
  color: o?.primary_300
1677
1680
  },
1678
1681
  variant: "text",
1679
- children: l.view_all_insights_in_full_feed_cta_aria
1682
+ children: r.view_all_insights_in_full_feed_cta_aria
1680
1683
  }
1681
1684
  )
1682
1685
  ]
@@ -1688,12 +1691,12 @@ const $ = u.createContext(null), Et = ({
1688
1691
  children: t
1689
1692
  }) => {
1690
1693
  console.log("MicroWidgetContainer", { heightOverrides: i });
1691
- const { carouselCopy: r } = k();
1694
+ const { carouselCopy: l } = k();
1692
1695
  return /* @__PURE__ */ e(
1693
1696
  b,
1694
1697
  {
1695
1698
  id: "MicroWidgetContainer",
1696
- "aria-label": r?.carousel_title,
1699
+ "aria-label": l?.carousel_title,
1697
1700
  "aria-roledescription": "carousel",
1698
1701
  role: "group",
1699
1702
  sx: {
@@ -1709,35 +1712,35 @@ const $ = u.createContext(null), Et = ({
1709
1712
  ariaLabel: i,
1710
1713
  carouselSize: o,
1711
1714
  clientColorScheme: t,
1712
- heightOverrides: r,
1715
+ heightOverrides: l,
1713
1716
  onCardClick: n,
1714
- posthog: l,
1717
+ posthog: r,
1715
1718
  showIcon: a,
1716
1719
  showWithMargin: d,
1717
- variant: p,
1718
- widthOverrides: _
1720
+ variant: _,
1721
+ widthOverrides: E
1719
1722
  }) => {
1720
1723
  const { cardsCopy: C } = k(), { onEvent: f } = Y(), { onPageview: h } = Le();
1721
- u.useEffect(() => {
1724
+ p.useEffect(() => {
1722
1725
  h(H.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS);
1723
1726
  }, []);
1724
1727
  const m = () => {
1725
- n && n(), f(S.ON_NO_RELEVANT_INSIGHTS_CLICKED), l?.capture("clicked_insight", {
1728
+ n && n(), f(S.ON_NO_RELEVANT_INSIGHTS_CLICKED), r?.capture("clicked_insight", {
1726
1729
  template: "no_relevant_insights"
1727
1730
  });
1728
1731
  };
1729
1732
  return /* @__PURE__ */ e(
1730
- re,
1733
+ le,
1731
1734
  {
1732
1735
  actionText: C.micro_card_cta,
1733
1736
  ariaLabel: i,
1734
1737
  description: C.no_relevant_insights_card_description,
1735
1738
  fontColors: { buttonColor: t?.primary_300 },
1736
- heightOverrides: r,
1737
- icon: /* @__PURE__ */ e(xe, {}),
1739
+ heightOverrides: l,
1740
+ icon: /* @__PURE__ */ e(De, {}),
1738
1741
  isZeroState: !0,
1739
1742
  onCardClick: m,
1740
- posthog: l,
1743
+ posthog: r,
1741
1744
  showIcon: a,
1742
1745
  style: {
1743
1746
  cardStyle: {
@@ -1755,35 +1758,35 @@ const $ = u.createContext(null), Et = ({
1755
1758
  }
1756
1759
  },
1757
1760
  title: C.no_relevant_insights_card_title,
1758
- variant: p,
1759
- widthOverrides: _
1761
+ variant: _,
1762
+ widthOverrides: E
1760
1763
  }
1761
1764
  );
1762
- }, li = G(He), ke = ({
1765
+ }, ri = G(He), ke = ({
1763
1766
  ariaLabel: i,
1764
1767
  carouselSize: o,
1765
1768
  heightOverrides: t,
1766
- onCardClick: r,
1769
+ onCardClick: l,
1767
1770
  posthog: n,
1768
- showIcon: l,
1771
+ showIcon: r,
1769
1772
  showWithMargin: a,
1770
1773
  variant: d,
1771
- widthOverrides: p
1774
+ widthOverrides: _
1772
1775
  }) => {
1773
- const { onPageview: _ } = Le(), { zeroStateCopy: C } = k();
1774
- return u.useEffect(() => {
1775
- _(H.MICRO_WIDGET_CAROUSEL_ZERO_STATE);
1776
+ const { onPageview: E } = Le(), { zeroStateCopy: C } = k();
1777
+ return p.useEffect(() => {
1778
+ E(H.MICRO_WIDGET_CAROUSEL_ZERO_STATE);
1776
1779
  }, []), /* @__PURE__ */ e(
1777
- re,
1780
+ le,
1778
1781
  {
1779
1782
  ariaLabel: i,
1780
1783
  description: C.carousel_zero_state_description,
1781
1784
  heightOverrides: t,
1782
- icon: /* @__PURE__ */ e(xe, {}),
1785
+ icon: /* @__PURE__ */ e(De, {}),
1783
1786
  isZeroState: !0,
1784
- onCardClick: r,
1787
+ onCardClick: l,
1785
1788
  posthog: n,
1786
- showIcon: l,
1789
+ showIcon: r,
1787
1790
  style: {
1788
1791
  cardStyle: {
1789
1792
  card: {
@@ -1798,7 +1801,7 @@ const $ = u.createContext(null), Et = ({
1798
1801
  },
1799
1802
  title: C.carousel_zero_state_title,
1800
1803
  variant: d,
1801
- widthOverrides: p
1804
+ widthOverrides: _
1802
1805
  }
1803
1806
  );
1804
1807
  }, ni = G(ke), wt = () => /* @__PURE__ */ e(
@@ -1813,20 +1816,20 @@ const $ = u.createContext(null), Et = ({
1813
1816
  },
1814
1817
  children: /* @__PURE__ */ e(qe, {})
1815
1818
  }
1816
- ), V = new ht(), Dt = ({
1819
+ ), V = new Et(), xt = ({
1817
1820
  allowSingleCardPeeking: i,
1818
1821
  areBeatsLoading: o,
1819
1822
  beats: t = [],
1820
1823
  // This also determines the length of the carousel controls (beat.length + 1)
1821
- clientColorScheme: r,
1824
+ clientColorScheme: l,
1822
1825
  // Allows certain icons, view all and read more button to reflect the clients color scheme. Currently only supports primary_300
1823
1826
  showCTAColocatedWithText: n = !0,
1824
- endpoint: l = "/",
1827
+ endpoint: r = "/",
1825
1828
  heightOverrides: a,
1826
1829
  logOutUser: d,
1827
- onCardClick: p = () => {
1830
+ onCardClick: _ = () => {
1828
1831
  },
1829
- onEvent: _ = () => {
1832
+ onEvent: E = () => {
1830
1833
  },
1831
1834
  onPageview: C = () => {
1832
1835
  },
@@ -1834,10 +1837,10 @@ const $ = u.createContext(null), Et = ({
1834
1837
  shouldApplyNewAnimation: h = !1,
1835
1838
  showBorder: m = !0,
1836
1839
  showCarouselControls: c,
1837
- showHeader: E,
1840
+ showHeader: u,
1838
1841
  showIcon: g,
1839
1842
  showWithMargin: I = !0,
1840
- token: D = "",
1843
+ token: x = "",
1841
1844
  useDarkMode: O,
1842
1845
  userHasFullInsightFeedBeats: y,
1843
1846
  variant: F,
@@ -1845,37 +1848,37 @@ const $ = u.createContext(null), Et = ({
1845
1848
  widthOverrides: R
1846
1849
  }) => {
1847
1850
  console.log("InsightsMicroWidget", { heightOverrides: a });
1848
- const [x, U] = te("STANDARD"), [B, j] = te(!1), [Z, X] = te(!1), le = et([_], V), ne = tt([C], V);
1849
- u.useEffect(() => {
1850
- !V.isInitialized && !Z && (V.initialize(l, D, d).catch(() => X(!1)), X(!0));
1851
- }, [l, D, d, V.isInitialized, Z]), u.useEffect(() => {
1851
+ const [D, U] = te("STANDARD"), [B, j] = te(!1), [Z, X] = te(!1), re = et([E], V), ne = tt([C], V);
1852
+ p.useEffect(() => {
1853
+ !V.isInitialized && !Z && (V.initialize(r, x, d).catch(() => X(!1)), X(!0));
1854
+ }, [r, x, d, V.isInitialized, Z]), p.useEffect(() => {
1852
1855
  const L = window.innerHeight;
1853
1856
  L < 180 ? U("STANDARD") : L >= 180 && L < 200 ? U("LARGE") : L >= 200 && L < 248 ? U("XLARGE") : L >= 248 && U("XXLARGE");
1854
- }, [window.innerHeight]), u.useEffect(() => {
1857
+ }, [window.innerHeight]), p.useEffect(() => {
1855
1858
  j(!o && V.isInitialized);
1856
1859
  }, [o, V.isInitialized]);
1857
1860
  const Q = {
1858
1861
  showCTAColocatedWithText: n,
1859
1862
  heightOverrides: a,
1860
- onCardClick: p,
1863
+ onCardClick: _,
1861
1864
  posthog: f,
1862
1865
  showIcon: g,
1863
1866
  showWithMargin: I,
1864
1867
  useDarkMode: O,
1865
1868
  widthOverrides: R
1866
1869
  }, q = {
1867
- carouselSize: x,
1870
+ carouselSize: D,
1868
1871
  variant: F,
1869
1872
  ...Q
1870
1873
  };
1871
- return /* @__PURE__ */ e(Et, { onEvent: le, onPageview: ne, store: V, children: /* @__PURE__ */ v(Wt, { heightOverrides: a, widthOverrides: R, children: [
1874
+ return /* @__PURE__ */ e(ht, { onEvent: re, onPageview: ne, store: V, children: /* @__PURE__ */ v(Wt, { heightOverrides: a, widthOverrides: R, children: [
1872
1875
  !B && /* @__PURE__ */ e(wt, {}),
1873
- B && E && /* @__PURE__ */ e(
1876
+ B && u && /* @__PURE__ */ e(
1874
1877
  Tt,
1875
1878
  {
1876
1879
  analyticsMetadata: fe,
1877
- clientColorScheme: r,
1878
- onCardClick: p,
1880
+ clientColorScheme: l,
1881
+ onCardClick: _,
1879
1882
  posthog: f,
1880
1883
  widthOverrides: R
1881
1884
  }
@@ -1886,7 +1889,7 @@ const $ = u.createContext(null), Et = ({
1886
1889
  allowSingleCardPeeking: i,
1887
1890
  analyticsMetadata: fe,
1888
1891
  beats: t,
1889
- clientColorScheme: r,
1892
+ clientColorScheme: l,
1890
1893
  shouldApplyNewAnimation: h,
1891
1894
  showCarouselControls: c,
1892
1895
  variant: m ? F : void 0,
@@ -1894,66 +1897,66 @@ const $ = u.createContext(null), Et = ({
1894
1897
  ...Q
1895
1898
  }
1896
1899
  ),
1897
- B && !t.length && y && /* @__PURE__ */ e(He, { clientColorScheme: r, ...q }),
1900
+ B && !t.length && y && /* @__PURE__ */ e(He, { clientColorScheme: l, ...q }),
1898
1901
  B && !t.length && !y && /* @__PURE__ */ e(ke, { ...q })
1899
1902
  ] }) });
1900
- }, ai = G(Dt), xt = ({
1903
+ }, ai = G(xt), Dt = ({
1901
1904
  isActiveCard: i,
1902
1905
  ariaLabel: o,
1903
1906
  clientColorScheme: t,
1904
- heightOverrides: r,
1907
+ heightOverrides: l,
1905
1908
  onCardClick: n,
1906
- posthog: l,
1909
+ posthog: r,
1907
1910
  showIcon: a,
1908
1911
  variant: d,
1909
- widthOverrides: p
1912
+ widthOverrides: _
1910
1913
  }) => {
1911
- const _ = se(), { ref: C, inView: f } = Se({
1914
+ const E = se(), { ref: C, inView: f } = Se({
1912
1915
  threshold: Ve
1913
1916
  }), { cardsCopy: h } = k(), { onEvent: m } = Y();
1914
1917
  oe(() => {
1915
- f && (m(De.ON_VIEW_MORE_VIEWED), l?.capture("viewed_insight", {
1918
+ f && (m(xe.ON_VIEW_MORE_VIEWED), r?.capture("viewed_insight", {
1916
1919
  template: "view_more_card"
1917
1920
  }));
1918
1921
  }, [f]);
1919
1922
  const c = () => {
1920
- n && n(), m(S.ON_VIEW_MORE_CLICKED), l?.capture("clicked_insight", {
1923
+ n && n(), m(S.ON_VIEW_MORE_CLICKED), r?.capture("clicked_insight", {
1921
1924
  template: "view_more_card"
1922
1925
  });
1923
1926
  };
1924
1927
  return /* @__PURE__ */ e(
1925
- re,
1928
+ le,
1926
1929
  {
1927
1930
  actionText: h.micro_card_cta,
1928
1931
  ariaLabel: o,
1929
1932
  description: h.view_more_card_description,
1930
1933
  fontColors: { buttonColor: t?.primary_300 },
1931
- heightOverrides: r,
1932
- icon: /* @__PURE__ */ e(ft, { color: t?.primary_300 ?? _.palette.primary.main }),
1934
+ heightOverrides: l,
1935
+ icon: /* @__PURE__ */ e(ft, { color: t?.primary_300 ?? E.palette.primary.main }),
1933
1936
  isActiveCard: i,
1934
1937
  onCardClick: c,
1935
- posthog: l,
1938
+ posthog: r,
1936
1939
  ref: C,
1937
1940
  showIcon: a,
1938
1941
  title: h.view_more_card_title,
1939
1942
  variant: d,
1940
- widthOverrides: p
1943
+ widthOverrides: _
1941
1944
  }
1942
1945
  );
1943
- }, Lt = G(xt);
1946
+ }, Lt = G(Dt);
1944
1947
  export {
1945
- ht as A,
1948
+ Et as A,
1946
1949
  vt as B,
1947
1950
  Tt as C,
1948
- Et as I,
1951
+ ht as I,
1949
1952
  At as M,
1950
- li as N,
1953
+ ri as N,
1951
1954
  fe as T,
1952
1955
  Lt as V,
1953
1956
  ni as Z,
1954
- re as a,
1957
+ le as a,
1955
1958
  ai as b,
1956
1959
  ft as c,
1957
1960
  Rt as d,
1958
- xe as e
1961
+ De as e
1959
1962
  };
@@ -1,4 +1,4 @@
1
- import { A as s, B as e, C as o, c as t, b as i, I as d, M as n, a as C, d as c, N as I, V as M, Z as g, e as h } from "../ViewMoreMicroCard-C5g-Jnyd.mjs";
1
+ import { A as s, B as e, C as o, c as t, b as i, I as d, M as n, a as C, d as c, N as I, V as M, Z as g, e as h } from "../ViewMoreMicroCard-vWvKWBNw.mjs";
2
2
  export {
3
3
  s as AppStore,
4
4
  e as BeatCard,
@@ -19,7 +19,7 @@ import { DataGridPro as mt } from "@mui/x-data-grid-pro";
19
19
  import { C as pt } from "../CurrencyText-kyC1aseI.mjs";
20
20
  import { b as Ct } from "../Localization-2MODESHW.mjs";
21
21
  import { H as Ie } from "../HeaderCell-DjuifqHJ.mjs";
22
- import { T as M, b as ft } from "../ViewMoreMicroCard-C5g-Jnyd.mjs";
22
+ import { T as M, b as ft } from "../ViewMoreMicroCard-vWvKWBNw.mjs";
23
23
  import { A as _, W as ke } from "../WidgetContainer-C88Ecu2W.mjs";
24
24
  import { c as Tt } from "../Category-CevNQ03n.mjs";
25
25
  import { a as Ne, T as He } from "../TransactionDetails-BWffqew4.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "7.2.5-alpha.mm1",
3
+ "version": "7.2.5-alpha.mm2",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",