@braze/web-sdk 5.9.1 → 6.1.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.
- package/index.d.ts +209 -283
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +1 -1
- package/shared-lib/event-types.js +27 -29
- package/shared-lib/guid.js +3 -3
- package/shared-lib/indexed-db-adapter.js +22 -22
- package/shared-lib/logger.js +18 -18
- package/shared-lib/supported-options.js +22 -23
- package/src/Banner/banner-factory.js +2 -1
- package/src/Banner/banner-provider-factory.js +7 -7
- package/src/Banner/banner-provider.js +92 -98
- package/src/Banner/banner.js +21 -18
- package/src/Banner/display/banner-to-html.js +18 -30
- package/src/Banner/display/detect-banner-impressions.js +11 -11
- package/src/Banner/get-all-banners.js +5 -5
- package/src/Banner/get-banner.js +7 -7
- package/src/Banner/index.js +0 -1
- package/src/Banner/log-banner-click.js +7 -7
- package/src/Banner/log-banner-impressions.js +9 -9
- package/src/Banner/request-banners-refresh.js +23 -27
- package/src/Banner/subscribe-to-banners-updates.js +9 -9
- package/src/Banner/ui/insert-banner.js +10 -10
- package/src/Card/card-manager-factory.js +7 -7
- package/src/Card/card-manager.js +45 -47
- package/src/Card/display/card-display.js +76 -74
- package/src/Card/index.js +0 -2
- package/src/Card/log-card-dismissal.js +4 -4
- package/src/Card/log-content-card-click.js +9 -2
- package/src/Card/log-content-card-impressions.js +11 -2
- package/src/Card/models/captioned-image.js +21 -21
- package/src/Card/models/card.js +116 -110
- package/src/Card/models/classic-card.js +21 -21
- package/src/Card/models/control-card.js +15 -15
- package/src/Card/models/image-only.js +20 -21
- package/src/Card/util/card-factory.js +58 -79
- package/src/ContentCards/content-cards-provider-factory.js +13 -13
- package/src/ContentCards/content-cards-provider.js +148 -148
- package/src/ContentCards/content-cards.js +21 -13
- package/src/ContentCards/get-cached-content-cards.js +2 -2
- package/src/ContentCards/request-content-cards-refresh.js +2 -2
- package/src/ContentCards/subscribe-to-content-cards-updates.js +8 -8
- package/src/ContentCards/ui/hide-content-cards.js +5 -5
- package/src/ContentCards/ui/show-content-cards.js +35 -35
- package/src/Core/add-sdk-metadata.js +5 -5
- package/src/Core/change-user.js +7 -7
- package/src/Core/destroy.js +2 -2
- package/src/Core/disable-sdk.js +10 -10
- package/src/Core/enable-sdk.js +7 -7
- package/src/Core/get-device-id.js +4 -4
- package/src/Core/get-user.js +1 -1
- package/src/Core/handle-braze-action.js +10 -10
- package/src/Core/is-disabled.js +2 -2
- package/src/Core/is-initialized.js +1 -1
- package/src/Core/log-custom-event.js +18 -18
- package/src/Core/log-purchase.js +19 -19
- package/src/Core/open-session.js +13 -13
- package/src/Core/request-immediate-data-flush.js +1 -1
- package/src/Core/set-logger.js +2 -2
- package/src/Core/toggle-logging.js +2 -2
- package/src/Core/wipe-data.js +9 -9
- package/src/FeatureFlags/feature-flag-factory.js +10 -10
- package/src/FeatureFlags/feature-flag.js +20 -71
- package/src/FeatureFlags/feature-flags-provider-factory.js +7 -7
- package/src/FeatureFlags/feature-flags-provider.js +86 -86
- package/src/FeatureFlags/get-all-feature-flags.js +3 -3
- package/src/FeatureFlags/get-feature-flag.js +3 -3
- package/src/FeatureFlags/log-feature-flag-impression.js +8 -8
- package/src/FeatureFlags/refresh-feature-flags.js +1 -1
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +3 -3
- package/src/InAppMessage/defer-in-app-message.js +4 -4
- package/src/InAppMessage/display/html-message-to-html.js +41 -41
- package/src/InAppMessage/display/in-app-message-to-html.js +145 -139
- package/src/InAppMessage/display/modal-utils.js +40 -42
- package/src/InAppMessage/get-deferred-in-app-message.js +1 -1
- package/src/InAppMessage/in-app-message-factory.js +24 -16
- package/src/InAppMessage/in-app-message-manager-factory.js +5 -5
- package/src/InAppMessage/in-app-message-manager.js +124 -122
- package/src/InAppMessage/log-in-app-message-button-click.js +12 -12
- package/src/InAppMessage/log-in-app-message-click.js +9 -9
- package/src/InAppMessage/log-in-app-message-html-click.js +11 -11
- package/src/InAppMessage/log-in-app-message-impression.js +4 -4
- package/src/InAppMessage/models/control-message.js +5 -5
- package/src/InAppMessage/models/full-screen-message.js +41 -35
- package/src/InAppMessage/models/html-message.js +28 -26
- package/src/InAppMessage/models/in-app-message-button.js +5 -5
- package/src/InAppMessage/models/in-app-message.js +156 -152
- package/src/InAppMessage/models/modal-message.js +40 -34
- package/src/InAppMessage/models/slide-up-message.js +38 -32
- package/src/InAppMessage/models/templated-in-app-message.js +8 -8
- package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
- package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
- package/src/InAppMessage/ui/show-in-app-message.js +68 -74
- package/src/Push/is-push-blocked.js +2 -2
- package/src/Push/is-push-permission-granted.js +2 -2
- package/src/Push/is-push-supported.js +2 -2
- package/src/Push/push-manager-factory.js +17 -17
- package/src/Push/push-manager.js +127 -127
- package/src/Push/request-push-permission.js +1 -1
- package/src/Push/utils/push-utils.js +25 -15
- package/src/User/user-manager.js +20 -20
- package/src/User/user.js +60 -61
- package/src/common/base-provider.js +1 -1
- package/src/common/content-cards-display.js +211 -0
- package/src/common/event-logger.js +12 -12
- package/src/common/properties-base.js +56 -0
- package/src/index.js +0 -1
- package/src/l10n/l10n-manager-factory.js +10 -10
- package/src/l10n/l10n-manager.js +7 -7
- package/src/managers/auth-manager.js +36 -36
- package/src/managers/braze-instance.js +184 -185
- package/src/managers/device-manager.js +26 -26
- package/src/managers/network-manager.js +194 -193
- package/src/managers/server-config-manager.js +75 -75
- package/src/managers/session-manager.js +29 -29
- package/src/managers/storage-manager-factory.js +13 -13
- package/src/managers/storage-manager.js +162 -164
- package/src/managers/subscription-manager.js +12 -12
- package/src/managers/utils.js +1 -1
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +16 -16
- package/src/models/device.js +3 -3
- package/src/models/identifier.js +8 -8
- package/src/models/push-token.js +10 -10
- package/src/models/request-result.js +4 -4
- package/src/models/server-config.js +33 -33
- package/src/request-controller.js +193 -192
- package/src/triggers/models/custom-event-data.js +7 -7
- package/src/triggers/models/custom-event-property-data.js +8 -8
- package/src/triggers/models/filter-set.js +8 -8
- package/src/triggers/models/filter.js +43 -43
- package/src/triggers/models/in-app-message-click-data.js +4 -4
- package/src/triggers/models/purchase-data.js +2 -2
- package/src/triggers/models/purchase-property-data.js +6 -6
- package/src/triggers/models/push-click-data.js +2 -2
- package/src/triggers/models/trigger-condition.js +52 -52
- package/src/triggers/models/trigger-events.js +4 -4
- package/src/triggers/models/trigger.js +19 -19
- package/src/triggers/triggers-provider-factory.js +14 -14
- package/src/triggers/triggers-provider.js +70 -70
- package/src/ui/js/attach-css.js +3 -3
- package/src/ui/js/banner-css.js +1 -1
- package/src/ui/js/iam-css.js +1 -1
- package/src/ui/js/load-font-awesome.js +2 -2
- package/src/util/base-device-parser.js +4 -4
- package/src/util/braze-actions.js +12 -18
- package/src/util/browser-detector.js +27 -20
- package/src/util/client-hints-parser.js +8 -8
- package/src/util/code-utils.js +2 -2
- package/src/util/component-utils.js +14 -14
- package/src/util/deprecation-utils.js +2 -2
- package/src/util/device-constants.js +5 -5
- package/src/util/dom-utils.js +9 -9
- package/src/util/html-display-utils.js +38 -38
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +12 -12
- package/src/util/request-header-utils.js +22 -22
- package/src/util/string-utils.js +2 -2
- package/src/util/user-agent-parser.js +17 -17
- package/src/util/validation-utils.js +28 -28
- package/src/util/window-utils.js +2 -2
- package/src/Card/log-card-click.js +0 -11
- package/src/Card/log-card-impressions.js +0 -13
- package/src/Feed/feed-provider-factory.js +0 -18
- package/src/Feed/feed-provider.js +0 -90
- package/src/Feed/feed.js +0 -20
- package/src/Feed/get-cached-feed.js +0 -5
- package/src/Feed/index.js +0 -8
- package/src/Feed/log-feed-displayed.js +0 -7
- package/src/Feed/request-feed-refresh.js +0 -5
- package/src/Feed/subscribe-to-feed-updates.js +0 -5
- package/src/Feed/types.js +0 -1
- package/src/Feed/ui/hide-feed.js +0 -7
- package/src/Feed/ui/show-feed.js +0 -96
- package/src/Feed/ui/toggle-feed.js +0 -8
- package/src/common/base-feed.js +0 -29
- package/src/common/feed-display.js +0 -211
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { logger as
|
|
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
|
|
7
|
-
import
|
|
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,
|
|
@@ -13,41 +13,41 @@ import h from "../util/request-header-utils.js";
|
|
|
13
13
|
export default class tr extends t {
|
|
14
14
|
constructor(t, s, e, i) {
|
|
15
15
|
super(),
|
|
16
|
-
(this.
|
|
17
|
-
(this.
|
|
18
|
-
(this.
|
|
19
|
-
(this.
|
|
20
|
-
(this.
|
|
21
|
-
(this.
|
|
22
|
-
(this.
|
|
23
|
-
(this.
|
|
24
|
-
(this.
|
|
25
|
-
(this.
|
|
26
|
-
(this.
|
|
27
|
-
(this.
|
|
28
|
-
(this.
|
|
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.
|
|
31
|
-
r.F(this.Ue);
|
|
31
|
+
r.q(this.Ce);
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
N(t) {
|
|
34
34
|
var s;
|
|
35
35
|
if (
|
|
36
|
-
(null === (s = this.
|
|
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.
|
|
40
|
+
this.he = [];
|
|
41
41
|
for (const s of t.feature_flags) {
|
|
42
42
|
const t = at(s);
|
|
43
|
-
t && this.
|
|
43
|
+
t && this.he.push(t);
|
|
44
44
|
}
|
|
45
|
-
(this.
|
|
45
|
+
(this.je = new Date().getTime()), this.Te(), this.Ce.L(this.he);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
De() {
|
|
49
49
|
let t = {};
|
|
50
|
-
this.
|
|
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 tr extends t {
|
|
|
55
55
|
}
|
|
56
56
|
return e;
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
Se() {
|
|
59
59
|
var t;
|
|
60
60
|
return (
|
|
61
|
-
(null === (t = this.
|
|
61
|
+
(null === (t = this.j) || void 0 === t ? void 0 : t.lt(s.ct.qe)) || {}
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
|
-
|
|
65
|
-
this.
|
|
64
|
+
Ne(t) {
|
|
65
|
+
this.j && this.j.ft(s.ct.qe, t);
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
return this.
|
|
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.
|
|
72
|
+
"function" == typeof s && s(), this.Ce.L(this.he);
|
|
73
73
|
};
|
|
74
|
-
if (!this.
|
|
74
|
+
if (!this.ze(e))
|
|
75
75
|
return (
|
|
76
|
-
!this.
|
|
77
|
-
this.
|
|
78
|
-
(this.
|
|
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.
|
|
83
|
+
const o = this.B;
|
|
84
84
|
if (!o) return void r();
|
|
85
|
-
i && this.
|
|
86
|
-
const n = o
|
|
87
|
-
u = o.
|
|
85
|
+
i && this.X();
|
|
86
|
+
const n = o.$({}, !0),
|
|
87
|
+
u = o.A(n, h.H.$e);
|
|
88
88
|
let f = !1;
|
|
89
|
-
o.
|
|
89
|
+
o.J(
|
|
90
90
|
n,
|
|
91
91
|
(i = -1) => {
|
|
92
|
-
const o = this.
|
|
92
|
+
const o = this.B;
|
|
93
93
|
if (!o) return void r();
|
|
94
94
|
const c = new Date().valueOf();
|
|
95
|
-
h.
|
|
95
|
+
h.K(this.j, h.H.$e, c),
|
|
96
96
|
-1 !== i && u.push(["X-Braze-Req-Tokens-Remaining", i.toString()]),
|
|
97
|
-
|
|
98
|
-
url: `${o.
|
|
97
|
+
a.O({
|
|
98
|
+
url: `${o.V()}/feature_flags/sync`,
|
|
99
99
|
headers: u,
|
|
100
100
|
data: n,
|
|
101
|
-
|
|
102
|
-
if (!o.
|
|
103
|
-
o.
|
|
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.
|
|
106
|
+
o._(t, "retrieving feature flags"), (f = !0), r();
|
|
107
107
|
},
|
|
108
|
-
|
|
109
|
-
let
|
|
108
|
+
tt: (i, r) => {
|
|
109
|
+
let a;
|
|
110
110
|
if (f) {
|
|
111
|
-
let t = this.
|
|
112
|
-
(null == t || t < 1e3 * this.
|
|
113
|
-
(
|
|
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.
|
|
115
|
+
o.st(
|
|
116
116
|
r,
|
|
117
117
|
() => {
|
|
118
118
|
this.refreshFeatureFlags(t, s, e, !0);
|
|
119
119
|
},
|
|
120
|
-
h.
|
|
121
|
-
(t) => this.
|
|
122
|
-
() => this.
|
|
123
|
-
|
|
120
|
+
h.H.$e,
|
|
121
|
+
(t) => this.it(t),
|
|
122
|
+
() => this.X(),
|
|
123
|
+
a,
|
|
124
124
|
);
|
|
125
125
|
},
|
|
126
126
|
});
|
|
127
127
|
},
|
|
128
|
-
h.
|
|
128
|
+
h.H.$e,
|
|
129
129
|
s,
|
|
130
130
|
);
|
|
131
131
|
}
|
|
132
|
-
|
|
133
|
-
null != this.
|
|
132
|
+
X() {
|
|
133
|
+
null != this.I && (clearTimeout(this.I), (this.I = null));
|
|
134
134
|
}
|
|
135
|
-
|
|
136
|
-
this.
|
|
135
|
+
it(t) {
|
|
136
|
+
this.X(), (this.I = t);
|
|
137
137
|
}
|
|
138
|
-
|
|
139
|
-
if (!this.
|
|
138
|
+
ze(t) {
|
|
139
|
+
if (!this.h) return !1;
|
|
140
140
|
if (!t) {
|
|
141
|
-
const t = this.
|
|
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
|
|
146
|
-
s = new Date().getTime() >= (this.
|
|
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
|
-
|
|
150
|
+
E.info(`Feature flag refreshes were rate limited to ${t} seconds`), !1
|
|
151
151
|
);
|
|
152
152
|
}
|
|
153
|
-
return this.
|
|
153
|
+
return this.h.Re();
|
|
154
154
|
}
|
|
155
|
-
|
|
155
|
+
Be() {
|
|
156
156
|
var t;
|
|
157
157
|
return (
|
|
158
|
-
(null === (t = this.
|
|
158
|
+
(null === (t = this.j) || void 0 === t ? void 0 : t.lt(s.ct.Me)) || null
|
|
159
159
|
);
|
|
160
160
|
}
|
|
161
|
-
|
|
161
|
+
Xe() {
|
|
162
162
|
var t, e;
|
|
163
|
-
null === (t = this.
|
|
163
|
+
null === (t = this.j) ||
|
|
164
164
|
void 0 === t ||
|
|
165
|
-
t.
|
|
165
|
+
t.ft(s.ct.Me, null === (e = this.C) || void 0 === e ? void 0 : e.bt());
|
|
166
166
|
}
|
|
167
|
-
|
|
167
|
+
_e() {
|
|
168
168
|
var t;
|
|
169
|
-
const s = null === (t = this.
|
|
170
|
-
e = this.
|
|
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
|
-
|
|
174
|
-
if (!this.
|
|
173
|
+
Te() {
|
|
174
|
+
if (!this.j) return;
|
|
175
175
|
const t = {};
|
|
176
|
-
for (const s of this.
|
|
177
|
-
const e = s.
|
|
176
|
+
for (const s of this.he) {
|
|
177
|
+
const e = s.dt();
|
|
178
178
|
t[s.id] = e;
|
|
179
179
|
}
|
|
180
|
-
this.
|
|
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.
|
|
183
|
+
this.X();
|
|
184
184
|
}
|
|
185
185
|
clearData() {
|
|
186
|
-
this.
|
|
186
|
+
this.X();
|
|
187
187
|
}
|
|
188
188
|
}
|
|
@@ -3,9 +3,9 @@ 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.
|
|
7
|
-
if (e && !e.
|
|
8
|
-
const n = nr.
|
|
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
|
}
|
|
@@ -2,8 +2,8 @@ import r from "../managers/braze-instance.js";
|
|
|
2
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.
|
|
6
|
-
if (e && !e.
|
|
7
|
-
const n = nr.
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import { logger as
|
|
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
4
|
import nr from "./feature-flags-provider-factory.js";
|
|
@@ -7,19 +7,19 @@ export function logFeatureFlagImpression(e) {
|
|
|
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 = nr.
|
|
11
|
-
if (!o[e]) return
|
|
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
|
|
14
|
-
const i = nr.
|
|
13
|
+
if (!n) return E.info(t), !1;
|
|
14
|
+
const i = nr.o().Se();
|
|
15
15
|
if (i[n])
|
|
16
16
|
return (
|
|
17
|
-
|
|
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), nr.
|
|
22
|
+
(i[n] = !0), nr.o().Ne(i);
|
|
23
23
|
const s = { fid: e, fts: n };
|
|
24
|
-
return c.
|
|
24
|
+
return c.rt(m.Fr, s).W;
|
|
25
25
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import r from "../managers/braze-instance.js";
|
|
2
2
|
import nr from "./feature-flags-provider-factory.js";
|
|
3
3
|
function ar(e, t, a = !1) {
|
|
4
|
-
if (r.rr()) return nr.
|
|
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);
|
|
@@ -3,10 +3,10 @@ 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 = nr.
|
|
7
|
-
if (e.
|
|
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.
|
|
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
|
|
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
|
-
? (
|
|
9
|
+
? (E.info("Not deferring since this is a ControlMessage."), !1)
|
|
10
10
|
: e instanceof InAppMessage
|
|
11
|
-
? se.ea().
|
|
12
|
-
: (
|
|
11
|
+
? se.ea().Ee(e)
|
|
12
|
+
: (E.info("Not an instance of InAppMessage, ignoring."), !1);
|
|
13
13
|
}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
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
|
-
import { buildHtmlClickHandler as
|
|
5
|
-
import { attachHtmlToIframeWithNonce as
|
|
6
|
-
import { buildBrazeBridge as
|
|
7
|
-
export default function
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import { buildHtmlClickHandler as lt } from "./html-message-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
|
+
export default function ct(t, e, o, s, n) {
|
|
8
|
+
const i = document.createElement("iframe");
|
|
9
|
+
i.setAttribute("title", "Modal Message"),
|
|
10
|
+
s && (i.style.zIndex = (s + 1).toString());
|
|
11
11
|
if (
|
|
12
|
-
(
|
|
13
|
-
(
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
if (null !=
|
|
18
|
-
if (t.
|
|
12
|
+
(b(i, t.message, n),
|
|
13
|
+
(i.onload = () => {
|
|
14
|
+
const s = i.contentWindow;
|
|
15
|
+
s.focus();
|
|
16
|
+
const l = s.document.getElementsByTagName("head")[0];
|
|
17
|
+
if (null != l) {
|
|
18
|
+
if (t.Oe()) {
|
|
19
19
|
const e = document.createElement("style");
|
|
20
20
|
(e.innerHTML = t.css || ""),
|
|
21
|
-
(e.id = t.
|
|
22
|
-
null !=
|
|
23
|
-
|
|
21
|
+
(e.id = t.Ge() || ""),
|
|
22
|
+
null != n && e.setAttribute("nonce", n),
|
|
23
|
+
l.appendChild(e);
|
|
24
24
|
}
|
|
25
|
-
const e =
|
|
26
|
-
null != e && (e.setAttribute("target", "_parent"),
|
|
25
|
+
const e = s.document.createElement("base");
|
|
26
|
+
null != e && (e.setAttribute("target", "_parent"), l.appendChild(e));
|
|
27
27
|
}
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
const
|
|
28
|
+
const a = s.document.getElementsByTagName("title");
|
|
29
|
+
a && a.length > 0 && i.setAttribute("title", a[0].textContent || "");
|
|
30
|
+
const r = Object.assign(
|
|
31
31
|
Object.assign(
|
|
32
32
|
{},
|
|
33
|
-
|
|
33
|
+
N(i, (e, o) => t.ll(e, o)),
|
|
34
34
|
),
|
|
35
35
|
{
|
|
36
36
|
closeMessage: function () {
|
|
37
|
-
t.ll(
|
|
37
|
+
t.ll(i);
|
|
38
38
|
},
|
|
39
39
|
logClick: function () {
|
|
40
40
|
logInAppMessageHtmlClick(t, ...arguments);
|
|
@@ -42,33 +42,33 @@ export default function mt(t, e, o, s, n, i) {
|
|
|
42
42
|
},
|
|
43
43
|
);
|
|
44
44
|
if (
|
|
45
|
-
((
|
|
45
|
+
((s.appboyBridge = r), (s.brazeBridge = r), t.He !== InAppMessage.Ke.Je)
|
|
46
46
|
) {
|
|
47
|
-
const e =
|
|
48
|
-
for (let
|
|
49
|
-
const
|
|
50
|
-
for (let e = 0; e <
|
|
47
|
+
const e = s.document.getElementsByTagName("a");
|
|
48
|
+
for (let s = 0; s < e.length; s++) e[s].onclick = lt(t, i, e[s], o);
|
|
49
|
+
const n = s.document.getElementsByTagName("button");
|
|
50
|
+
for (let e = 0; e < n.length; e++) n[e].onclick = lt(t, i, n[e], o);
|
|
51
51
|
}
|
|
52
|
-
const
|
|
53
|
-
if (null !=
|
|
54
|
-
t.
|
|
52
|
+
const c = s.document.body;
|
|
53
|
+
if (null != c) {
|
|
54
|
+
t.Le() && (c.id = t.htmlId || "");
|
|
55
55
|
const e = document.createElement("hidden");
|
|
56
|
-
(e.onclick =
|
|
56
|
+
(e.onclick = r.closeMessage),
|
|
57
57
|
(e.className = "ab-programmatic-close-button"),
|
|
58
|
-
|
|
58
|
+
c.appendChild(e);
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
-1 !==
|
|
62
|
-
((
|
|
60
|
+
s.dispatchEvent(new CustomEvent("ab.BridgeReady")),
|
|
61
|
+
-1 !== i.className.indexOf("ab-start-hidden") &&
|
|
62
|
+
((i.className = i.className.replace("ab-start-hidden", "")), e(i));
|
|
63
63
|
}),
|
|
64
|
-
(
|
|
64
|
+
(i.className =
|
|
65
65
|
"ab-in-app-message ab-start-hidden ab-html-message ab-modal-interactions"),
|
|
66
|
-
ro.OS === so.
|
|
66
|
+
ro.OS === so.co)
|
|
67
67
|
) {
|
|
68
68
|
const e = document.createElement("div");
|
|
69
69
|
return (
|
|
70
|
-
(e.className = "ab-ios-scroll-wrapper"), e.appendChild(
|
|
70
|
+
(e.className = "ab-ios-scroll-wrapper"), e.appendChild(i), (t.Pe = e), e
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
|
-
return (t.
|
|
73
|
+
return (t.Pe = i), i;
|
|
74
74
|
}
|