@mx-cartographer/experiences 9.0.17-alpha.al0 → 9.0.17

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,41 +1,41 @@
1
- import { jsx as o, jsxs as w, Fragment as Te } from "react/jsx-runtime";
2
- import I, { useEffect as re, useState as ie } from "react";
3
- import { observer as U } from "mobx-react-lite";
1
+ import { jsx as o, jsxs as N, Fragment as we } from "react/jsx-runtime";
2
+ import E, { useEffect as le, useState as ce } from "react";
3
+ import { observer as z } from "mobx-react-lite";
4
4
  import k from "@mui/material/Stack";
5
- import ke from "@mui/material/Button";
6
- import { CategoryIcon as Ue, MerchantLogo as ze, InstitutionLogo as Ke, P as pe, Text as me, H3 as Fe } from "@mxenabled/mxui";
7
- import { Close as He, ChevronLeft as $e, ChevronRight as Re } from "@mxenabled/mx-icons";
8
- import { L as je } from "./Loader-CxeBwuPG.mjs";
9
- import ae from "@mui/material/Box";
10
- import ue from "@mui/material/IconButton";
5
+ import He from "@mui/material/Button";
6
+ import { CategoryIcon as $e, MerchantLogo as je, InstitutionLogo as Ye, P as he, Text as ge, H3 as Xe } from "@mxenabled/mxui";
7
+ import { Close as Ze, ChevronLeft as Qe, ChevronRight as Ne } from "@mxenabled/mx-icons";
8
+ import { L as qe } from "./Loader-CxeBwuPG.mjs";
9
+ import de from "@mui/material/Box";
10
+ import Ie from "@mui/material/IconButton";
11
11
  import { useTheme as P, alpha as s } from "@mui/material/styles";
12
- import { useInView as Oe } from "react-intersection-observer";
12
+ import { useInView as Me } from "react-intersection-observer";
13
13
  import { B as c } from "./BeatMaterialIcon-1KOfRZrA.mjs";
