@braze/web-sdk 6.0.0 → 6.2.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 (147) hide show
  1. package/index.d.ts +103 -33
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +22 -22
  5. package/shared-lib/guid.js +3 -3
  6. package/shared-lib/indexed-db-adapter.js +19 -19
  7. package/shared-lib/logger.js +18 -18
  8. package/shared-lib/supported-options.js +15 -15
  9. package/src/Banner/banner-factory.js +2 -1
  10. package/src/Banner/banner-provider-factory.js +7 -7
  11. package/src/Banner/banner-provider.js +92 -98
  12. package/src/Banner/banner.js +21 -18
  13. package/src/Banner/display/banner-to-html.js +9 -9
  14. package/src/Banner/display/destroy-banner-html.js +2 -2
  15. package/src/Banner/display/detect-banner-impressions.js +2 -2
  16. package/src/Banner/get-all-banners.js +5 -5
  17. package/src/Banner/get-banner.js +7 -7
  18. package/src/Banner/log-banner-click.js +7 -7
  19. package/src/Banner/log-banner-impressions.js +9 -9
  20. package/src/Banner/request-banners-refresh.js +16 -20
  21. package/src/Banner/subscribe-to-banners-updates.js +7 -7
  22. package/src/Banner/ui/insert-banner.js +6 -6
  23. package/src/Card/card-manager-factory.js +7 -7
  24. package/src/Card/card-manager.js +35 -35
  25. package/src/Card/display/card-display.js +11 -11
  26. package/src/Card/log-card-dismissal.js +4 -4
  27. package/src/Card/log-content-card-click.js +4 -4
  28. package/src/Card/log-content-card-impressions.js +6 -6
  29. package/src/Card/models/captioned-image.js +21 -21
  30. package/src/Card/models/card.js +68 -68
  31. package/src/Card/models/classic-card.js +21 -21
  32. package/src/Card/models/control-card.js +11 -11
  33. package/src/Card/models/image-only.js +18 -18
  34. package/src/Card/util/card-factory.js +35 -35
  35. package/src/ContentCards/content-cards-provider-factory.js +13 -13
  36. package/src/ContentCards/content-cards-provider.js +136 -136
  37. package/src/ContentCards/get-cached-content-cards.js +2 -2
  38. package/src/ContentCards/request-content-cards-refresh.js +2 -2
  39. package/src/ContentCards/subscribe-to-content-cards-updates.js +6 -6
  40. package/src/ContentCards/ui/show-content-cards.js +7 -7
  41. package/src/Core/add-sdk-metadata.js +3 -3
  42. package/src/Core/change-user.js +7 -7
  43. package/src/Core/destroy.js +2 -2
  44. package/src/Core/disable-sdk.js +8 -8
  45. package/src/Core/enable-sdk.js +6 -6
  46. package/src/Core/get-device-id.js +4 -4
  47. package/src/Core/handle-braze-action.js +5 -5
  48. package/src/Core/is-disabled.js +1 -1
  49. package/src/Core/log-custom-event.js +10 -10
  50. package/src/Core/log-purchase.js +13 -13
  51. package/src/Core/open-session.js +10 -10
  52. package/src/Core/set-logger.js +2 -2
  53. package/src/Core/set-sdk-authentication-signature.js +2 -2
  54. package/src/Core/toggle-logging.js +2 -2
  55. package/src/Core/wipe-data.js +7 -7
  56. package/src/FeatureFlags/feature-flag-factory.js +10 -10
  57. package/src/FeatureFlags/feature-flag.js +20 -71
  58. package/src/FeatureFlags/feature-flags-provider-factory.js +12 -12
  59. package/src/FeatureFlags/feature-flags-provider.js +87 -87
  60. package/src/FeatureFlags/get-all-feature-flags.js +4 -4
  61. package/src/FeatureFlags/get-feature-flag.js +4 -4
  62. package/src/FeatureFlags/log-feature-flag-impression.js +9 -9
  63. package/src/FeatureFlags/refresh-feature-flags.js +2 -2
  64. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +4 -4
  65. package/src/InAppMessage/defer-in-app-message.js +4 -4
  66. package/src/InAppMessage/display/html-message-to-html.js +10 -10
  67. package/src/InAppMessage/display/in-app-message-to-html.js +28 -28
  68. package/src/InAppMessage/display/modal-utils.js +7 -7
  69. package/src/InAppMessage/in-app-message-factory.js +15 -15
  70. package/src/InAppMessage/in-app-message-manager-factory.js +5 -5
  71. package/src/InAppMessage/in-app-message-manager.js +100 -100
  72. package/src/InAppMessage/log-in-app-message-button-click.js +9 -9
  73. package/src/InAppMessage/log-in-app-message-click.js +6 -6
  74. package/src/InAppMessage/log-in-app-message-html-click.js +9 -9
  75. package/src/InAppMessage/log-in-app-message-impression.js +4 -4
  76. package/src/InAppMessage/models/control-message.js +4 -4
  77. package/src/InAppMessage/models/full-screen-message.js +35 -35
  78. package/src/InAppMessage/models/html-message.js +21 -21
  79. package/src/InAppMessage/models/in-app-message-button.js +5 -5
  80. package/src/InAppMessage/models/in-app-message.js +75 -75
  81. package/src/InAppMessage/models/modal-message.js +34 -34
  82. package/src/InAppMessage/models/slide-up-message.js +31 -31
  83. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  84. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  85. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  86. package/src/InAppMessage/ui/show-in-app-message.js +19 -19
  87. package/src/Push/push-manager-factory.js +9 -9
  88. package/src/Push/push-manager.js +118 -118
  89. package/src/Push/utils/push-utils.js +9 -9
  90. package/src/User/user-manager.js +20 -20
  91. package/src/User/user.js +44 -45
  92. package/src/common/base-provider.js +1 -1
  93. package/src/common/content-cards-display.js +18 -18
  94. package/src/common/event-logger.js +10 -10
  95. package/src/common/properties-base.js +56 -0
  96. package/src/l10n/l10n-manager-factory.js +7 -7
  97. package/src/l10n/l10n-manager.js +4 -4
  98. package/src/managers/auth-manager.js +32 -32
  99. package/src/managers/braze-instance.js +143 -143
  100. package/src/managers/device-manager.js +22 -22
  101. package/src/managers/network-manager.js +172 -168
  102. package/src/managers/server-config-manager.js +73 -73
  103. package/src/managers/session-manager.js +40 -40
  104. package/src/managers/storage-manager-factory.js +6 -6
  105. package/src/managers/storage-manager.js +97 -97
  106. package/src/managers/subscription-manager.js +12 -12
  107. package/src/managers/utils.js +1 -1
  108. package/src/models/backend-errors.js +5 -5
  109. package/src/models/braze-event.js +5 -5
  110. package/src/models/device.js +2 -2
  111. package/src/models/identifier.js +12 -12
  112. package/src/models/push-token.js +13 -13
  113. package/src/models/request-result.js +4 -4
  114. package/src/models/server-config.js +31 -31
  115. package/src/request-controller.js +159 -159
  116. package/src/triggers/models/custom-event-data.js +1 -1
  117. package/src/triggers/models/custom-event-property-data.js +2 -2
  118. package/src/triggers/models/filter-set.js +6 -6
  119. package/src/triggers/models/filter.js +26 -26
  120. package/src/triggers/models/in-app-message-click-data.js +1 -1
  121. package/src/triggers/models/purchase-data.js +1 -1
  122. package/src/triggers/models/purchase-property-data.js +2 -2
  123. package/src/triggers/models/push-click-data.js +1 -1
  124. package/src/triggers/models/trigger-condition.js +37 -37
  125. package/src/triggers/models/trigger-events.js +3 -3
  126. package/src/triggers/models/trigger.js +16 -16
  127. package/src/triggers/triggers-provider-factory.js +12 -12
  128. package/src/triggers/triggers-provider.js +61 -61
  129. package/src/ui/js/attach-css.js +1 -1
  130. package/src/ui/js/load-font-awesome.js +1 -1
  131. package/src/util/base-device-parser.js +1 -1
  132. package/src/util/braze-actions.js +6 -6
  133. package/src/util/browser-detector.js +22 -13
  134. package/src/util/client-hints-parser.js +6 -6
  135. package/src/util/code-utils.js +2 -2
  136. package/src/util/component-utils.js +1 -1
  137. package/src/util/deprecation-utils.js +2 -2
  138. package/src/util/device-constants.js +4 -4
  139. package/src/util/dom-utils.js +9 -9
  140. package/src/util/html-display-utils.js +7 -7
  141. package/src/util/key-codes.js +1 -1
  142. package/src/util/net.js +12 -12
  143. package/src/util/request-header-utils.js +22 -22
  144. package/src/util/string-utils.js +2 -2
  145. package/src/util/user-agent-parser.js +16 -16
  146. package/src/util/validation-utils.js +12 -12
  147. package/src/util/window-utils.js +2 -2
