@braze/web-sdk 5.3.2 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/index.d.ts +20 -4
  2. package/package.json +1 -1
  3. package/shared-lib/event-types.js +12 -12
  4. package/shared-lib/indexed-db-adapter.js +14 -14
  5. package/shared-lib/logger.js +2 -2
  6. package/shared-lib/supported-options.js +10 -9
  7. package/src/Card/card-manager.js +46 -42
  8. package/src/Card/display/card-display.js +59 -58
  9. package/src/Card/models/card.js +61 -55
  10. package/src/Card/models/classic-card.js +1 -1
  11. package/src/Card/models/control-card.js +1 -1
  12. package/src/Card/models/image-only.js +1 -1
  13. package/src/Card/util/card-factory.js +20 -20
  14. package/src/ContentCards/content-cards-provider.js +140 -140
  15. package/src/ContentCards/get-cached-content-cards.js +1 -1
  16. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  17. package/src/ContentCards/subscribe-to-content-cards-updates.js +4 -4
  18. package/src/ContentCards/ui/show-content-cards.js +3 -3
  19. package/src/Core/disable-sdk.js +2 -2
  20. package/src/Core/enable-sdk.js +2 -2
  21. package/src/Core/index.js +1 -0
  22. package/src/Core/is-initialized.js +4 -0
  23. package/src/Core/log-custom-event.js +14 -14
  24. package/src/Core/log-purchase.js +8 -8
  25. package/src/Core/open-session.js +4 -4
  26. package/src/Core/wipe-data.js +2 -2
  27. package/src/FeatureFlags/feature-flag-factory.js +5 -5
  28. package/src/FeatureFlags/feature-flag.js +1 -1
  29. package/src/FeatureFlags/feature-flags-provider.js +74 -74
  30. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  31. package/src/FeatureFlags/get-feature-flag.js +2 -2
  32. package/src/FeatureFlags/log-feature-flag-impression.js +12 -12
  33. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
  34. package/src/Feed/feed-provider.js +29 -29
  35. package/src/Feed/get-cached-feed.js +1 -1
  36. package/src/Feed/request-feed-refresh.js +1 -1
  37. package/src/Feed/subscribe-to-feed-updates.js +1 -1
  38. package/src/Feed/ui/show-feed.js +1 -1
  39. package/src/InAppMessage/display/in-app-message-to-html.js +64 -62
  40. package/src/InAppMessage/in-app-message-manager.js +63 -63
  41. package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
  42. package/src/InAppMessage/log-in-app-message-click.js +2 -2
  43. package/src/InAppMessage/log-in-app-message-html-click.js +2 -2
  44. package/src/InAppMessage/log-in-app-message-impression.js +1 -1
  45. package/src/InAppMessage/models/full-screen-message.js +10 -10
  46. package/src/InAppMessage/models/html-message.js +13 -13
  47. package/src/InAppMessage/models/in-app-message-button.js +4 -4
  48. package/src/InAppMessage/models/in-app-message.js +59 -59
  49. package/src/InAppMessage/models/modal-message.js +9 -9
  50. package/src/InAppMessage/models/slide-up-message.js +11 -11
  51. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  52. package/src/InAppMessage/ui/show-in-app-message.js +42 -40
  53. package/src/Push/push-manager-factory.js +5 -4
  54. package/src/Push/push-manager.js +77 -89
  55. package/src/Push/utils/push-utils.js +4 -4
  56. package/src/User/user-manager.js +8 -8
  57. package/src/User/user.js +29 -29
  58. package/src/common/base-provider.js +1 -1
  59. package/src/common/event-logger.js +11 -11
  60. package/src/common/feed-display.js +18 -17
  61. package/src/l10n/l10n-manager-factory.js +7 -7
  62. package/src/l10n/l10n-manager.js +15 -5
  63. package/src/managers/auth-manager.js +9 -9
  64. package/src/managers/braze-instance.js +89 -87
  65. package/src/managers/device-manager.js +17 -17
  66. package/src/managers/network-manager.js +130 -130
  67. package/src/managers/server-config-manager.js +24 -24
  68. package/src/managers/session-manager.js +12 -12
  69. package/src/managers/storage-manager-factory.js +1 -1
  70. package/src/managers/storage-manager.js +31 -31
  71. package/src/managers/subscription-manager.js +2 -2
  72. package/src/models/backend-errors.js +5 -5
  73. package/src/models/braze-event.js +4 -4
  74. package/src/models/device.js +2 -2
  75. package/src/models/request-result.js +1 -1
  76. package/src/models/server-config.js +5 -5
  77. package/src/request-controller.js +130 -130
  78. package/src/triggers/models/filter.js +9 -9
  79. package/src/triggers/models/in-app-message-click-data.js +8 -8
  80. package/src/triggers/models/push-click-data.js +3 -3
  81. package/src/triggers/models/trigger-condition.js +27 -27
  82. package/src/triggers/models/trigger-events.js +1 -1
  83. package/src/triggers/models/trigger.js +7 -7
  84. package/src/triggers/triggers-provider.js +29 -29
  85. package/src/ui/js/attach-css.js +1 -1
  86. package/src/ui/js/feed-css.js +1 -1
  87. package/src/ui/js/iam-css.js +1 -1
  88. package/src/util/base-device-parser.js +7 -7
  89. package/src/util/braze-actions.js +4 -4
  90. package/src/util/browser-detector.js +21 -21
  91. package/src/util/client-hints-parser.js +3 -3
  92. package/src/util/component-utils.js +13 -12
  93. package/src/util/net.js +4 -4
  94. package/src/util/request-header-utils.js +17 -17
  95. package/src/util/user-agent-parser.js +3 -3
  96. package/src/util/window-utils.js +1 -1