14
- import { C as Ye } from "./Category-DEKZGLYe.mjs";
15
- import { b as Xe } from "./Localization-DnoVyBNK.mjs";
16
- import Ze from "@mui/material/CircularProgress";
17
- import { makeAutoObservable as se, runInAction as We } from "mobx";
18
- import { a as Qe, u as qe, b as Je } from "./Analytics-CkYXKvco.mjs";
19
- import { G as Ce, B as he } from "./GlobalCopyApi-wcnDUzMV.mjs";
20
- import { u as et } from "./useWidgetLoadTimer-B0tB-yzL.mjs";
21
- import { Card as tt, CardActionArea as ot, Box as nt, IconButton as it, Stack as F, Button as ge } from "@mui/material";
22
- class rt {
23
- copyApi = new Ce("/", "");
14
+ import { C as Je } from "./Category-DEKZGLYe.mjs";
15
+ import { b as et } from "./Localization-DnoVyBNK.mjs";
16
+ import tt from "@mui/material/CircularProgress";
17
+ import { makeAutoObservable as _e, runInAction as ve } from "mobx";
18
+ import { a as ot, u as nt, b as it } from "./Analytics-CkYXKvco.mjs";
19
+ import { G as Ee, B as ye } from "./GlobalCopyApi-wcnDUzMV.mjs";
20
+ import { u as rt } from "./useWidgetLoadTimer-B0tB-yzL.mjs";
21
+ import { Card as at, CardActionArea as st, Box as ct, IconButton as lt, Stack as K, Button as fe } from "@mui/material";
22
+ class dt {
23
+ copyApi = new Ee("/", "");
24
24
  copyObject = {};
25
25
  namespace = "experiences";
26
26
  translationKey = "micro_insights";
27
27
  constructor() {
28
- se(this);
28
+ _e(this);
29
29
  }
30
30
  // NOTE: Not sure if this is special case, but other stores have this deprecation todo
31
31
  // DEPRECATED: Initialize api in constructor and use loadCopy instead
32
32
  // TODO: Remove this function
33
33
  initialize = async (e, n) => {
34
- this.copyApi = new Ce(e, n), await this.loadCopy();
34
+ this.copyApi = new Ee(e, n), await this.loadCopy();
35
35
  };
36
36
  loadCopy = async () => {
37
37
  const e = await this.copyApi.getGlobalCopy(this.namespace, this.translationKey);
38
- We(() => {
38
+ ve(() => {
39
39
  this.copyObject = e[this.translationKey];
40
40
  });
41
41
  };
@@ -49,7 +49,7 @@ class rt {
49
49
  return this.copyObject.zero_state;
50
50
  }
51
51
  }
52
- const ce = {
52
+ const pe = {
53
53
  BillAmountNotStandard: "BillAmountNotStandard",
54
54
  CanadianUpcomingDeadlineAlert: "CanadianUpcomingDeadlineAlert",
55
55
  DuplicatePaymentV2: "DuplicatePaymentV2",
@@ -66,42 +66,42 @@ const ce = {
66
66
  WeeklyNewMerchantsV2: "WeeklyNewMerchantsV2",
67
67
  MonthlySpendComparison: "MonthlySpendComparison",
68
68
  MonthlySpendToIncomeComparison: "MonthlySpendToIncomeComparison"
69
- }, O = window?.app?.clientConfig?.microwidget_instance_id || "", Ie = {
69
+ }, O = window?.app?.clientConfig?.microwidget_instance_id || "", Ae = {
70
70
  INSIGHTS_MICRO_WIDGET: "/micro-insights-carousel"
71
- }, Ne = (t) => `on${t}Click`, we = (t) => `on${t}View`, Me = (t) => `on${t}ViewFirstTime`, le = (t) => t.replace(/([a-z])([A-Z])/g, "$1 $2"), at = () => Object.values(ce).reduce(
71
+ }, be = (t) => `on${t}Click`, Le = (t) => `on${t}View`, xe = (t) => `on${t}ViewFirstTime`, me = (t) => t.replace(/([a-z])([A-Z])/g, "$1 $2"), _t = () => Object.values(pe).reduce(
72
72
  (t, e) => ({
73
73
  ...t,
74
- [Ne(e)]: {
75
- action: v.MICRO_BEAT_CLICKED,
74
+ [be(e)]: {
75
+ action: L.MICRO_BEAT_CLICKED,
76
76
  category: b.BEAT_INTERACTION,
77
- label: le(e),
77
+ label: me(e),
78
78
  value: O
79
79
  }
80
80
  }),
81
81
  {}
82
- ), st = () => Object.values(ce).reduce(
82
+ ), pt = () => Object.values(pe).reduce(
83
83
  (t, e) => ({
84
84
  ...t,
85
- [we(e)]: {
86
- action: v.MICRO_BEAT_DISPLAYED,
85
+ [Le(e)]: {
86
+ action: L.MICRO_BEAT_DISPLAYED,
87
87
  category: b.BEAT_INTERACTION,
88
- label: le(e),
88
+ label: me(e),
89
89
  value: O
90
90
  }
91
91
  }),
92
92
  {}
93
- ), ct = () => Object.values(ce).reduce(
93
+ ), mt = () => Object.values(pe).reduce(
94
94
  (t, e) => ({
95
95
  ...t,
96
- [Me(e)]: {
97
- action: v.MICRO_BEAT_DISPLAYED_FIRST_TIME,
96
+ [xe(e)]: {
97
+ action: L.MICRO_BEAT_DISPLAYED_FIRST_TIME,
98
98
  category: b.BEAT_INTERACTION,
99
- label: le(e),
99
+ label: me(e),
100
100
  value: O
101
101
  }
102
102
  }),
103
103
  {}
104
- ), L = {
104
+ ), v = {
105
105
  CAROUSEL_CONTROL: "Carousel Control",
106
106
  MICRO_WIDGET: "Micro Widget",
107
107
  VIEW_MORE: "View More"
@@ -115,9 +115,9 @@ const ce = {
115
115
  ON_CAROUSEL_FORWARD_SWIPE: "onCarouselForwardSwipe",
116
116
  ON_NO_RELEVANT_INSIGHTS_CLICKED: "onNoRelevantInsightsClicked",
117
117
  ON_VIEW_MORE_CLICKED: "onViewMoreClicked"
118
- }, Le = {
118
+ }, De = {
119
119
  ON_VIEW_MORE_VIEWED: "onViewMoreCardView"
120
- }, v = {
120
+ }, L = {
121
121
  CONTROL_BACKWARD: "Control Backward",
122
122
  CONTROL_FORWARD: "Control Forward",
123
123
  MICRO_BEAT_CLICKED: "Micro Beat Clicked",
@@ -129,91 +129,91 @@ const ce = {
129
129
  MICRO_WIDGET_CAROUSEL: "Micro Widget Carousel",
130
130
  MICRO_WIDGET_CAROUSEL_ZERO_STATE: "Micro Widget Carousel Zero State",
131
131
  MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS: "Micro Widget Carousel No Relevant Insights"
132
- }, Ee = {
132
+ }, Se = {
133
133
  [B.MICRO_WIDGET_CAROUSEL]: {
134
- label: L.MICRO_WIDGET,
134
+ label: v.MICRO_WIDGET,
135
135
  name: B.MICRO_WIDGET_CAROUSEL,
136
- path: Ie.INSIGHTS_MICRO_WIDGET,
136
+ path: Ae.INSIGHTS_MICRO_WIDGET,
137
137
  value: O
138
138
  },
139
139
  // zero state
140
140
  [B.MICRO_WIDGET_CAROUSEL_ZERO_STATE]: {
141
- label: L.MICRO_WIDGET,
141
+ label: v.MICRO_WIDGET,
142
142
  name: B.MICRO_WIDGET_CAROUSEL_ZERO_STATE,
143
- path: Ie.INSIGHTS_MICRO_WIDGET,
143
+ path: Ae.INSIGHTS_MICRO_WIDGET,
144
144
  value: O
145
145
  },
146
146
  // no relevant cards
147
147
  [B.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS]: {
148
- label: L.MICRO_WIDGET,
148
+ label: v.MICRO_WIDGET,
149
149
  name: B.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS,
150
150
  path: "/micro-widget",
151
151
  value: O
152
152
  }
153
- }, fe = {
153
+ }, Te = {
154
154
  // carousel control interaction events - clicks and swipes
155
155
  [W.ON_CAROUSEL_BACK_CLICK]: {
156
- action: v.CONTROL_BACKWARD,
156
+ action: L.CONTROL_BACKWARD,
157
157
  category: b.MICRO_WIDGET_INTERACTION,
158
- label: L.CAROUSEL_CONTROL,
158
+ label: v.CAROUSEL_CONTROL,
159
159
  value: O
160
160
  },
161
161
  [W.ON_CAROUSEL_FORWARD_CLICK]: {
162
- action: v.CONTROL_FORWARD,
162
+ action: L.CONTROL_FORWARD,
163
163
  category: b.MICRO_WIDGET_INTERACTION,
164
- label: L.CAROUSEL_CONTROL,
164
+ label: v.CAROUSEL_CONTROL,
165
165
  value: O
166
166
  },
167
167
  [W.ON_CAROUSEL_BACK_SWIPE]: {
168
- action: v.SWIPE_BACKWARD,
168
+ action: L.SWIPE_BACKWARD,
169
169
  category: b.MICRO_WIDGET_INTERACTION,
170
- label: L.CAROUSEL_CONTROL,
170
+ label: v.CAROUSEL_CONTROL,
171
171
  value: O
172
172
  },
173
173
  [W.ON_CAROUSEL_FORWARD_SWIPE]: {
174
- action: v.SWIPE_FORWARD,
174
+ action: L.SWIPE_FORWARD,
175
175
  category: b.MICRO_WIDGET_INTERACTION,
176
- label: L.CAROUSEL_CONTROL,
176
+ label: v.CAROUSEL_CONTROL,
177
177
  value: O
178
178
  },
179
179
  // read more card events
180
180
  [W.ON_VIEW_MORE_CLICKED]: {
181
- action: v.MICRO_BEAT_CLICKED,
181
+ action: L.MICRO_BEAT_CLICKED,
182
182
  category: b.BEAT_INTERACTION,
183
- label: L.VIEW_MORE,
183
+ label: v.VIEW_MORE,
184
184
  value: O
185
185
  },
186
- [Le.ON_VIEW_MORE_VIEWED]: {
187
- action: v.MICRO_BEAT_DISPLAYED,
186
+ [De.ON_VIEW_MORE_VIEWED]: {
187
+ action: L.MICRO_BEAT_DISPLAYED,
188
188
  category: b.BEAT_INTERACTION,
189
- label: L.VIEW_MORE,
189
+ label: v.VIEW_MORE,
190
190
  value: O
191
191
  },
192
- ...at(),
193
- ...st(),
194
- ...ct()
195
- }, ye = async (t, e) => !e || !fe[t] ? null : e.sendAnalyticEvent(fe[t]).then((n) => n).catch((n) => {
192
+ ..._t(),
193
+ ...pt(),
194
+ ...mt()
195
+ }, Re = async (t, e) => !e || !Te[t] ? null : e.sendAnalyticEvent(Te[t]).then((n) => n).catch((n) => {
196
196
  throw n;
197
- }), Ae = async (t, e) => !e || !Ee[t] ? null : e.sendAnalyticsPageview(Ee[t]).then((n) => n).catch((n) => {
197
+ }), Oe = async (t, e) => !e || !Se[t] ? null : e.sendAnalyticsPageview(Se[t]).then((n) => n).catch((n) => {
198
198
  throw n;
199
199
  });
200
- class lt {
201
- onAnalyticEvent = ye;
202
- onAnalyticPageView = Ae;
203
- beatApi = new he("/", "");
200
+ class ut {
201
+ onAnalyticEvent = Re;
202
+ onAnalyticPageView = Oe;
203
+ beatApi = new ye("/", "");
204
204
  constructor() {
205
- se(this);
205
+ _e(this);
206
206
  }
207
207
  initialize = async (e, n, i) => {
208
208
  this.onAnalyticEvent = (a, l) => {
209
- ye(a, l).then((r) => r).catch((r) => {
209
+ Re(a, l).then((r) => r).catch((r) => {
210
210
  throw r.status === 401 && i(), r;
211
211
  });
212
212
  }, this.onAnalyticPageView = (a, l) => {
213
- Ae(a, l).then((r) => r).catch((r) => {
213
+ Oe(a, l).then((r) => r).catch((r) => {
214
214
  throw r.status === 401 && i(), r;
215
215
  });
216
- }, this.beatApi = new he(e, n);
216
+ }, this.beatApi = new ye(e, n);
217
217
  };
218
218
  updateBeat = async (e) => {
219
219
  this.beatApi.updateBeat(e);
@@ -222,7 +222,7 @@ class lt {
222
222
  this.beatApi.updateOffer(e);
223
223
  };
224
224
  }
225
- class dt {
225
+ class Ct {
226
226
  copyStore;
227
227
  endpoint = "/";
228
228
  insightsMicroWidgetStore;
@@ -230,28 +230,28 @@ class dt {
230
230
  token = "";
231
231
  isInitialized = !1;
232
232
  constructor() {
233
- this.copyStore = new rt(), this.insightsMicroWidgetStore = new lt(), se(this);
233
+ this.copyStore = new dt(), this.insightsMicroWidgetStore = new ut(), _e(this);
234
234
  }
235
235
  initialize = async (e, n, i) => {
236
236
  await this.copyStore.initialize(e, n), await this.insightsMicroWidgetStore.initialize(e, n, i);
237
- const a = await Qe(e, n, "1.0.0", "Micro Insights Carousel");
238
- We(() => {
237
+ const a = await ot(e, n, "1.0.0", "Micro Insights Carousel");
238
+ ve(() => {
239
239
  this.session = a, this.isInitialized = !0;
240
240
  });
241
241
  };
242
242
  }
243
- const H = I.createContext(null), _t = ({
243
+ const F = E.createContext(null), ht = ({
244
244
  onEvent: t,
245
245
  onPageview: e,
246
246
  store: n,
247
247
  children: i
248
- }) => /* @__PURE__ */ o(H.Provider, { value: { onEvent: t, onPageview: e, store: n, children: i }, children: i }), pt = ({ beat: t }) => {
249
- const { primary_category_guid: e, category_guids: n } = t, i = e || n?.[0] || Ye.UNCATEGORIZED;
250
- return /* @__PURE__ */ o(Ue, { categoryGuid: i, size: 32, sx: { minWidth: 32 } });
251
- }, mt = ({ beat: t }) => {
248
+ }) => /* @__PURE__ */ o(F.Provider, { value: { onEvent: t, onPageview: e, store: n, children: i }, children: i }), gt = ({ beat: t }) => {
249
+ const { primary_category_guid: e, category_guids: n } = t, i = e || n?.[0] || Je.UNCATEGORIZED;
250
+ return /* @__PURE__ */ o($e, { categoryGuid: i, size: 32, sx: { minWidth: 32 } });
251
+ }, It = ({ beat: t }) => {
252
252
  const { category_guids: e, merchant_guids: n, primary_category_guid: i, primary_merchant_guid: a } = t;
253
253
  return /* @__PURE__ */ o(
254
- ze,
254
+ je,
255
255
  {
256
256
  categoryGuid: i || e && e[0] || "",
257
257
  merchantGuid: a || n[0],
@@ -263,27 +263,27 @@ const H = I.createContext(null), _t = ({
263
263
  }
264
264
  }
265
265
  );
266
- }, ut = (t) => t ? t.data ? t.data.map((e) => {
266
+ }, Et = (t) => t ? t.data ? t.data.map((e) => {
267
267
  const n = {};
268
268
  return t.names?.map((i, a) => {
269
269
  n[i] = e[a];
270
270
  }), n;
271
- }) : [] : [], q = "primary", be = "success", ve = "error", De = (t) => {
272
- const e = ut(t), n = Math.floor(e.length / 2);
271
+ }) : [] : [], q = "primary", Be = "success", Pe = "error", Ve = (t) => {
272
+ const e = Et(t), n = Math.floor(e.length / 2);
273
273
  if (n === 0 || n === e.length) return q;
274
274
  const i = e[0]?.amount, a = e[n]?.amount;
275
- return i == null || a == null ? q : i > a ? ve : i < a ? be : q;
276
- }, Ct = (t, e) => t < e ? be : t > e ? ve : q, ht = ({ beat: t }) => {
277
- const e = P(), n = De(t.data_series), i = e.palette[n].main;
275
+ return i == null || a == null ? q : i > a ? Pe : i < a ? Be : q;
276
+ }, yt = (t, e) => t < e ? Be : t > e ? Pe : q, ft = ({ beat: t }) => {
277
+ const e = P(), n = Ve(t.data_series), i = e.palette[n].main;
278
278
  return /* @__PURE__ */ o(c, { bgColor: s(i, 0.15), iconColor: n, name: "bar_chart" });
279
- }, gt = ({ beat: t }) => {
279
+ }, At = ({ beat: t }) => {
280
280
  const e = P(), n = t.payload?.average_spend || 0;
281
281
  let i = 0;
282
282
  if (t.data_series?.data && t.data_series.data.length > 0) {
283
283
  const r = (t.data_series.names || []).indexOf("amount");
284
284
  r !== -1 && (i = t.data_series.data[0][r] || 0);
285
285
  }
286
- const a = Ct(i, n);
286
+ const a = yt(i, n);
287
287
  return /* @__PURE__ */ o(
288
288
  c,
289
289
  {
@@ -292,8 +292,8 @@ const H = I.createContext(null), _t = ({
292
292
  name: "timeline"
293
293
  }
294
294
  );
295
- }, It = ({ beat: t }) => {
296
- const e = P(), n = De(t.data_series), i = e.palette[n].main;
295
+ }, St = ({ beat: t }) => {
296
+ const e = P(), n = Ve(t.data_series), i = e.palette[n].main;
297
297
  return /* @__PURE__ */ o(
298
298
  c,
299
299
  {
@@ -303,11 +303,11 @@ const H = I.createContext(null), _t = ({
303
303
  name: "area_chart"
304
304
  }
305
305
  );
306
- }, Et = ({ beat: t }) => /* @__PURE__ */ o(Ke, { alt: t.institutionName || "", institutionGuid: t.institutionGuid || "" }), ft = {
306
+ }, Tt = ({ beat: t }) => /* @__PURE__ */ o(Ye, { alt: t.institutionName || "", institutionGuid: t.institutionGuid || "" }), Rt = {
307
307
  0: (t, e) => /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "error" }),
308
- 1: (t) => /* @__PURE__ */ o(pt, { beat: t }),
309
- 2: (t) => /* @__PURE__ */ o(mt, { beat: t }),
310
- 3: (t) => /* @__PURE__ */ o(ht, { beat: t }),
308
+ 1: (t) => /* @__PURE__ */ o(gt, { beat: t }),
309
+ 2: (t) => /* @__PURE__ */ o(It, { beat: t }),
310
+ 3: (t) => /* @__PURE__ */ o(ft, { beat: t }),
311
311
  4: (t, e) => /* @__PURE__ */ o(
312
312
  c,
313
313
  {
@@ -340,7 +340,7 @@ const H = I.createContext(null), _t = ({
340
340
  sx: { color: "text.primary" }
341
341
  }
342
342
  ),
343
- 12: (t) => /* @__PURE__ */ o(It, { beat: t }),
343
+ 12: (t) => /* @__PURE__ */ o(St, { beat: t }),
344
344
  13: () => /* @__PURE__ */ o(
345
345
  c,
346
346
  {
@@ -421,7 +421,7 @@ const H = I.createContext(null), _t = ({
421
421
  ),
422
422
  27: (t, e) => /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "directions_car" }),
423
423
  28: (t, e) => /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "contract" }),
424
- 29: (t) => /* @__PURE__ */ o(gt, { beat: t }),
424
+ 29: (t) => /* @__PURE__ */ o(At, { beat: t }),
425
425
  30: (t, e) => /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "calendar_month" }),
426
426
  31: (t, e) => /* @__PURE__ */ o(
427
427
  c,
@@ -440,38 +440,38 @@ const H = I.createContext(null), _t = ({
440
440
  name: "storefront"
441
441
  }
442
442
  ),
443
- 34: (t) => /* @__PURE__ */ o(Et, { beat: t })
444
- }, yt = ({ beat: t }) => {
445
- const e = P(), { icon_type: n } = t, i = n != null ? ft[n] : null;
443
+ 34: (t) => /* @__PURE__ */ o(Tt, { beat: t })
444
+ }, Ot = ({ beat: t }) => {
445
+ const e = P(), { icon_type: n } = t, i = n != null ? Rt[n] : null;
446
446
  return i ? i(t, e) : /* @__PURE__ */ o(c, { bgColor: s(e.palette.primary.main, 0.15), name: "error" });
447
- }, D = () => {
448
- const t = I.useContext(H);
447
+ }, x = () => {
448
+ const t = E.useContext(F);
449
449
  if (!t)
450
450
  throw new Error("useCopyStore() must be used within the InsightsMicroWidgetDataProvider");
451
451
  return t.store.copyStore;
452
- }, At = () => {
453
- const t = I.useContext(H);
452
+ }, Wt = () => {
453
+ const t = E.useContext(F);
454
454
  if (!t?.store?.insightsMicroWidgetStore)
455
455
  throw new Error(
456
456
  "useInsightsMicroWidgetStore() must be used within the InsightsMicroWidgetDataProvider"
457
457
  );
458
458
  return t.store.insightsMicroWidgetStore;
459
- }, $ = () => {
460
- const t = I.useContext(H);
459
+ }, H = () => {
460
+ const t = E.useContext(F);
461
461
  if (!t)
462
462
  throw new Error("useEvent() must be used within the InsightsMicroWidgetDataProvider");
463
463
  return { onEvent: t.onEvent };
464
- }, xe = () => {
465
- const t = I.useContext(H);
464
+ }, Ge = () => {
465
+ const t = E.useContext(F);
466
466
  if (!t)
467
467
  throw new Error("usePageview() must be used within the InsightsMicroWidgetDataProvider");
468
468
  return { onPageview: t.onPageview };
469
- }, St = {
469
+ }, wt = {
470
470
  LARGE: 180,
471
471
  STANDARD: 154,
472
472
  XLARGE: 200,
473
473
  XXLARGE: 248
474
- }, Tt = 50, Be = 1, J = I.forwardRef(
474
+ }, Nt = 50, ke = 1, J = E.forwardRef(
475
475
  function({
476
476
  ariaLabel: e,
477
477
  closeAriaLabel: n,
@@ -479,43 +479,43 @@ const H = I.createContext(null), _t = ({
479
479
  elevation: a,
480
480
  icon: l,
481
481
  isActiveCard: r,
482
- heightOverrides: u,
482
+ heightOverrides: m,
483
483
  onClose: C,
484
- onCardClick: E,
485
- onPrimaryAction: h,
484
+ onCardClick: h,
485
+ onPrimaryAction: g,
486
486
  onSecondaryAction: d,
487
487
  primaryActionText: _,
488
488
  secondaryActionText: p,
489
- title: g,
489
+ title: I,
490
490
  variant: y,
491
491
  widthOverrides: S,
492
- ...N
492
+ ...w
493
493
  }, T) {
494
- const A = !!(h && _), R = /* @__PURE__ */ w(Te, { children: [
494
+ const f = !!(g && _), R = /* @__PURE__ */ N(we, { children: [
495
495
  C && /* @__PURE__ */ o(
496
- it,
496
+ lt,
497
497
  {
498
498
  "aria-label": n,
499
- onClick: (m) => {
500
- m.stopPropagation(), C?.();
499
+ onClick: (u) => {
500
+ u.stopPropagation(), C?.();
501
501
  },
502
- onMouseDown: (m) => {
503
- m.stopPropagation();
502
+ onMouseDown: (u) => {
503
+ u.stopPropagation();
504
504
  },
505
- onTouchStart: (m) => {
506
- m.stopPropagation();
505
+ onTouchStart: (u) => {
506
+ u.stopPropagation();
507
507
  },
508
508
  sx: { minHeight: 40, minWidth: 40, position: "absolute", right: 4, top: 4 },
509
- children: /* @__PURE__ */ o(He, {})
509
+ children: /* @__PURE__ */ o(Ze, {})
510
510
  }
511
511
  ),
512
- /* @__PURE__ */ w(F, { sx: { gap: 6, height: "100%", justifyContent: "space-between" }, children: [
513
- /* @__PURE__ */ w(F, { sx: { flexDirection: "row", gap: 12 }, children: [
512
+ /* @__PURE__ */ N(K, { sx: { gap: 6, height: "100%", justifyContent: "space-between" }, children: [
513
+ /* @__PURE__ */ N(K, { sx: { flexDirection: "row", gap: 12 }, children: [
514
514
  l && l,
515
- /* @__PURE__ */ w(F, { sx: { gap: 6 }, children: [
516
- /* @__PURE__ */ o(F, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: /* @__PURE__ */ o(pe, { bold: !0, sx: { lineHeight: "16px" }, variant: "body1", children: g }) }),
515
+ /* @__PURE__ */ N(K, { sx: { gap: 6 }, children: [
516
+ /* @__PURE__ */ o(K, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: /* @__PURE__ */ o(he, { bold: !0, sx: { lineHeight: "16px" }, variant: "body1", children: I }) }),
517
517
  /* @__PURE__ */ o(
518
- pe,
518
+ he,
519
519
  {
520
520
  dangerouslySetInnerHTML: { __html: i },
521
521
  sx: {
@@ -523,7 +523,7 @@ const H = I.createContext(null), _t = ({
523
523
  overflow: "hidden",
524
524
  textOverflow: "ellipsis",
525
525
  WebkitBoxOrient: "vertical",
526
- WebkitLineClamp: A ? 2 : 3,
526
+ WebkitLineClamp: f ? 2 : 3,
527
527
  "& .bold-copy": {
528
528
  fontWeight: "bold",
529
529
  fontFamily: "inherit"
@@ -534,8 +534,8 @@ const H = I.createContext(null), _t = ({
534
534
  )
535
535
  ] })
536
536
  ] }),
537
- A && /* @__PURE__ */ w(
538
- F,
537
+ f && /* @__PURE__ */ N(
538
+ K,
539
539
  {
540
540
  sx: {
541
541
  alignItems: "center",
@@ -545,40 +545,40 @@ const H = I.createContext(null), _t = ({
545
545
  pl: l ? 36 : 0
546
546
  },
547
547
  children: [
548
- A && /* @__PURE__ */ o(
549
- ge,
548
+ f && /* @__PURE__ */ o(
549
+ fe,
550
550
  {
551
- onClick: (m) => {
552
- m.stopPropagation(), h?.();
551
+ onClick: (u) => {
552
+ u.stopPropagation(), g?.();
553
553
  },
554
- onMouseDown: (m) => {
555
- m.stopPropagation();
554
+ onMouseDown: (u) => {
555
+ u.stopPropagation();
556
556
  },
557
- onTouchStart: (m) => {
558
- m.stopPropagation();
557
+ onTouchStart: (u) => {
558
+ u.stopPropagation();
559
559
  },
560
560
  size: "small",
561
561
  sx: { px: 8, ml: l ? 0 : -8 },
562
562
  variant: "text",
563
- children: /* @__PURE__ */ o(me, { bold: !0, variant: "body2", children: _ })
563
+ children: /* @__PURE__ */ o(ge, { bold: !0, variant: "body2", children: _ })
564
564
  }
565
565
  ),
566
566
  !!(d && p) && /* @__PURE__ */ o(
567
- ge,
567
+ fe,
568
568
  {
569
- onClick: (m) => {
570
- m.stopPropagation(), d?.();
569
+ onClick: (u) => {
570
+ u.stopPropagation(), d?.();
571
571
  },
572
- onMouseDown: (m) => {
573
- m.stopPropagation();
572
+ onMouseDown: (u) => {
573
+ u.stopPropagation();
574
574
  },
575
- onTouchStart: (m) => {
576
- m.stopPropagation();
575
+ onTouchStart: (u) => {
576
+ u.stopPropagation();
577
577
  },
578
578
  size: "small",
579
579
  sx: { px: 8 },
580
580
  variant: "text",
581
- children: /* @__PURE__ */ o(me, { bold: !0, sx: { color: "text.secondary" }, variant: "body2", children: p })
581
+ children: /* @__PURE__ */ o(ge, { bold: !0, sx: { color: "text.secondary" }, variant: "body2", children: p })
582
582
  }
583
583
  )
584
584
  ]
@@ -587,7 +587,7 @@ const H = I.createContext(null), _t = ({
587
587
  ] })
588
588
  ] });
589
589
  return /* @__PURE__ */ o(
590
- tt,
590
+ at,
591
591
  {
592
592
  "aria-hidden": !r,
593
593
  "aria-label": e,
@@ -596,20 +596,20 @@ const H = I.createContext(null), _t = ({
596
596
  role: "group",
597
597
  sx: {
598
598
  backgroundColor: "background.paper",
599
- height: u ? "100%" : 120,
599
+ height: m ? "100%" : 120,
600
600
  minWidth: S ? `${S}px` : "100%",
601
601
  position: "relative",
602
602
  my: 1,
603
603
  borderRadius: 2
604
604
  },
605
- tabIndex: E || !r ? -1 : 0,
605
+ tabIndex: h || !r ? -1 : 0,
606
606
  variant: y,
607
- ...N,
608
- children: E ? /* @__PURE__ */ o(
609
- ot,
607
+ ...w,
608
+ children: h ? /* @__PURE__ */ o(
609
+ st,
610
610
  {
611
611
  component: "div",
612
- onClick: E,
612
+ onClick: h,
613
613
  sx: {
614
614
  pb: 8,
615
615
  pt: 16,
@@ -618,11 +618,11 @@ const H = I.createContext(null), _t = ({
618
618
  },
619
619
  children: R
620
620
  }
621
- ) : /* @__PURE__ */ o(nt, { sx: { pb: 8, pt: 16, px: 16, height: "100%" }, children: R })
621
+ ) : /* @__PURE__ */ o(ct, { sx: { pb: 8, pt: 16, px: 16, height: "100%" }, children: R })
622
622
  }
623
623
  );
624
624
  }
625
- ), Rt = ({
625
+ ), Mt = ({
626
626
  ariaLabel: t,
627
627
  beat: e,
628
628
  elevation: n,
@@ -630,23 +630,23 @@ const H = I.createContext(null), _t = ({
630
630
  isActiveCard: a,
631
631
  onCardClick: l,
632
632
  posthog: r,
633
- widthOverrides: u,
633
+ widthOverrides: m,
634
634
  variant: C,
635
- showIcon: E,
636
- heightOverrides: h
635
+ showIcon: h,
636
+ heightOverrides: g
637
637
  }) => {
638
- const { ref: d, inView: _ } = Oe({
639
- threshold: Be
640
- }), { cardsCopy: p } = D(), { onEvent: g } = $(), { updateBeat: y, updateOffer: S } = At();
641
- re(() => {
642
- _ && (e.has_been_displayed ? g(we(e.template)) : (e.guid.startsWith("OFR") ? S({
638
+ const { ref: d, inView: _ } = Me({
639
+ threshold: ke
640
+ }), { cardsCopy: p } = x(), { onEvent: I } = H(), { updateBeat: y, updateOffer: S } = Wt();
641
+ le(() => {
642
+ _ && (e.has_been_displayed ? I(Le(e.template)) : (e.guid.startsWith("OFR") ? S({
643
643
  ...e,
644
644
  has_been_displayed: !0
645
645
  }) : y({
646
646
  ...e,
647
647
  has_been_displayed: !0
648
- }), g(Me(e.template))));
649
- }, [_]), re(() => {
648
+ }), I(xe(e.template))));
649
+ }, [_]), le(() => {
650
650
  if (_ && e)
651
651
  if (e.template === "MarketingOffer") {
652
652
  const T = e;
@@ -662,8 +662,8 @@ const H = I.createContext(null), _t = ({
662
662
  position: i
663
663
  });
664
664
  }, [e, i, _]);
665
- const N = () => {
666
- if (l && l(e), g(Ne(e.template)), e.template === "MarketingOffer") {
665
+ const w = () => {
666
+ if (l && l(e), I(be(e.template)), e.template === "MarketingOffer") {
667
667
  const T = e;
668
668
  r?.capture("clicked_messaging_insight", {
669
669
  template: e.template,
@@ -684,19 +684,19 @@ const H = I.createContext(null), _t = ({
684
684
  ariaLabel: t,
685
685
  description: e?.html_micro_description && e?.html_micro_description.length > 0 ? e.html_micro_description : e.html_description || "",
686
686
  elevation: n,
687
- heightOverrides: h,
688
- icon: E && /* @__PURE__ */ o(yt, { beat: e }),
687
+ heightOverrides: g,
688
+ icon: h && /* @__PURE__ */ o(Ot, { beat: e }),
689
689
  isActiveCard: a,
690
- onCardClick: N,
691
- onPrimaryAction: N,
690
+ onCardClick: w,
691
+ onPrimaryAction: w,
692
692
  primaryActionText: e.micro_call_to_action || p?.micro_card_cta,
693
693
  ref: d,
694
694
  title: e.micro_title && e.micro_title.length > 0 ? e.micro_title : e.title,
695
695
  variant: C,
696
- widthOverrides: u
696
+ widthOverrides: m
697
697
  }
698
698
  );
699
- }, Ot = ({
699
+ }, vt = ({
700
700
  currentBeatIndex: t,
701
701
  numBeats: e,
702
702
  onNextClick: n,
@@ -704,10 +704,10 @@ const H = I.createContext(null), _t = ({
704
704
  scrollRightBoundary: a,
705
705
  scrollX: l,
706
706
  shouldApplyDotAnimation: r = !1,
707
- visibleCardsCount: u = 1
707
+ visibleCardsCount: m = 1
708
708
  }) => {
709
- const C = P(), { carouselCopy: E } = D(), h = Math.floor(l) > a || t - u + 1 === 0, d = l < 0 || e - 1 === t, _ = C.palette.grey[500], p = C.palette.primary.main;
710
- return /* @__PURE__ */ w(
709
+ const C = P(), { carouselCopy: h } = x(), g = Math.floor(l) > a || t - m + 1 === 0, d = l < 0 || e - 1 === t, _ = C.palette.grey[500], p = C.palette.primary.main;
710
+ return /* @__PURE__ */ N(
711
711
  k,
712
712
  {
713
713
  direction: "row",
@@ -723,26 +723,26 @@ const H = I.createContext(null), _t = ({
723
723
  },
724
724
  children: [
725
725
  /* @__PURE__ */ o(
726
- ue,
726
+ Ie,
727
727
  {
728
- "aria-disabled": h,
729
- "aria-label": E?.previous_insight_cta_aria,
730
- disabled: h,
728
+ "aria-disabled": g,
729
+ "aria-label": h?.previous_insight_cta_aria,
730
+ disabled: g,
731
731
  onClick: i,
732
732
  children: /* @__PURE__ */ o(
733
- $e,
733
+ Qe,
734
734
  {
735
735
  sx: {
736
- color: h ? _ : p
736
+ color: g ? _ : p
737
737
  }
738
738
  }
739
739
  )
740
740
  }
741
741
  ),
742
- Array.from({ length: e }).map((g, y) => {
742
+ Array.from({ length: e }).map((I, y) => {
743
743
  const S = y === t;
744
744
  return /* @__PURE__ */ o(
745
- ae,
745
+ de,
746
746
  {
747
747
  className: "mx-insights-micro-carousel-dots",
748
748
  sx: {
@@ -766,14 +766,14 @@ const H = I.createContext(null), _t = ({
766
766
  );
767
767
  }),
768
768
  /* @__PURE__ */ o(
769
- ue,
769
+ Ie,
770
770
  {
771
771
  "aria-disabled": d,
772
- "aria-label": E?.next_insight_cta_aria,
772
+ "aria-label": h?.next_insight_cta_aria,
773
773
  disabled: d,
774
774
  onClick: n,
775
775
  children: /* @__PURE__ */ o(
776
- Re,
776
+ Ne,
777
777
  {
778
778
  sx: {
779
779
  color: d ? _ : p
@@ -785,7 +785,7 @@ const H = I.createContext(null), _t = ({
785
785
  ]
786
786
  }
787
787
  );
788
- }, Wt = ({
788
+ }, bt = ({
789
789
  activeCardIndex: t,
790
790
  beats: e,
791
791
  cardWidth: n,
@@ -793,48 +793,48 @@ const H = I.createContext(null), _t = ({
793
793
  heightOverrides: a,
794
794
  onCardClick: l,
795
795
  posthog: r,
796
- showIcon: u,
796
+ showIcon: m,
797
797
  variant: C
798
798
  }) => {
799
- const { carouselCopy: E } = D(), h = {
799
+ const { carouselCopy: h } = x(), g = {
800
800
  elevation: i,
801
801
  heightOverrides: a,
802
802
  posthog: r,
803
- showIcon: u,
803
+ showIcon: m,
804
804
  variant: C
805
805
  };
806
- return /* @__PURE__ */ w(Te, { children: [
806
+ return /* @__PURE__ */ N(we, { children: [
807
807
  e.map((d, _) => {
808
- const p = _ + 1, g = e.length + 1, y = Xe(
809
- E?.card_position_in_carousel_aria,
808
+ const p = _ + 1, I = e.length + 1, y = et(
809
+ h?.card_position_in_carousel_aria,
810
810
  p.toString(),
811
- g.toString()
812
- ), S = d.micro_title && d.micro_title.length > 0, N = d.micro_description && d.micro_description.length > 0, T = S ? d.micro_title : d.title, A = N ? d.micro_description : d.description;
811
+ I.toString()
812
+ ), S = d.micro_title && d.micro_title.length > 0, w = d.micro_description && d.micro_description.length > 0, T = S ? d.micro_title : d.title, f = w ? d.micro_description : d.description;
813
813
  return /* @__PURE__ */ o(
814
- Rt,
814
+ Mt,
815
815
  {
816
- ariaLabel: `${y}: ${T}, ${A}`,
816
+ ariaLabel: `${y}: ${T}, ${f}`,
817
817
  beat: d,
818
818
  index: _,
819
819
  isActiveCard: _ === t,
820
820
  onCardClick: l,
821
821
  widthOverrides: n || void 0,
822
- ...h
822
+ ...g
823
823
  },
824
824
  `${d.guid} ${_}`
825
825
  );
826
826
  }),
827
827
  /* @__PURE__ */ o(
828
- Bt,
828
+ zt,
829
829
  {
830
830
  isActiveCard: t === e.length,
831
831
  onCardClick: l,
832
832
  widthOverrides: n || void 0,
833
- ...h
833
+ ...g
834
834
  }
835
835
  )
836
836
  ] });
837
- }, Nt = ({
837
+ }, Lt = ({
838
838
  analyticsMetadata: t,
839
839
  allowSingleCardPeeking: e,
840
840
  beats: n = [],
@@ -842,49 +842,53 @@ const H = I.createContext(null), _t = ({
842
842
  heightOverrides: a,
843
843
  onCardClick: l,
844
844
  posthog: r,
845
- showCarouselControls: u,
845
+ showCarouselControls: m,
846
846
  showIcon: C,
847
- showWithMargin: E = !0,
848
- variant: h,
847
+ showWithMargin: h = !0,
848
+ variant: g,
849
849
  widthOverrides: d,
850
850
  visibleCardsCount: _ = 1
851
851
  // Default to 1 card visible
852
852
  }) => {
853
- const p = I.useRef(null), g = I.useRef(null), [y, S] = I.useState(0), [N, T] = I.useState(null), [A, ee] = I.useState(null), [R, m] = I.useState(null), { carouselCopy: j } = D(), { onEvent: M } = $();
854
- I.useEffect(() => {
855
- if (p.current && !e) {
856
- const f = p.current.offsetWidth, z = 8;
857
- let G;
858
- if (_ > 1) {
859
- const de = (f - (_ - 1) * z) / _ / 3;
860
- G = (f - de - (_ - 1) * z) / _;
861
- } else
862
- G = f;
863
- m(G);
864
- }
865
- }, [_, p.current?.offsetWidth]), I.useEffect(() => {
866
- const f = g.current?.offsetWidth;
867
- if (typeof f == "number" && e) {
868
- const z = (K) => {
869
- const _e = [
853
+ const p = E.useRef(null), I = E.useRef(null), [y, S] = E.useState(0), [w, T] = E.useState(null), [f, ee] = E.useState(null), [R, u] = E.useState(null), { carouselCopy: $ } = x(), { onEvent: M } = H();
854
+ E.useEffect(() => {
855
+ const A = (re) => {
856
+ const G = I.current;
857
+ if (!G) return;
858
+ const U = re ?? G.offsetWidth;
859
+ if (e) {
860
+ const Q = [
861
+ { maxWidth: 320, cardWidth: 220 },
870
862
  { maxWidth: 375, cardWidth: 268 },
871
863
  { maxWidth: 444, cardWidth: 300 },
872
864
  { maxWidth: 599, cardWidth: 350 },
873
865
  { maxWidth: 749, cardWidth: 450 },
874
866
  { maxWidth: 900, cardWidth: 600 }
875
- ].find((Ge) => K <= Ge.maxWidth);
876
- return _e ? _e.cardWidth : 750;
877
- };
878
- m(z(f));
879
- const G = () => {
880
- const K = g.current?.offsetWidth;
881
- typeof K == "number" && m(z(K));
882
- };
883
- return window.addEventListener("resize", G), () => {
884
- window.removeEventListener("resize", G);
885
- };
886
- }
887
- }, [e, g]);
867
+ ].find((Fe) => U <= Fe.maxWidth);
868
+ u(Q ? Q.cardWidth : 750);
869
+ return;
870
+ }
871
+ const ae = h ? Math.max(0, U - 32) : U, Ce = 8;
872
+ let se;
873
+ if (_ > 1) {
874
+ const Q = (ae - (_ - 1) * Ce) / _ / 3;
875
+ se = (ae - Q - (_ - 1) * Ce) / _;
876
+ } else
877
+ se = ae;
878
+ u(Math.max(0, se));
879
+ };
880
+ A();
881
+ const ue = () => A();
882
+ let ie = null;
883
+ return typeof ResizeObserver < "u" && I.current ? (ie = new ResizeObserver((re) => {
884
+ const G = re[0];
885
+ if (!G) return;
886
+ const U = G.borderBoxSize?.[0]?.inlineSize ?? G.contentRect.width;
887
+ A(U);
888
+ }), ie.observe(I.current)) : window.addEventListener("resize", ue), () => {
889
+ window.removeEventListener("resize", ue), ie?.disconnect();
890
+ };
891
+ }, [e, _, h]);
888
892
  const V = () => {
889
893
  M(W.ON_CAROUSEL_FORWARD_CLICK, t), p.current && R && p.current.scrollTo({
890
894
  left: y + R + 8,
@@ -897,22 +901,22 @@ const H = I.createContext(null), _t = ({
897
901
  top: 0,
898
902
  behavior: "smooth"
899
903
  });
900
- }, Y = () => {
904
+ }, j = () => {
901
905
  p.current && S(p.current.scrollLeft);
902
- }, X = () => {
903
- if (!A || !N) return;
904
- A - N > Tt ? M(W.ON_CAROUSEL_FORWARD_SWIPE, t) : M(W.ON_CAROUSEL_BACK_SWIPE, t);
905
- }, oe = (f) => {
906
- T(f.targetTouches[0].clientX);
907
- }, ne = (f) => {
908
- T(null), ee(f.targetTouches[0].clientX);
909
- }, Z = R ? Math.round(y / (R + 8)) : 0, Q = p.current ? p.current.scrollWidth - p.current.offsetWidth : 0;
910
- return /* @__PURE__ */ w(
906
+ }, Y = () => {
907
+ if (!f || !w) return;
908
+ f - w > Nt ? M(W.ON_CAROUSEL_FORWARD_SWIPE, t) : M(W.ON_CAROUSEL_BACK_SWIPE, t);
909
+ }, oe = (A) => {
910
+ T(A.targetTouches[0].clientX);
911
+ }, ne = (A) => {
912
+ T(null), ee(A.targetTouches[0].clientX);
913
+ }, X = R ? Math.round(y / (R + 8)) : 0, Z = p.current ? p.current.scrollWidth - p.current.offsetWidth : 0;
914
+ return /* @__PURE__ */ N(
911
915
  k,
912
916
  {
913
- "aria-label": j?.carousel_title,
917
+ "aria-label": $?.carousel_title,
914
918
  "aria-roledescription": "carousel",
915
- ref: g,
919
+ ref: I,
916
920
  role: "region",
917
921
  sx: {
918
922
  alignItems: "center",
@@ -925,8 +929,8 @@ const H = I.createContext(null), _t = ({
925
929
  k,
926
930
  {
927
931
  direction: "row",
928
- onScroll: Y,
929
- onTouchEnd: X,
932
+ onScroll: j,
933
+ onTouchEnd: Y,
930
934
  onTouchMove: oe,
931
935
  onTouchStart: ne,
932
936
  ref: p,
@@ -936,7 +940,7 @@ const H = I.createContext(null), _t = ({
936
940
  gap: 8,
937
941
  listStyleType: "none",
938
942
  m: 0,
939
- maxWidth: E ? "calc(100% - 32px)" : "100%",
943
+ maxWidth: h ? "calc(100% - 32px)" : "100%",
940
944
  overflowX: "auto",
941
945
  overflowY: "hidden",
942
946
  p: 0,
@@ -948,9 +952,9 @@ const H = I.createContext(null), _t = ({
948
952
  }
949
953
  },
950
954
  children: /* @__PURE__ */ o(
951
- Wt,
955
+ bt,
952
956
  {
953
- activeCardIndex: Z,
957
+ activeCardIndex: X,
954
958
  beats: n,
955
959
  cardWidth: R,
956
960
  elevation: i,
@@ -958,19 +962,19 @@ const H = I.createContext(null), _t = ({
958
962
  onCardClick: l,
959
963
  posthog: r,
960
964
  showIcon: C,
961
- variant: h
965
+ variant: g
962
966
  }
963
967
  )
964
968
  }
965
969
  ),
966
- u && /* @__PURE__ */ o(
967
- Ot,
970
+ m && /* @__PURE__ */ o(
971
+ vt,
968
972
  {
969
- currentBeatIndex: Z + _ - 1,
973
+ currentBeatIndex: X + _ - 1,
970
974
  numBeats: n.length + 1,
971
975
  onNextClick: V,
972
976
  onPreviousClick: te,
973
- scrollRightBoundary: Q,
977
+ scrollRightBoundary: Z,
974
978
  scrollX: y,
975
979
  shouldApplyDotAnimation: e,
976
980
  visibleCardsCount: _
@@ -979,17 +983,17 @@ const H = I.createContext(null), _t = ({
979
983
  ]
980
984
  }
981
985
  );
982
- }, wt = U(Nt), Mt = ({
986
+ }, xt = z(Lt), Dt = ({
983
987
  analyticsMetadata: t,
984
988
  onCardClick: e,
985
989
  posthog: n,
986
990
  widthOverrides: i,
987
991
  headerSx: a
988
992
  }) => {
989
- const { carouselCopy: l } = D(), { onEvent: r } = $(), u = () => {
993
+ const { carouselCopy: l } = x(), { onEvent: r } = H(), m = () => {
990
994
  r && (r(W.ON_VIEW_MORE_CLICKED, t), e(), n?.capture("clicked_view_more"));
991
995
  };
992
- return l ? /* @__PURE__ */ w(
996
+ return l ? /* @__PURE__ */ N(
993
997
  k,
994
998
  {
995
999
  alignItems: "center",
@@ -1003,12 +1007,12 @@ const H = I.createContext(null), _t = ({
1003
1007
  ...a
1004
1008
  },
1005
1009
  children: [
1006
- /* @__PURE__ */ o(Fe, { children: l.carousel_title }),
1010
+ /* @__PURE__ */ o(Xe, { children: l.carousel_title }),
1007
1011
  /* @__PURE__ */ o(
1008
- ke,
1012
+ He,
1009
1013
  {
1010
- endIcon: /* @__PURE__ */ o(Re, { size: 20 }),
1011
- onClick: u,
1014
+ endIcon: /* @__PURE__ */ o(Ne, { size: 20 }),
1015
+ onClick: m,
1012
1016
  size: "small",
1013
1017
  variant: "text",
1014
1018
  children: l.view_all_insights_in_full_feed_cta_aria
@@ -1016,15 +1020,15 @@ const H = I.createContext(null), _t = ({
1016
1020
  )
1017
1021
  ]
1018
1022
  }
1019
- ) : /* @__PURE__ */ o(je, {});
1020
- }, Lt = U(Mt), bt = ({
1023
+ ) : /* @__PURE__ */ o(qe, {});
1024
+ }, Bt = z(Dt), Pt = ({
1021
1025
  heightOverrides: t,
1022
1026
  widthOverrides: e,
1023
1027
  children: n
1024
1028
  }) => {
1025
- const { carouselCopy: i } = D();
1029
+ const { carouselCopy: i } = x();
1026
1030
  return /* @__PURE__ */ o(
1027
- ae,
1031
+ de,
1028
1032
  {
1029
1033
  "aria-label": i?.carousel_title,
1030
1034
  "aria-roledescription": "carousel",
@@ -1038,7 +1042,7 @@ const H = I.createContext(null), _t = ({
1038
1042
  children: n
1039
1043
  }
1040
1044
  );
1041
- }, Pe = ({
1045
+ }, ze = ({
1042
1046
  ariaLabel: t,
1043
1047
  elevation: e,
1044
1048
  heightOverrides: n,
@@ -1047,12 +1051,12 @@ const H = I.createContext(null), _t = ({
1047
1051
  showIcon: l,
1048
1052
  variant: r
1049
1053
  }) => {
1050
- const { cardsCopy: u } = D(), C = P(), { onEvent: E } = $(), { onPageview: h } = xe();
1051
- I.useEffect(() => {
1052
- h(B.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS);
1054
+ const { cardsCopy: m } = x(), C = P(), { onEvent: h } = H(), { onPageview: g } = Ge();
1055
+ E.useEffect(() => {
1056
+ g(B.MICRO_WIDGET_CAROUSEL_NO_RELEVANT_INSIGHTS);
1053
1057
  }, []);
1054
1058
  const d = () => {
1055
- i && i(), E(W.ON_NO_RELEVANT_INSIGHTS_CLICKED), a?.capture("clicked_insight", {
1059
+ i && i(), h(W.ON_NO_RELEVANT_INSIGHTS_CLICKED), a?.capture("clicked_insight", {
1056
1060
  template: "no_relevant_insights"
1057
1061
  });
1058
1062
  };
@@ -1060,18 +1064,18 @@ const H = I.createContext(null), _t = ({
1060
1064
  J,
1061
1065
  {
1062
1066
  ariaLabel: t,
1063
- description: u.no_relevant_insights_card_description,
1067
+ description: m.no_relevant_insights_card_description,
1064
1068
  elevation: e,
1065
1069
  heightOverrides: n,
1066
1070
  icon: l && /* @__PURE__ */ o(c, { bgColor: s(C.palette.primary.main, 0.15), name: "lightbulb" }),
1067
1071
  onCardClick: d,
1068
1072
  onPrimaryAction: d,
1069
- primaryActionText: u.micro_card_cta,
1070
- title: u.no_relevant_insights_card_title,
1073
+ primaryActionText: m.micro_card_cta,
1074
+ title: m.no_relevant_insights_card_title,
1071
1075
  variant: r
1072
1076
  }
1073
1077
  );
1074
- }, io = U(Pe), Ve = ({
1078
+ }, lo = z(ze), Ue = ({
1075
1079
  ariaLabel: t,
1076
1080
  elevation: e,
1077
1081
  heightOverrides: n,
@@ -1079,24 +1083,24 @@ const H = I.createContext(null), _t = ({
1079
1083
  showIcon: a,
1080
1084
  variant: l
1081
1085
  }) => {
1082
- const { onPageview: r } = xe(), { zeroStateCopy: u } = D(), C = P();
1083
- return I.useEffect(() => {
1086
+ const { onPageview: r } = Ge(), { zeroStateCopy: m } = x(), C = P();
1087
+ return E.useEffect(() => {
1084
1088
  r(B.MICRO_WIDGET_CAROUSEL_ZERO_STATE);
1085
1089
  }, []), /* @__PURE__ */ o(
1086
1090
  J,
1087
1091
  {
1088
1092
  ariaLabel: t,
1089
- description: u.carousel_zero_state_description,
1093
+ description: m.carousel_zero_state_description,
1090
1094
  elevation: e,
1091
1095
  heightOverrides: n,
1092
1096
  icon: a && /* @__PURE__ */ o(c, { bgColor: s(C.palette.primary.main, 0.15), name: "lightbulb" }),
1093
1097
  onCardClick: i,
1094
- title: u.carousel_zero_state_title,
1098
+ title: m.carousel_zero_state_title,
1095
1099
  variant: l
1096
1100
  }
1097
1101
  );
1098
- }, ro = U(Ve), vt = () => /* @__PURE__ */ o(
1099
- ae,
1102
+ }, _o = z(Ue), Vt = () => /* @__PURE__ */ o(
1103
+ de,
1100
1104
  {
1101
1105
  sx: {
1102
1106
  alignItems: "center",
@@ -1105,11 +1109,11 @@ const H = I.createContext(null), _t = ({
1105
1109
  justifyContent: "center",
1106
1110
  width: "100%"
1107
1111
  },
1108
- children: /* @__PURE__ */ o(Ze, {})
1112
+ children: /* @__PURE__ */ o(tt, {})
1109
1113
  }
1110
- ), Se = {
1114
+ ), We = {
1111
1115
  featureVersion: "spendVsIncomeTrends"
1112
- }, x = new dt(), Dt = ({
1116
+ }, D = new Ct(), Gt = ({
1113
1117
  allowSingleCardPeeking: t = !0,
1114
1118
  areBeatsLoading: e = !1,
1115
1119
  beats: n = [],
@@ -1118,80 +1122,80 @@ const H = I.createContext(null), _t = ({
1118
1122
  endpoint: a = "/",
1119
1123
  headerSx: l,
1120
1124
  heightOverrides: r,
1121
- logOutUser: u = () => {
1125
+ logOutUser: m = () => {
1122
1126
  },
1123
1127
  onCardClick: C = () => {
1124
1128
  },
1125
- onEvent: E = () => {
1129
+ onEvent: h = () => {
1126
1130
  },
1127
- onPageview: h = () => {
1131
+ onPageview: g = () => {
1128
1132
  },
1129
1133
  posthog: d,
1130
1134
  showCarouselControls: _,
1131
1135
  showHeader: p,
1132
- showIcon: g,
1136
+ showIcon: I,
1133
1137
  showWithMargin: y = !0,
1134
1138
  token: S = "",
1135
- userHasFullInsightFeedBeats: N,
1139
+ userHasFullInsightFeedBeats: w,
1136
1140
  visibleCardsCount: T = 1,
1137
- widthOverrides: A
1141
+ widthOverrides: f
1138
1142
  }) => {
1139
1143
  const R = (() => {
1140
1144
  if (i === "border") return "outlined";
1141
1145
  if (i === "elevation 1") return "elevation";
1142
1146
  if (i !== "flat")
1143
1147
  return "elevation";
1144
- })(), m = i === "flat" ? 0 : 1, [j, M] = ie("STANDARD"), [V, te] = ie(!1), [Y, X] = ie(!1), oe = qe([E], x), ne = Je([h], x);
1145
- et({
1148
+ })(), u = i === "flat" ? 0 : 1, [$, M] = ce("STANDARD"), [V, te] = ce(!1), [j, Y] = ce(!1), oe = nt([h], D), ne = it([g], D);
1149
+ rt({
1146
1150
  widgetName: "InsightsMicroWidget",
1147
1151
  isLoaded: V
1148
- }), I.useEffect(() => {
1149
- !x.isInitialized && !Y && (x.initialize(a, S, u).catch(() => X(!1)), X(!0));
1150
- }, [a, S, u, x.isInitialized, Y]), I.useEffect(() => {
1151
- const f = window.innerHeight;
1152
- f < 180 ? M("STANDARD") : f >= 180 && f < 200 ? M("LARGE") : f >= 200 && f < 248 ? M("XLARGE") : f >= 248 && M("XXLARGE");
1153
- }, [window.innerHeight]), I.useEffect(() => {
1154
- te(!e && x.isInitialized);
1155
- }, [e, x.isInitialized]);
1156
- const Z = {
1152
+ }), E.useEffect(() => {
1153
+ !D.isInitialized && !j && (D.initialize(a, S, m).catch(() => Y(!1)), Y(!0));
1154
+ }, [a, S, m, D.isInitialized, j]), E.useEffect(() => {
1155
+ const A = window.innerHeight;
1156
+ A < 180 ? M("STANDARD") : A >= 180 && A < 200 ? M("LARGE") : A >= 200 && A < 248 ? M("XLARGE") : A >= 248 && M("XXLARGE");
1157
+ }, [window.innerHeight]), E.useEffect(() => {
1158
+ te(!e && D.isInitialized);
1159
+ }, [e, D.isInitialized]);
1160
+ const X = {
1157
1161
  heightOverrides: r,
1158
1162
  onCardClick: C,
1159
1163
  posthog: d,
1160
- showIcon: g,
1164
+ showIcon: I,
1161
1165
  showWithMargin: y,
1162
- widthOverrides: A
1163
- }, Q = {
1164
- carouselSize: j,
1165
- elevation: m,
1166
+ widthOverrides: f
1167
+ }, Z = {
1168
+ carouselSize: $,
1169
+ elevation: u,
1166
1170
  variant: R,
1167
1171
  heightOverrides: r,
1168
1172
  onCardClick: C,
1169
1173
  posthog: d,
1170
- showIcon: g
1174
+ showIcon: I
1171
1175
  };
1172
- return /* @__PURE__ */ o(_t, { onEvent: oe, onPageview: ne, store: x, children: /* @__PURE__ */ w(bt, { heightOverrides: r, widthOverrides: A, children: [
1173
- !V && /* @__PURE__ */ o(vt, {}),
1176
+ return /* @__PURE__ */ o(ht, { onEvent: oe, onPageview: ne, store: D, children: /* @__PURE__ */ N(Pt, { heightOverrides: r, widthOverrides: f, children: [
1177
+ !V && /* @__PURE__ */ o(Vt, {}),
1174
1178
  V && p && /* @__PURE__ */ o(
1175
- Lt,
1179
+ Bt,
1176
1180
  {
1177
- analyticsMetadata: Se,
1181
+ analyticsMetadata: We,
1178
1182
  headerSx: l,
1179
1183
  onCardClick: C,
1180
1184
  posthog: d,
1181
- widthOverrides: A
1185
+ widthOverrides: f
1182
1186
  }
1183
1187
  ),
1184
1188
  V && !!n.length && /* @__PURE__ */ o(
1185
- wt,
1189
+ xt,
1186
1190
  {
1187
1191
  allowSingleCardPeeking: t,
1188
- analyticsMetadata: Se,
1192
+ analyticsMetadata: We,
1189
1193
  beats: n,
1190
- elevation: m,
1194
+ elevation: u,
1191
1195
  showCarouselControls: _,
1192
1196
  variant: R,
1193
1197
  visibleCardsCount: T,
1194
- ...Z
1198
+ ...X
1195
1199
  }
1196
1200
  ),
1197
1201
  V && !n.length && /* @__PURE__ */ o(
@@ -1200,22 +1204,22 @@ const H = I.createContext(null), _t = ({
1200
1204
  sx: {
1201
1205
  alignItems: "center",
1202
1206
  height: r,
1203
- width: A || "100%"
1207
+ width: f || "100%"
1204
1208
  },
1205
1209
  children: /* @__PURE__ */ o(
1206
1210
  k,
1207
1211
  {
1208
1212
  sx: {
1209
- height: `calc(${St[j]}px - 44px)`,
1210
- width: y ? `calc(${A}px - 32px)` : "100%"
1213
+ height: `calc(${wt[$]}px - 44px)`,
1214
+ width: y ? `calc(${f}px - 32px)` : "100%"
1211
1215
  },
1212
- children: N ? /* @__PURE__ */ o(Pe, { ...Q }) : /* @__PURE__ */ o(Ve, { ...Q })
1216
+ children: w ? /* @__PURE__ */ o(ze, { ...Z }) : /* @__PURE__ */ o(Ue, { ...Z })
1213
1217
  }
1214
1218
  )
1215
1219
  }
1216
1220
  )
1217
1221
  ] }) });
1218
- }, ao = U(Dt), xt = ({
1222
+ }, po = z(Gt), kt = ({
1219
1223
  ariaLabel: t,
1220
1224
  elevation: e,
1221
1225
  heightOverrides: n,
@@ -1223,18 +1227,18 @@ const H = I.createContext(null), _t = ({
1223
1227
  onCardClick: a,
1224
1228
  posthog: l,
1225
1229
  widthOverrides: r,
1226
- showIcon: u,
1230
+ showIcon: m,
1227
1231
  variant: C
1228
1232
  }) => {
1229
- const E = P(), { ref: h, inView: d } = Oe({
1230
- threshold: Be
1231
- }), { cardsCopy: _ } = D(), { onEvent: p } = $();
1232
- re(() => {
1233
- d && (p(Le.ON_VIEW_MORE_VIEWED), l?.capture("viewed_insight", {
1233
+ const h = P(), { ref: g, inView: d } = Me({
1234
+ threshold: ke
1235
+ }), { cardsCopy: _ } = x(), { onEvent: p } = H();
1236
+ le(() => {
1237
+ d && (p(De.ON_VIEW_MORE_VIEWED), l?.capture("viewed_insight", {
1234
1238
  template: "view_more_card"
1235
1239
  }));
1236
1240
  }, [d]);
1237
- const g = () => {
1241
+ const I = () => {
1238
1242
  a && a(), p(W.ON_VIEW_MORE_CLICKED), l?.capture("clicked_insight", {
1239
1243
  template: "view_more_card"
1240
1244
  });
@@ -1247,30 +1251,30 @@ const H = I.createContext(null), _t = ({
1247
1251
  description: _?.view_more_card_description,
1248
1252
  elevation: e,
1249
1253
  heightOverrides: n,
1250
- icon: u && /* @__PURE__ */ o(c, { bgColor: s(E.palette.primary.main, 0.15), name: "show_chart" }),
1254
+ icon: m && /* @__PURE__ */ o(c, { bgColor: s(h.palette.primary.main, 0.15), name: "show_chart" }),
1251
1255
  isActiveCard: i,
1252
- onCardClick: g,
1253
- onPrimaryAction: g,
1256
+ onCardClick: I,
1257
+ onPrimaryAction: I,
1254
1258
  primaryActionText: _?.micro_card_cta,
1255
- ref: h,
1259
+ ref: g,
1256
1260
  title: _?.view_more_card_title,
1257
1261
  variant: C,
1258
1262
  widthOverrides: r
1259
1263
  }
1260
1264
  );
1261
- }, Bt = U(xt);
1265
+ }, zt = z(kt);
1262
1266
  export {
1263
- dt as A,
1264
- Lt as C,
1265
- Rt as I,
1266
- wt as M,
1267
- io as N,
1268
- Se as T,
1269
- Bt as V,
1270
- ro as Z,
1271
- ao as a,
1272
- _t as b,
1267
+ Ct as A,
1268
+ Bt as C,
1269
+ Mt as I,
1270
+ xt as M,
1271
+ lo as N,
1272
+ We as T,
1273
+ zt as V,
1274
+ _o as Z,
1275
+ po as a,
1276
+ ht as b,
1273
1277
  J as c,
1274
- ht as d
1278
+ ft as d
1275
1279
  };
1276
- //# sourceMappingURL=ViewMoreMicroCard-Dxghxphh.mjs.map
1280
+ //# sourceMappingURL=ViewMoreMicroCard-fnwE0hqd.mjs.map