@@ -1,53 +1,53 @@
1
- import { logger as N } from "../../shared-lib/index.js";
1
+ import { logger as E } from "../../shared-lib/index.js";
2
2
  import t from "../common/base-provider.js";
3
3
  import r from "../managers/braze-instance.js";
4
4
  import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
5
5
  import u from "../managers/subscription-manager.js";
6
- import { randomInclusive as a } from "../util/math.js";
7
- import l from "../util/net.js";
6
+ import { randomInclusive as l } from "../util/math.js";
7
+ import a from "../util/net.js";
8
8
  import {
9
9
  newFeatureFlagFromJson as at,
10
10
  newFeatureFlagFromSerializedValue as ht,
11
11
  } from "./feature-flag-factory.js";
12
12
  import h from "../util/request-header-utils.js";
13
- export default class ir extends t {
13
+ export default class tr extends t {
14
14
  constructor(t, s, e, i) {
15
15
  super(),
16
- (this.B = t),
17
- (this.S = s),
18
- (this.C = e),
19
- (this.T = i),
20
- (this.De = []),
21
- (this.qe = 0),
22
- (this.B = t),
23
- (this.S = s),
24
- (this.C = e),
25
- (this.T = i),
26
- (this.ze = null),
27
- (this.Ue = new u()),
28
- (this.R = 10),
16
+ (this.h = t),
17
+ (this.B = s),
18
+ (this.j = e),
19
+ (this.C = i),
20
+ (this.he = []),
21
+ (this.je = 0),
22
+ (this.h = t),
23
+ (this.B = s),
24
+ (this.j = e),
25
+ (this.C = i),
26
+ (this.ye = null),
27
+ (this.Ce = new u()),
28
+ (this.S = 10),
29
+ (this.T = null),
29
30
  (this.I = null),
30
- (this.q = null),
31
- r.F(this.Ue);
31
+ r.q(this.Ce);
32
32
  }
33
- U(t) {
33
+ N(t) {
34
34
  var s;
35
35
  if (
36
- (null === (s = this.B) || void 0 === s ? void 0 : s.ke()) &&
36
+ (null === (s = this.h) || void 0 === s ? void 0 : s.Re()) &&
37
37
  null != t &&
38
38
  t.feature_flags
39
39
  ) {
40
- this.De = [];
40
+ this.he = [];
41
41
  for (const s of t.feature_flags) {
42
42
  const t = at(s);
43
- t && this.De.push(t);
43
+ t && this.he.push(t);
44
44
  }
45
- (this.qe = new Date().getTime()), this.Be(), this.Ue.X(this.De);
45
+ (this.je = new Date().getTime()), this.Te(), this.Ce.L(this.he);
46
46
  }
47
47
  }
48
- Me() {
48
+ De() {
49
49
  let t = {};
50
- this.C && (t = this.C.ft(s.gt.Xe));
50
+ this.j && (t = this.j.lt(s.ct.Ie));
51
51
  const e = {};
52
52
  for (const s in t) {
53
53
  const i = ht(t[s]);
@@ -55,134 +55,134 @@ export default class ir extends t {
55
55
  }
56
56
  return e;
57
57
  }
58
- _e() {
58
+ Se() {
59
59
  var t;
60
60
  return (
61
- (null === (t = this.C) || void 0 === t ? void 0 : t.ft(s.gt.Ge)) || {}
61
+ (null === (t = this.j) || void 0 === t ? void 0 : t.lt(s.ct.qe)) || {}
62
62
  );
63
63
  }
64
- He(t) {
65
- this.C && this.C.Bt(s.gt.Ge, t);
64
+ Ne(t) {
65
+ this.j && this.j.ft(s.ct.qe, t);
66
66
  }
67
- qt(t) {
68
- return this.Ue.Dt(t);
67
+ St(t) {
68
+ return this.Ce.wt(t);
69
69
  }
70
70
  refreshFeatureFlags(t, s, e = !1, i = !0) {
71
71
  const r = () => {
72
- "function" == typeof s && s(), this.Ue.X(this.De);
72
+ "function" == typeof s && s(), this.Ce.L(this.he);
73
73
  };
74
- if (!this.Je(e))
74
+ if (!this.ze(e))
75
75
  return (
76
- !this.ze &&
77
- this.B &&
78
- (this.ze = this.B.Ke(() => {
76
+ !this.ye &&
77
+ this.h &&
78
+ (this.ye = this.h.Ue(() => {
79
79
  this.refreshFeatureFlags(t, s);
80
80
  })),
81
81
  void r()
82
82
  );
83
- const o = this.S;
83
+ const o = this.B;
84
84
  if (!o) return void r();
85
- i && this.G();
86
- const n = o.H({}, !0),
87
- u = o.J(n, h.O.Le);
85
+ i && this.X();
86
+ const n = o.$({}, !0),
87
+ u = o.A(n, h.H.$e);
88
88
  let f = !1;
89
- o.V(
89
+ o.J(
90
90
  n,
91
91
  (i = -1) => {
92
- const o = this.S;
92
+ const o = this.B;
93
93
  if (!o) return void r();
94
94
  const c = new Date().valueOf();
95
- h.W(this.C, h.O.Le, c),
95
+ h.K(this.j, h.H.$e, c),
96
96
  -1 !== i && u.push(["X-Braze-Req-Tokens-Remaining", i.toString()]),
97
- l.Y({
98
- url: `${o.Z()}/feature_flags/sync`,
97
+ a.O({
98
+ url: `${o.V()}/feature_flags/sync`,
99
99
  headers: u,
100
100
  data: n,
101
- tt: (s) => {
102
- if (!o.st(n, s, u)) return (f = !0), void r();
103
- o.it(), this.U(s), (f = !1), "function" == typeof t && t();
101
+ W: (s) => {
102
+ if (!o.Y(n, s, u)) return (f = !0), void r();
103
+ o.Z(), this.N(s), (f = !1), "function" == typeof t && t();
104
104
  },
105
105
  error: (t) => {
106
- o.et(t, "retrieving feature flags"), (f = !0), r();
106
+ o._(t, "retrieving feature flags"), (f = !0), r();
107
107
  },
108
- nt: (i, r) => {
109
- let n;
108
+ tt: (i, r) => {
109
+ let a;
110
110
  if (f) {
111
- let t = this.I;
112
- (null == t || t < 1e3 * this.R) && (t = 1e3 * this.R),
113
- (n = Math.min(3e5, a(1e3 * this.R, 3 * t)));
111
+ let t = this.T;
112
+ (null == t || t < 1e3 * this.S) && (t = 1e3 * this.S),
113
+ (a = Math.min(3e5, l(1e3 * this.S, 3 * t)));
114
114
  }
115
- o.rt(
115
+ o.st(
116
116
  r,
117
117
  () => {
118
118
  this.refreshFeatureFlags(t, s, e, !0);
119
119
  },
120
- h.O.Le,
121
- (t) => this.ot(t),
122
- () => this.G(),
123
- n,
120
+ h.H.$e,
121
+ (t) => this.it(t),
122
+ () => this.X(),
123
+ a,
124
124
  );
125
125
  },
126
126
  });
127
127
  },
128
- h.O.Le,
128
+ h.H.$e,
129
129
  s,
130
130
  );
131
131
  }
132
- G() {
133
- null != this.q && (clearTimeout(this.q), (this.q = null));
132
+ X() {
133
+ null != this.I && (clearTimeout(this.I), (this.I = null));
134
134
  }
135
- ot(t) {
136
- this.G(), (this.q = t);
135
+ it(t) {
136
+ this.X(), (this.I = t);
137
137
  }
138
- Je(t) {
139
- if (!this.B) return !1;
138
+ ze(t) {
139
+ if (!this.h) return !1;
140
140
  if (!t) {
141
- const t = this.B.Oe();
141
+ const t = this.h.ke();
142
142
  if (null == t) return !1;
143
143
  let s = !1;
144
144
  if (!isNaN(t)) {
145
- if (-1 === t) return N.info("Feature flag refreshes not allowed"), !1;
146
- s = new Date().getTime() >= (this.qe || 0) + 1e3 * t;
145
+ if (-1 === t) return E.info("Feature flag refreshes not allowed"), !1;
146
+ s = new Date().getTime() >= (this.je || 0) + 1e3 * t;
147
147
  }
148
148
  if (!s)
149
149
  return (
150
- N.info(`Feature flag refreshes were rate limited to ${t} seconds`), !1
150
+ E.info(`Feature flag refreshes were rate limited to ${t} seconds`), !1
151
151
  );
152
152
  }
153
- return this.B.ke();
153
+ return this.h.Re();
154
154
  }
155
- Qe() {
155
+ Be() {
156
156
  var t;
157
157
  return (
158
- (null === (t = this.C) || void 0 === t ? void 0 : t.ft(s.gt.Ve)) || null
158
+ (null === (t = this.j) || void 0 === t ? void 0 : t.lt(s.ct.Me)) || null
159
159
  );
160
160
  }
161
- We() {
161
+ Xe() {
162
162
  var t, e;
163
- null === (t = this.C) ||
163
+ null === (t = this.j) ||
164
164
  void 0 === t ||
165
- t.Bt(s.gt.Ve, null === (e = this.T) || void 0 === e ? void 0 : e.St());
165
+ t.ft(s.ct.Me, null === (e = this.C) || void 0 === e ? void 0 : e.bt());
166
166
  }
167
- Ye() {
167
+ _e() {
168
168
  var t;
169
- const s = null === (t = this.T) || void 0 === t ? void 0 : t.St(),
170
- e = this.Qe();
169
+ const s = null === (t = this.C) || void 0 === t ? void 0 : t.bt(),
170
+ e = this.Be();
171
171
  return null == e || s === e;
172
172
  }
173
- Be() {
174
- if (!this.C) return;
173
+ Te() {
174
+ if (!this.j) return;
175
175
  const t = {};
176
- for (const s of this.De) {
177
- const e = s.bt();
176
+ for (const s of this.he) {
177
+ const e = s.dt();
178
178
  t[s.id] = e;
179
179
  }
180
- this.C.Bt(s.gt.Xe, t), this.C.Bt(s.gt.Ze, this.qe), this.We();
180
+ this.j.ft(s.ct.Ie, t), this.j.ft(s.ct.Ae, this.je), this.Xe();
181
181
  }
182
182
  changeUser() {
183
- this.G();
183
+ this.X();
184
184
  }
185
185
  clearData() {
186
- this.G();
186
+ this.X();
187
187
  }
188
188
  }
@@ -1,11 +1,11 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import tr from "./feature-flags-provider-factory.js";
2
+ import nr from "./feature-flags-provider-factory.js";
3
3
  export function getAllFeatureFlags() {
4
4
  if (!r.rr()) return;
5
5
  const t = [],
6
- e = r.v();
7
- if (e && !e.ke()) return t;
8
- const n = tr.m().Me();
6
+ e = r.l();
7
+ if (e && !e.Re()) return t;
8
+ const n = nr.o().De();
9
9
  for (const r in n) t.push(n[r]);
10
10
  return t;
11
11
  }
@@ -1,9 +1,9 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import tr from "./feature-flags-provider-factory.js";
2
+ import nr from "./feature-flags-provider-factory.js";
3
3
  export function getFeatureFlag(t) {
4
4
  if (!r.rr()) return;
5
- const e = r.v();
6
- if (e && !e.ke()) return null;
7
- const n = tr.m().Me();
5
+ const e = r.l();
6
+ if (e && !e.Re()) return null;
7
+ const n = nr.o().De();
8
8
  return n[t] ? n[t] : null;
9
9
  }
@@ -1,25 +1,25 @@
1
- import { logger as N, EventTypes as d } from "../../shared-lib/index.js";
1
+ import { logger as E, EventTypes as m } from "../../shared-lib/index.js";
2
2
  import c from "../common/event-logger.js";
3
3
  import r from "../managers/braze-instance.js";
4
- import tr from "./feature-flags-provider-factory.js";
4
+ import nr from "./feature-flags-provider-factory.js";
5
5
  export function logFeatureFlagImpression(e) {
6
6
  if (!r.rr()) return;
7
7
  if (!e) return !1;
8
8
  const t =
9
9
  "Not logging a feature flag impression. The feature flag was not part of any matching experiment.",
10
- o = tr.m().Me();
11
- if (!o[e]) return N.info(t), !1;
10
+ o = nr.o().De();
11
+ if (!o[e]) return E.info(t), !1;
12
12
  const n = o[e].trackingString;
13
- if (!n) return N.info(t), !1;
14
- const i = tr.m()._e();
13
+ if (!n) return E.info(t), !1;
14
+ const i = nr.o().Se();
15
15
  if (i[n])
16
16
  return (
17
- N.info(
17
+ E.info(
18
18
  "Not logging another feature flag impression. This ID was already logged this session.",
19
19
  ),
20
20
  !1
21
21
  );
22
- (i[n] = !0), tr.m().He(i);
22
+ (i[n] = !0), nr.o().Ne(i);
23
23
  const s = { fid: e, fts: n };
24
- return c.ut(d.yr, s).tt;
24
+ return c.rt(m.Fr, s).W;
25
25
  }
@@ -1,7 +1,7 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import tr from "./feature-flags-provider-factory.js";
2
+ import nr from "./feature-flags-provider-factory.js";
3
3
  function ar(e, t, a = !1) {
4
- if (r.rr()) return tr.m().refreshFeatureFlags(e, t, a);
4
+ if (r.rr()) return nr.o().refreshFeatureFlags(e, t, a);
5
5
  }
6
6
  export function refreshFeatureFlags(r, e) {
7
7
  ar(r, e);
@@ -1,12 +1,12 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import tr from "./feature-flags-provider-factory.js";
2
+ import nr from "./feature-flags-provider-factory.js";
3
3
  import { getAllFeatureFlags } from "./get-all-feature-flags.js";
4
4
  export function subscribeToFeatureFlagsUpdates(t) {
5
5
  if (!r.rr()) return;
6
- const e = tr.m();
7
- if (e.Ye()) {
6
+ const e = nr.o();
7
+ if (e._e()) {
8
8
  const r = getAllFeatureFlags();
9
9
  r && "function" == typeof t && t(r);
10
10
  }
11
- return e.qt(t);
11
+ return e.St(t);
12
12
  }
@@ -1,13 +1,13 @@
1
1
  import InAppMessage from "./models/in-app-message.js";
2
2
  import r from "../managers/braze-instance.js";
3
3
  import ControlMessage from "./models/control-message.js";
4
- import { logger as N } from "../../shared-lib/index.js";
4
+ import { logger as E } from "../../shared-lib/index.js";
5
5
  import se from "./in-app-message-manager-factory.js";
6
6
  export function deferInAppMessage(e) {
7
7
  if (r.rr())
8
8
  return e instanceof ControlMessage
9
- ? (N.info("Not deferring since this is a ControlMessage."), !1)
9
+ ? (E.info("Not deferring since this is a ControlMessage."), !1)
10
10
  : e instanceof InAppMessage
11
- ? se.ea().en(e)
12
- : (N.info("Not an instance of InAppMessage, ignoring."), !1);
11
+ ? se.ea().Ee(e)
12
+ : (E.info("Not an instance of InAppMessage, ignoring."), !1);
13
13
  }
@@ -2,23 +2,23 @@ import ro from "../../util/browser-detector.js";
2
2
  import { InAppMessage, logInAppMessageHtmlClick } from "../index.js";
3
3
  import { OperatingSystems as so } from "../../util/device-constants.js";
4
4
  import { buildHtmlClickHandler as lt } from "./html-message-display-utils.js";
5
- import { attachHtmlToIframeWithNonce as m } from "../../util/html-display-utils.js";
6
- import { buildBrazeBridge as b } from "../../util/html-display-utils.js";
5
+ import { attachHtmlToIframeWithNonce as b } from "../../util/html-display-utils.js";
6
+ import { buildBrazeBridge as N } from "../../util/html-display-utils.js";
7
7
  export default function ct(t, e, o, s, n) {
8
8
  const i = document.createElement("iframe");
9
9
  i.setAttribute("title", "Modal Message"),
10
10
  s && (i.style.zIndex = (s + 1).toString());
11
11
  if (
12
- (m(i, t.message, n),
12
+ (b(i, t.message, n),
13
13
  (i.onload = () => {
14
14
  const s = i.contentWindow;
15
15
  s.focus();
16
16
  const l = s.document.getElementsByTagName("head")[0];
17
17
  if (null != l) {
18
- if (t.lo()) {
18
+ if (t.Oe()) {
19
19
  const e = document.createElement("style");
20
20
  (e.innerHTML = t.css || ""),
21
- (e.id = t.do() || ""),
21
+ (e.id = t.Ge() || ""),
22
22
  null != n && e.setAttribute("nonce", n),
23
23
  l.appendChild(e);
24
24
  }
@@ -30,7 +30,7 @@ export default function ct(t, e, o, s, n) {
30
30
  const r = Object.assign(
31
31
  Object.assign(
32
32
  {},
33
- b(i, (e, o) => t.ll(e, o)),
33
+ N(i, (e, o) => t.ll(e, o)),
34
34
  ),
35
35
  {
36
36
  closeMessage: function () {
@@ -42,7 +42,7 @@ export default function ct(t, e, o, s, n) {
42
42
  },
43
43
  );
44
44
  if (
45
- ((s.appboyBridge = r), (s.brazeBridge = r), t.po !== InAppMessage.ho.bo)
45
+ ((s.appboyBridge = r), (s.brazeBridge = r), t.He !== InAppMessage.Ke.Je)
46
46
  ) {
47
47
  const e = s.document.getElementsByTagName("a");
48
48
  for (let s = 0; s < e.length; s++) e[s].onclick = lt(t, i, e[s], o);
@@ -51,7 +51,7 @@ export default function ct(t, e, o, s, n) {
51
51
  }
52
52
  const c = s.document.body;
53
53
  if (null != c) {
54
- t.jo() && (c.id = t.htmlId || "");
54
+ t.Le() && (c.id = t.htmlId || "");
55
55
  const e = document.createElement("hidden");
56
56
  (e.onclick = r.closeMessage),
57
57
  (e.className = "ab-programmatic-close-button"),
@@ -67,8 +67,8 @@ export default function ct(t, e, o, s, n) {
67
67
  ) {
68
68
  const e = document.createElement("div");
69
69
  return (
70
- (e.className = "ab-ios-scroll-wrapper"), e.appendChild(i), (t.yo = e), e
70
+ (e.className = "ab-ios-scroll-wrapper"), e.appendChild(i), (t.Pe = e), e
71
71
  );
72
72
  }
73
- return (t.yo = i), i;
73
+ return (t.Pe = i), i;
74
74
  }
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  addPassiveEventListener as J,
3
3
  buildSvg as oe,
4
- detectSwipe as H,
5
- DIRECTIONS as K,
4
+ detectSwipe as K,
5
+ DIRECTIONS as L,
6
6
  } from "../../util/dom-utils.js";
7
7
  import { createCloseButton as T } from "../../util/component-utils.js";
8
8
  import { isTransparent as te, toRgba as ae } from "../../util/color-utils.js";
@@ -12,13 +12,13 @@ import InAppMessage from "../models/in-app-message.js";
12
12
  import ModalMessage from "../models/modal-message.js";
13
13
  import SlideUpMessage from "../models/slide-up-message.js";
14
14
  import { logInAppMessageClick } from "../log-in-app-message-click.js";
15
- import { _handleBrazeAction as L } from "../../Core/handle-braze-action.js";
15
+ import { _handleBrazeAction as O } from "../../Core/handle-braze-action.js";
16
16
  import ct from "./html-message-to-html.js";
17
17
  import ne from "./modal-utils.js";
18
- import { logger as N, Guid as O } from "../../../shared-lib/index.js";
18
+ import { logger as E, Guid as P } from "../../../shared-lib/index.js";
19
19
  import { KeyCodes as ie } from "../../util/key-codes.js";
20
20
  export default function le(e, o, t, a, n, i, s = document.body, m = "ltr") {
21
- if (((e.wo = document.activeElement), e instanceof HtmlMessage))
21
+ if (((e.Qe = document.activeElement), e instanceof HtmlMessage))
22
22
  return ct(e, o, a, n, i);
23
23
  const l = (function (e, o, t, a, n, i = document.body, s = "ltr") {
24
24
  let m = null;
@@ -26,10 +26,10 @@ export default function le(e, o, t, a, n, i, s = document.body, m = "ltr") {
26
26
  (l.dir = s),
27
27
  (l.className = "ab-in-app-message ab-start-hidden ab-background"),
28
28
  n && (l.style.zIndex = (n + 1).toString()),
29
- e.vo() &&
29
+ e.Ve() &&
30
30
  ((l.className += " ab-modal-interactions"),
31
31
  l.setAttribute("tabindex", "-1")),
32
- e.lo() ||
32
+ e.Oe() ||
33
33
  ((l.style.color = ae(e.textColor)),
34
34
  (l.style.backgroundColor = ae(e.backgroundColor)),
35
35
  te(e.backgroundColor) && (l.className += " ab-no-shadow"));
@@ -39,7 +39,7 @@ export default function le(e, o, t, a, n, i, s = document.body, m = "ltr") {
39
39
  document.querySelectorAll(".ab-iam-img-loading").length > 0
40
40
  ? t(
41
41
  `Cannot show in-app message ${e.message} because another message is being shown.`,
42
- InAppMessage.xo.ko,
42
+ InAppMessage.Ye.We,
43
43
  )
44
44
  : o(l));
45
45
  },
@@ -52,7 +52,7 @@ export default function le(e, o, t, a, n, i, s = document.body, m = "ltr") {
52
52
  m && (clearTimeout(m), (m = null)),
53
53
  o
54
54
  ? c()
55
- : N.error(
55
+ : E.error(
56
56
  `Cannot show in-app message ${e.message} because the image failed to load.`,
57
57
  ));
58
58
  };
@@ -69,7 +69,7 @@ export default function le(e, o, t, a, n, i, s = document.body, m = "ltr") {
69
69
  e.ll(l, () => {
70
70
  logInAppMessageClick(e),
71
71
  e.clickAction === InAppMessage.ClickAction.URI &&
72
- L(
72
+ O(
73
73
  e.uri || "",
74
74
  a || e.openTarget === InAppMessage.OpenTarget.BLANK,
75
75
  o,
@@ -80,12 +80,12 @@ export default function le(e, o, t, a, n, i, s = document.body, m = "ltr") {
80
80
  );
81
81
  (l.onclick = o),
82
82
  l.addEventListener("keydown", (e) => {
83
- if (e.keyCode === ie.Co || e.keyCode === ie.$o) return o(e);
83
+ if (e.keyCode === ie.Ze || e.keyCode === ie.lo) return o(e);
84
84
  });
85
85
  }
86
86
  const d = T(
87
87
  "Close Message",
88
- e.lo() ? void 0 : ae(e.closeButtonColor),
88
+ e.Oe() ? void 0 : ae(e.closeButtonColor),
89
89
  () => {
90
90
  e.ll(l);
91
91
  },
@@ -96,7 +96,7 @@ export default function le(e, o, t, a, n, i, s = document.body, m = "ltr") {
96
96
  (u.className = "ab-message-text"),
97
97
  (u.dir = s),
98
98
  u.setAttribute("role", "article");
99
- const b = (e.messageAlignment || e.zo).toLowerCase();
99
+ const b = (e.messageAlignment || e.do).toLowerCase();
100
100
  u.className += " " + b + "-aligned";
101
101
  let f = !1;
102
102
  const p = document.createElement("div");
@@ -104,7 +104,7 @@ export default function le(e, o, t, a, n, i, s = document.body, m = "ltr") {
104
104
  const o = document.createElement("img");
105
105
  if (
106
106
  (o.setAttribute("src", e.imageUrl),
107
- e.Lo(o),
107
+ e.bo(o),
108
108
  0 === document.querySelectorAll(".ab-iam-img-loading").length)
109
109
  ) {
110
110
  f = !0;
@@ -131,7 +131,7 @@ export default function le(e, o, t, a, n, i, s = document.body, m = "ltr") {
131
131
  p.className += " ab-icon-area";
132
132
  const o = document.createElement("span");
133
133
  (o.className = "ab-icon"),
134
- e.lo() ||
134
+ e.Oe() ||
135
135
  ((o.style.backgroundColor = ae(e.iconBackgroundColor)),
136
136
  (o.style.color = ae(e.iconColor)));
137
137
  const t = document.createElement("i");
@@ -145,24 +145,24 @@ export default function le(e, o, t, a, n, i, s = document.body, m = "ltr") {
145
145
  }
146
146
  if ((J(u, "touchstart"), e.header && e.header.length > 0)) {
147
147
  const o = document.createElement("h1");
148
- (o.className = "ab-message-header"), (e.Mo = O.ce()), (o.id = e.Mo);
148
+ (o.className = "ab-message-header"), (e.po = P.oe()), (o.id = e.po);
149
149
  const t = (
150
150
  e.headerAlignment || InAppMessage.TextAlignment.CENTER
151
151
  ).toLowerCase();
152
152
  (o.className += " " + t + "-aligned"),
153
- e.lo() || (o.style.color = ae(e.headerTextColor)),
153
+ e.Oe() || (o.style.color = ae(e.headerTextColor)),
154
154
  o.appendChild(document.createTextNode(e.header)),
155
155
  u.appendChild(o);
156
156
  }
157
- const g = e.To();
158
- return u.appendChild(g), l.appendChild(u), f || c(), (e.yo = l), l;
157
+ const g = e.ho();
158
+ return u.appendChild(g), l.appendChild(u), f || c(), (e.Pe = l), l;
159
159
  })(e, o, t, a, n, s, m);
160
160
  if (e instanceof FullScreenMessage || e instanceof ModalMessage) {
161
161
  const o = e instanceof FullScreenMessage ? "ab-fullscreen" : "ab-modal";
162
162
  (l.className += ` ${o} ab-centered`),
163
- ne.qo(e, l, a),
164
- ne.Ao(l),
165
- ne.Bo(e.Mo, l);
163
+ ne.jo(e, l, a),
164
+ ne.wo(l),
165
+ ne.vo(e.po, l);
166
166
  } else if (e instanceof SlideUpMessage) {
167
167
  (l.className += " ab-slideup"),
168
168
  l.setAttribute("tabindex", "0"),
@@ -172,23 +172,23 @@ export default function le(e, o, t, a, n, i, s = document.body, m = "ltr") {
172
172
  const t = oe(
173
173
  "0 0 11.38 19.44",
174
174
  "M11.38 9.72l-9.33 9.72L0 17.3l7.27-7.58L0 2.14 2.05 0l9.33 9.72z",
175
- e.lo() ? void 0 : ae(e.closeButtonColor),
175
+ e.Oe() ? void 0 : ae(e.closeButtonColor),
176
176
  );
177
177
  t.setAttribute("class", `ab-chevron ${m}`), o.appendChild(t);
178
178
  }
179
179
  let t, a;
180
- H(l, K.ie, (e) => {
180
+ K(l, L.Zt, (e) => {
181
181
  (l.className += " ab-swiped-left"),
182
182
  null != o && null != o.onclick && o.onclick(e);
183
183
  }),
184
- H(l, K.de, (e) => {
184
+ K(l, L.ae, (e) => {
185
185
  (l.className += " ab-swiped-right"),
186
186
  null != o && null != o.onclick && o.onclick(e);
187
187
  }),
188
188
  e.slideFrom === InAppMessage.SlideFrom.TOP
189
- ? ((t = K.Do), (a = " ab-swiped-up"))
190
- : ((t = K.Eo), (a = " ab-swiped-down")),
191
- H(l, t, (e) => {
189
+ ? ((t = L.ko), (a = " ab-swiped-up"))
190
+ : ((t = L.xo), (a = " ab-swiped-down")),
191
+ K(l, t, (e) => {
192
192
  (l.className += a), null != o && null != o.onclick && o.onclick(e);
193
193
  });
194
194
  }