@@ -114,10 +114,10 @@ export default class InAppMessage {
114
114
  (this.qe = InAppMessage.TextAlignment.CENTER);
115
115
  }
116
116
  subscribeToClickedEvent(t) {
117
- return this.Et.It(t);
117
+ return this.Et.Nt(t);
118
118
  }
119
119
  subscribeToDismissedEvent(t) {
120
- return this.rh.It(t);
120
+ return this.rh.Nt(t);
121
121
  }
122
122
  removeSubscription(t) {
123
123
  this.Et.removeSubscription(t), this.rh.removeSubscription(t);
@@ -146,14 +146,14 @@ export default class InAppMessage {
146
146
  K() {
147
147
  return !this.Th && ((this.Th = !0), !0);
148
148
  }
149
- Ur() {
149
+ Wr() {
150
150
  return this.Th;
151
151
  }
152
152
  p(t) {
153
- return !this.vo && ((this.vo = !0), this.Et.Dt(), !0);
153
+ return !this.vo && ((this.vo = !0), this.Et.Rt(), !0);
154
154
  }
155
155
  N() {
156
- return !this.oh && ((this.oh = !0), this.rh.Dt(), !0);
156
+ return !this.oh && ((this.oh = !0), this.rh.Rt(), !0);
157
157
  }
158
158
  hide(t) {
159
159
  if (t && t.parentNode) {
@@ -264,37 +264,37 @@ export default class InAppMessage {
264
264
  Y(t) {
265
265
  const s = {};
266
266
  return t
267
- ? ((s[InAppMessage.tt.Vr] = this.message),
268
- (s[InAppMessage.tt.Wr] = this.messageAlignment),
267
+ ? ((s[InAppMessage.tt.Yr] = this.message),
268
+ (s[InAppMessage.tt.Zr] = this.messageAlignment),
269
269
  (s[InAppMessage.tt.Rh] = this.slideFrom),
270
270
  (s[InAppMessage.tt.bt] = this.extras),
271
- (s[InAppMessage.tt.Yr] = this.triggerId),
272
- (s[InAppMessage.tt.Zr] = this.clickAction),
271
+ (s[InAppMessage.tt.ea] = this.triggerId),
272
+ (s[InAppMessage.tt.ra] = this.clickAction),
273
273
  (s[InAppMessage.tt.URI] = this.uri),
274
- (s[InAppMessage.tt.ea] = this.openTarget),
275
- (s[InAppMessage.tt.ra] = this.dismissType),
276
- (s[InAppMessage.tt.sa] = this.duration),
277
- (s[InAppMessage.tt.ta] = this.icon),
274
+ (s[InAppMessage.tt.sa] = this.openTarget),
275
+ (s[InAppMessage.tt.ta] = this.dismissType),
276
+ (s[InAppMessage.tt.ia] = this.duration),
277
+ (s[InAppMessage.tt.aa] = this.icon),
278
278
  (s[InAppMessage.tt.ot] = this.imageUrl),
279
- (s[InAppMessage.tt.ia] = this.imageStyle),
280
- (s[InAppMessage.tt.aa] = this.iconColor),
281
- (s[InAppMessage.tt.oa] = this.iconBackgroundColor),
282
- (s[InAppMessage.tt.pa] = this.backgroundColor),
283
- (s[InAppMessage.tt.ma] = this.textColor),
284
- (s[InAppMessage.tt.na] = this.closeButtonColor),
285
- (s[InAppMessage.tt.ua] = this.animateIn),
286
- (s[InAppMessage.tt.ca] = this.animateOut),
287
- (s[InAppMessage.tt.fa] = this.header),
288
- (s[InAppMessage.tt.da] = this.headerAlignment),
289
- (s[InAppMessage.tt.la] = this.headerTextColor),
290
- (s[InAppMessage.tt.ga] = this.frameColor),
291
- (s[InAppMessage.tt.ja] = this.buttons),
292
- (s[InAppMessage.tt.xa] = this.cropType),
293
- (s[InAppMessage.tt.za] = this.orientation),
294
- (s[InAppMessage.tt.ha] = this.htmlId),
279
+ (s[InAppMessage.tt.oa] = this.imageStyle),
280
+ (s[InAppMessage.tt.pa] = this.iconColor),
281
+ (s[InAppMessage.tt.ma] = this.iconBackgroundColor),
282
+ (s[InAppMessage.tt.na] = this.backgroundColor),
283
+ (s[InAppMessage.tt.ua] = this.textColor),
284
+ (s[InAppMessage.tt.ca] = this.closeButtonColor),
285
+ (s[InAppMessage.tt.fa] = this.animateIn),
286
+ (s[InAppMessage.tt.da] = this.animateOut),
287
+ (s[InAppMessage.tt.la] = this.header),
288
+ (s[InAppMessage.tt.ga] = this.headerAlignment),
289
+ (s[InAppMessage.tt.ja] = this.headerTextColor),
290
+ (s[InAppMessage.tt.xa] = this.frameColor),
291
+ (s[InAppMessage.tt.za] = this.buttons),
292
+ (s[InAppMessage.tt.ha] = this.cropType),
293
+ (s[InAppMessage.tt.va] = this.orientation),
294
+ (s[InAppMessage.tt.wa] = this.htmlId),
295
295
  (s[InAppMessage.tt.CSS] = this.css),
296
296
  (s[InAppMessage.tt.Z] = t),
297
- (s[InAppMessage.tt.va] = this.messageExtras),
297
+ (s[InAppMessage.tt.ya] = this.messageExtras),
298
298
  s)
299
299
  : s;
300
300
  }
@@ -340,11 +340,11 @@ export default class InAppMessage {
340
340
  FIT_CENTER: "FIT_CENTER",
341
341
  }),
342
342
  (InAppMessage.Be = {
343
- Kr: "SLIDEUP",
344
- Jr: "MODAL",
343
+ Qr: "SLIDEUP",
344
+ Lr: "MODAL",
345
345
  Ue: "MODAL_STYLED",
346
- Or: "FULL",
347
- Hr: "WEB_HTML",
346
+ Hr: "FULL",
347
+ Kr: "WEB_HTML",
348
348
  Me: "HTML",
349
349
  Ve: "HTML_FULL",
350
350
  }),
@@ -354,36 +354,36 @@ export default class InAppMessage {
354
354
  (InAppMessage.Ih = "ab-hide"),
355
355
  (InAppMessage.lh = "ab-pause-scrolling"),
356
356
  (InAppMessage.tt = {
357
- Vr: "m",
358
- Wr: "ma",
357
+ Yr: "m",
358
+ Zr: "ma",
359
359
  Rh: "sf",
360
360
  bt: "e",
361
- Yr: "ti",
362
- Zr: "ca",
361
+ ea: "ti",
362
+ ra: "ca",
363
363
  URI: "u",
364
- ea: "oa",
365
- ra: "dt",
366
- sa: "d",
367
- ta: "i",
364
+ sa: "oa",
365
+ ta: "dt",
366
+ ia: "d",
367
+ aa: "i",
368
368
  ot: "iu",
369
- ia: "is",
370
- aa: "ic",
371
- oa: "ibc",
372
- pa: "bc",
373
- ma: "tc",
374
- na: "cbc",
375
- ua: "ai",
376
- ca: "ao",
377
- fa: "h",
378
- da: "ha",
379
- la: "htc",
380
- ga: "fc",
381
- ja: "b",
382
- xa: "ct",
383
- za: "o",
384
- ha: "hi",
369
+ oa: "is",
370
+ pa: "ic",
371
+ ma: "ibc",
372
+ na: "bc",
373
+ ua: "tc",
374
+ ca: "cbc",
375
+ fa: "ai",
376
+ da: "ao",
377
+ la: "h",
378
+ ga: "ha",
379
+ ja: "htc",
380
+ xa: "fc",
381
+ za: "b",
382
+ ha: "ct",
383
+ va: "o",
384
+ wa: "hi",
385
385
  CSS: "css",
386
386
  Z: "type",
387
387
  uo: "messageFields",
388
- va: "me",
388
+ ya: "me",
389
389
  });
@@ -68,21 +68,19 @@ export default class ModalMessage extends InAppMessage {
68
68
  Y() {
69
69
  return super.Y(ModalMessage.it);
70
70
  }
71
- static Xr(e) {
71
+ static Jr(e) {
72
72
  return new ModalMessage(
73
- e[InAppMessage.tt.Vr],
74
- e[InAppMessage.tt.Wr],
75
- e[InAppMessage.tt.bt],
76
73
  e[InAppMessage.tt.Yr],
77
74
  e[InAppMessage.tt.Zr],
78
- e[InAppMessage.tt.URI],
75
+ e[InAppMessage.tt.bt],
79
76
  e[InAppMessage.tt.ea],
80
77
  e[InAppMessage.tt.ra],
78
+ e[InAppMessage.tt.URI],
81
79
  e[InAppMessage.tt.sa],
82
80
  e[InAppMessage.tt.ta],
83
- e[InAppMessage.tt.ot],
84
81
  e[InAppMessage.tt.ia],
85
82
  e[InAppMessage.tt.aa],
83
+ e[InAppMessage.tt.ot],
86
84
  e[InAppMessage.tt.oa],
87
85
  e[InAppMessage.tt.pa],
88
86
  e[InAppMessage.tt.ma],
@@ -93,12 +91,14 @@ export default class ModalMessage extends InAppMessage {
93
91
  e[InAppMessage.tt.da],
94
92
  e[InAppMessage.tt.la],
95
93
  e[InAppMessage.tt.ga],
96
- pe(e[InAppMessage.tt.ja]),
94
+ e[InAppMessage.tt.ja],
97
95
  e[InAppMessage.tt.xa],
96
+ pe(e[InAppMessage.tt.za]),
98
97
  e[InAppMessage.tt.ha],
98
+ e[InAppMessage.tt.wa],
99
99
  e[InAppMessage.tt.CSS],
100
- e[InAppMessage.tt.va],
100
+ e[InAppMessage.tt.ya],
101
101
  );
102
102
  }
103
103
  }
104
- ModalMessage.it = InAppMessage.Be.Jr;
104
+ ModalMessage.it = InAppMessage.Be.Lr;
@@ -79,31 +79,31 @@ export default class SlideUpMessage extends InAppMessage {
79
79
  Y() {
80
80
  return super.Y(SlideUpMessage.it);
81
81
  }
82
- static Xr(e) {
82
+ static Jr(e) {
83
83
  return new SlideUpMessage(
84
- e[InAppMessage.tt.Vr],
85
- e[InAppMessage.tt.Wr],
86
- e[InAppMessage.tt.Rh],
87
- e[InAppMessage.tt.bt],
88
84
  e[InAppMessage.tt.Yr],
89
85
  e[InAppMessage.tt.Zr],
90
- e[InAppMessage.tt.URI],
86
+ e[InAppMessage.tt.Rh],
87
+ e[InAppMessage.tt.bt],
91
88
  e[InAppMessage.tt.ea],
92
89
  e[InAppMessage.tt.ra],
90
+ e[InAppMessage.tt.URI],
93
91
  e[InAppMessage.tt.sa],
94
92
  e[InAppMessage.tt.ta],
95
- e[InAppMessage.tt.ot],
93
+ e[InAppMessage.tt.ia],
96
94
  e[InAppMessage.tt.aa],
97
- e[InAppMessage.tt.oa],
95
+ e[InAppMessage.tt.ot],
98
96
  e[InAppMessage.tt.pa],
99
97
  e[InAppMessage.tt.ma],
100
98
  e[InAppMessage.tt.na],
101
99
  e[InAppMessage.tt.ua],
102
100
  e[InAppMessage.tt.ca],
103
- e[InAppMessage.tt.ha],
101
+ e[InAppMessage.tt.fa],
102
+ e[InAppMessage.tt.da],
103
+ e[InAppMessage.tt.wa],
104
104
  e[InAppMessage.tt.CSS],
105
- e[InAppMessage.tt.va],
105
+ e[InAppMessage.tt.ya],
106
106
  );
107
107
  }
108
108
  }
109
- SlideUpMessage.it = InAppMessage.Be.Kr;
109
+ SlideUpMessage.it = InAppMessage.Be.Qr;
@@ -1,15 +1,15 @@
1
1
  export default class wt {
2
2
  constructor(t, s, i, h, l) {
3
3
  (this.triggerId = t),
4
- (this._r = s),
5
- (this.Mr = i),
6
- (this.Er = h),
7
- (this.Gr = l),
4
+ (this.Gr = s),
5
+ (this.Br = i),
6
+ (this.Nr = h),
7
+ (this.Or = l),
8
8
  (this.triggerId = t),
9
- (this._r = s),
10
- (this.Mr = i),
11
- (this.Er = h),
12
- (this.Gr = l);
9
+ (this.Gr = s),
10
+ (this.Br = i),
11
+ (this.Nr = h),
12
+ (this.Or = l);
13
13
  }
14
14
  static fromJson(t, s, i, h, l) {
15
15
  return null == t || null == t.trigger_id
@@ -17,7 +17,8 @@ import { logger as r } from "../../../shared-lib/index.js";
17
17
  import { toRgba as ie } from "../../util/color-utils.js";
18
18
  import { BRAZE_MUST_BE_INITIALIZED_ERROR as _ } from "../../common/constants.js";
19
19
  import { isIFrame as It } from "../utils/in-app-message-utils.js";
20
- export function showInAppMessage(t, s, o) {
20
+ import ue from "../../l10n/l10n-manager-factory.js";
21
+ export function showInAppMessage(t, o, s) {
21
22
  if (!e.X()) return;
22
23
  if ((ss(), null == t)) return !1;
23
24
  if (t instanceof ControlMessage)
@@ -39,8 +40,8 @@ export function showInAppMessage(t, s, o) {
39
40
  ),
40
41
  !1
41
42
  );
42
- if ((null == s && (s = document.body), t.$e())) {
43
- if (s.querySelectorAll(".ab-modal-interactions").length > 0)
43
+ if ((null == o && (o = document.body), t.$e())) {
44
+ if (o.querySelectorAll(".ab-modal-interactions").length > 0)
44
45
  return (
45
46
  r.info(
46
47
  `Cannot show in-app message ${t.message} because another message is being shown.`,
@@ -56,14 +57,14 @@ export function showInAppMessage(t, s, o) {
56
57
  (e === fe.LANDSCAPE &&
57
58
  t.orientation === InAppMessage.Orientation.PORTRAIT)
58
59
  ) {
59
- const s = e === fe.PORTRAIT ? "portrait" : "landscape",
60
- o =
60
+ const o = e === fe.PORTRAIT ? "portrait" : "landscape",
61
+ s =
61
62
  t.orientation === InAppMessage.Orientation.PORTRAIT
62
63
  ? "portrait"
63
64
  : "landscape";
64
65
  return (
65
66
  r.info(
66
- `Not showing ${o} in-app message ${t.message} because the screen is currently ${s}`,
67
+ `Not showing ${s} in-app message ${t.message} because the screen is currently ${o}`,
67
68
  ),
68
69
  !1
69
70
  );
@@ -72,11 +73,11 @@ export function showInAppMessage(t, s, o) {
72
73
  if (!e.tr()) {
73
74
  let e = !1;
74
75
  if (t.buttons && t.buttons.length > 0) {
75
- const s = t.buttons;
76
- for (let t = 0; t < s.length; t++)
77
- if (s[t].clickAction === InAppMessage.ClickAction.URI) {
78
- const o = s[t].uri;
79
- e = R(o);
76
+ const o = t.buttons;
77
+ for (let t = 0; t < o.length; t++)
78
+ if (o[t].clickAction === InAppMessage.ClickAction.URI) {
79
+ const s = o[t].uri;
80
+ e = R(s);
80
81
  }
81
82
  } else t.clickAction === InAppMessage.ClickAction.URI && (e = R(t.uri));
82
83
  if (e)
@@ -94,14 +95,14 @@ export function showInAppMessage(t, s, o) {
94
95
  n.setAttribute("role", "complementary"),
95
96
  t.Ce() && (n.id = t.htmlId),
96
97
  e.nn(L.jo) && (n.style.zIndex = (e.nn(L.jo) + 1).toString()),
97
- s.appendChild(n),
98
+ o.appendChild(n),
98
99
  t.ve())
99
100
  ) {
100
- const s = document.createElement("style");
101
- (s.innerHTML = t.css),
102
- (s.id = t.we()),
103
- null != e.nn(L.bo) && s.setAttribute("nonce", e.nn(L.bo)),
104
- document.getElementsByTagName("head")[0].appendChild(s);
101
+ const o = document.createElement("style");
102
+ (o.innerHTML = t.css),
103
+ (o.id = t.we()),
104
+ null != e.nn(L.bo) && o.setAttribute("nonce", e.nn(L.bo)),
105
+ document.getElementsByTagName("head")[0].appendChild(o);
105
106
  }
106
107
  const a = t instanceof SlideUpMessage,
107
108
  l = ce(
@@ -111,57 +112,57 @@ export function showInAppMessage(t, s, o) {
111
112
  e.so() ? t.showFeed() : r.error(_);
112
113
  });
113
114
  },
114
- (s) => {
115
+ (o) => {
115
116
  if (t.$e() && t.do()) {
116
- const o = document.createElement("div");
117
+ const s = document.createElement("div");
117
118
  if (
118
- ((o.className = "ab-page-blocker"),
119
- t.ve() || (o.style.backgroundColor = ie(t.frameColor)),
120
- e.nn(L.jo) && (o.style.zIndex = e.nn(L.jo).toString()),
121
- n.appendChild(o),
119
+ ((s.className = "ab-page-blocker"),
120
+ t.ve() || (s.style.backgroundColor = ie(t.frameColor)),
121
+ e.nn(L.jo) && (s.style.zIndex = e.nn(L.jo).toString()),
122
+ n.appendChild(s),
122
123
  !e.nn(L.Lh))
123
124
  ) {
124
125
  const e = new Date().valueOf();
125
- o.onclick = (o) => {
126
+ s.onclick = (s) => {
126
127
  new Date().valueOf() - e > InAppMessage.fh &&
127
- (t.Cr(s), o.stopPropagation());
128
+ (t.Cr(o), s.stopPropagation());
128
129
  };
129
130
  }
130
- n.appendChild(s), s.focus(), t.Oh(n);
131
+ n.appendChild(o), o.focus(), t.Oh(n);
131
132
  } else if (a) {
132
133
  const e = document.querySelectorAll(".ab-slideup");
133
- let o = null;
134
+ let s = null;
134
135
  for (let t = e.length - 1; t >= 0; t--)
135
- if (e[t] !== s) {
136
- o = e[t];
136
+ if (e[t] !== o) {
137
+ s = e[t];
137
138
  break;
138
139
  }
139
140
  if (t.slideFrom === InAppMessage.SlideFrom.TOP) {
140
141
  let e = 0;
141
- null != o && (e = o.offsetTop + o.offsetHeight),
142
- (s.style.top = Math.max(e, 0) + "px");
142
+ null != s && (e = s.offsetTop + s.offsetHeight),
143
+ (o.style.top = Math.max(e, 0) + "px");
143
144
  } else {
144
145
  let e = 0;
145
- null != o &&
146
+ null != s &&
146
147
  (e =
147
148
  (window.innerHeight || document.documentElement.clientHeight) -
148
- o.offsetTop),
149
- (s.style.bottom = Math.max(e, 0) + "px");
149
+ s.offsetTop),
150
+ (o.style.bottom = Math.max(e, 0) + "px");
150
151
  }
151
152
  } else if (i && !e.nn(L.Lh)) {
152
153
  const e = t;
153
- It(s) &&
154
- s.contentWindow &&
155
- s.contentWindow.addEventListener("keydown", function (t) {
154
+ It(o) &&
155
+ o.contentWindow &&
156
+ o.contentWindow.addEventListener("keydown", function (t) {
156
157
  t.keyCode === mt.mh && e.closeMessage();
157
158
  });
158
159
  }
159
160
  logInAppMessageImpression(t),
160
161
  t.dismissType === InAppMessage.DismissType.AUTO_DISMISS &&
161
162
  setTimeout(() => {
162
- n.contains(s) && t.Cr(s);
163
+ n.contains(o) && t.Cr(o);
163
164
  }, t.duration),
164
- "function" == typeof o && o();
165
+ "function" == typeof s && s();
165
166
  },
166
167
  (e) => {
167
168
  r.info(e);
@@ -169,7 +170,8 @@ export function showInAppMessage(t, s, o) {
169
170
  e.nn(L.ho),
170
171
  e.nn(L.jo),
171
172
  e.nn(L.bo),
172
- s,
173
+ o,
174
+ ue.m().wo(),
173
175
  );
174
176
  return (i || a) && (n.appendChild(l), t.Oh(n)), !0;
175
177
  }
@@ -10,12 +10,13 @@ const na = {
10
10
  e.pr(),
11
11
  e.ba(),
12
12
  e.te(),
13
- e.Hs(),
14
- e.nn(L.wa),
15
- e.nn(L.ya),
16
- e.ir(),
13
+ e.Os(),
17
14
  e.nn(L.Ma),
18
15
  e.nn(L._a),
16
+ e.nn(L.ka),
17
+ e.ir(),
18
+ e.nn(L.qa),
19
+ e.nn(L.Aa),
19
20
  e.l(),
20
21
  )),
21
22
  na.i