@codecademy/tracking 1.1.0 → 1.1.1-alpha.a64a969cdf.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/dist/events/track.js +7 -6
- package/dist/events/user.js +1 -1
- package/dist/integrations/fides.js +36 -451
- package/dist/integrations/gtm.js +3 -2
- package/dist/integrations/onetrust.js +4 -190
- package/dist/integrations/partytown/config.js +5 -5
- package/dist/integrations/partytown/index.js +2 -2
- package/package.json +1 -1
package/dist/events/track.js
CHANGED
|
@@ -32,7 +32,7 @@ export const createTracker = _ref => {
|
|
|
32
32
|
if (navigator.sendBeacon && navigator.sendBeacon(uri, form)) {
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
|
-
} catch {
|
|
35
|
+
} catch (_unused) {
|
|
36
36
|
// Even with the proper scoping, Chrome 79-80 still gives "Illegal invocation" crashes. Sigh.
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -74,7 +74,7 @@ export const createTracker = _ref => {
|
|
|
74
74
|
client: getClientType()
|
|
75
75
|
}) : userData;
|
|
76
76
|
if (verbose) {
|
|
77
|
-
console.groupCollapsed(
|
|
77
|
+
console.groupCollapsed("%cTracking Event Fired: ".concat(category, ":").concat(event), 'color: #4b35ef; font-style: italic;');
|
|
78
78
|
console.log({
|
|
79
79
|
category,
|
|
80
80
|
event,
|
|
@@ -90,14 +90,14 @@ export const createTracker = _ref => {
|
|
|
90
90
|
if (typeof window !== 'undefined') {
|
|
91
91
|
// This allows the UTM query params to get registered in the user session.
|
|
92
92
|
const queryParams = window.location.search;
|
|
93
|
-
beacon(
|
|
93
|
+
beacon("".concat(basePath, "/").concat(category).concat(queryParams), {
|
|
94
94
|
category,
|
|
95
95
|
event,
|
|
96
96
|
properties: JSON.stringify(properties),
|
|
97
|
-
gdpr_safe:
|
|
97
|
+
gdpr_safe: "".concat(options.gdprSafe)
|
|
98
98
|
});
|
|
99
99
|
} else {
|
|
100
|
-
serverSideBeacon(
|
|
100
|
+
serverSideBeacon("".concat(basePath, "/").concat(category), {
|
|
101
101
|
category,
|
|
102
102
|
event,
|
|
103
103
|
properties: JSON.stringify(properties)
|
|
@@ -110,7 +110,8 @@ export const createTracker = _ref => {
|
|
|
110
110
|
impression: data => event('user', 'impression', data),
|
|
111
111
|
visit: data => event('user', 'visit', data),
|
|
112
112
|
pushDataLayerEvent: eventName => {
|
|
113
|
-
|
|
113
|
+
var _ref6;
|
|
114
|
+
((_ref6 = window).dataLayer || (_ref6.dataLayer = [])).push({
|
|
114
115
|
event: eventName
|
|
115
116
|
});
|
|
116
117
|
}
|
package/dist/events/user.js
CHANGED
|
@@ -4,466 +4,51 @@ import { theme } from '@codecademy/gamut-styles';
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
const PROPERTY_ID = 'FDS-3RC5S1';
|
|
7
|
-
const FIDES_TIMEOUT = 10000; // 10 seconds
|
|
8
|
-
|
|
9
7
|
const ot_fides_mapping = encodeURIComponent(JSON.stringify({
|
|
10
8
|
C0001: ['essential'],
|
|
11
9
|
C0002: ['analytics'],
|
|
12
10
|
C0003: ['functional'],
|
|
13
11
|
C0004: ['marketing']
|
|
14
12
|
}));
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
13
|
+
const importFides = async () => {
|
|
14
|
+
var _win$define;
|
|
15
|
+
const win = window;
|
|
16
|
+
// Disable AMD globals for the Fides script
|
|
17
|
+
const oldAmd = (_win$define = win.define) === null || _win$define === void 0 ? void 0 : _win$define.amd;
|
|
18
|
+
if (oldAmd) {
|
|
19
|
+
win.define.amd = undefined;
|
|
20
|
+
}
|
|
21
|
+
// Fides gets stored on the window object
|
|
22
|
+
await import(/* webpackIgnore: true */"https://skillsoft-codecademy.fides-cdn.ethyca.com/fides.js?property_id=".concat(PROPERTY_ID, "&ot_fides_mapping=").concat(ot_fides_mapping));
|
|
23
|
+
if (oldAmd) {
|
|
24
|
+
win.define.amd = oldAmd;
|
|
25
|
+
}
|
|
26
|
+
if (!win.Fides) {
|
|
27
|
+
throw new Error('Failed to import Fides');
|
|
28
|
+
}
|
|
29
|
+
return win.Fides;
|
|
30
|
+
};
|
|
31
|
+
export const initializeFides = async () => {
|
|
32
|
+
try {
|
|
33
|
+
const fides = await importFides();
|
|
34
|
+
fides.gtm();
|
|
35
|
+
const unsubscribe = fides.onFidesEvent('FidesUIShown', detail => {
|
|
36
|
+
if (detail.extraDetails.servingComponent === 'banner') {
|
|
37
|
+
const banner = document.getElementById('fides-banner');
|
|
38
|
+
if (banner) {
|
|
39
|
+
banner.setAttribute('tabIndex', '-1');
|
|
40
|
+
}
|
|
38
41
|
}
|
|
42
|
+
unsubscribe();
|
|
39
43
|
});
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
style.textContent = rawStyles;
|
|
47
|
-
document.body.appendChild(style);
|
|
48
|
-
});
|
|
44
|
+
} catch (err) {
|
|
45
|
+
console.error('Error initializing Fides', err);
|
|
46
|
+
}
|
|
47
|
+
const style = document.createElement('style');
|
|
48
|
+
style.textContent = rawStyles;
|
|
49
|
+
document.body.appendChild(style);
|
|
49
50
|
};
|
|
50
51
|
|
|
51
52
|
// For now, these three values duplicate theme colors from gamut-styles
|
|
52
53
|
// We don't want to take a full dependency on that package here...
|
|
53
|
-
const rawStyles = `
|
|
54
|
-
:root {
|
|
55
|
-
/* Colors */
|
|
56
|
-
|
|
57
|
-
--fides-overlay-primary-color: ${theme.colors.hyper};
|
|
58
|
-
--fides-overlay-body-font-color: #484848;
|
|
59
|
-
|
|
60
|
-
/* Buttons */
|
|
61
|
-
|
|
62
|
-
--fides-overlay-primary-button-background-hover-color: ${theme.colors.hyper};
|
|
63
|
-
|
|
64
|
-
/* Toggles */
|
|
65
|
-
--fides-overlay-primary-active-color: var(--fides-overlay-primary-color);
|
|
66
|
-
--fides-overlay-primary-active-disabled-color: #bda4f7;
|
|
67
|
-
--fides-overlay-inactive-color: #cbd5e0;
|
|
68
|
-
--fides-overlay-disabled-color: #e1e7ee;
|
|
69
|
-
|
|
70
|
-
/* Everything else */
|
|
71
|
-
--fides-overlay-button-border-radius: ${theme.borderRadii.md};
|
|
72
|
-
--fides-overlay-font-family: inherit;
|
|
73
|
-
--fides-overlay-font-size-body: 0.875rem !important;
|
|
74
|
-
--fides-overlay-line-height: 1.375rem !important;
|
|
75
|
-
--fides-overlay-padding: padding: 1rem !important;
|
|
76
|
-
--fides-overlay-padding: 0.875rem 1rem !important;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.fides-banner, .fides-modal-container {
|
|
80
|
-
-webkit-font-smoothing: auto;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
div#fides-overlay {
|
|
84
|
-
font-size: var(--fides-overlay-font-size-body);
|
|
85
|
-
line-height: var(--fides-overlay-line-height);
|
|
86
|
-
z-index: 1000;
|
|
87
|
-
position: fixed;
|
|
88
|
-
white-space: pre-line;
|
|
89
|
-
font-family: inherit;
|
|
90
|
-
line-height: calc(1em + 0.4rem);
|
|
91
|
-
-webkit-font-smoothing: auto;
|
|
92
|
-
z-index: 9948031 !important
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
#fides-modal-link {
|
|
96
|
-
cursor: pointer;
|
|
97
|
-
display: none;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
#fides-modal .fides-notice-toggle-title:hover {
|
|
101
|
-
background-color: ${theme.colors.white} !important
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
#fides-modal .fides-modal-content {
|
|
105
|
-
background-color: ${theme.colors.white} !important;
|
|
106
|
-
border:0;
|
|
107
|
-
font-size: 14px;
|
|
108
|
-
line-height: 1.4;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.fides-modal-description a:focus {
|
|
112
|
-
outline: 1px solid ${theme.colors.black} !important;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.fides-notice-toggle-title a:focus {
|
|
116
|
-
outline: 1px solid ${theme.colors.black} !important;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
#fides-modal .fides-notice-toggle, #fides-modal fides-notice-toggle-expanded {
|
|
120
|
-
background-color: ${theme.colors.white} !important;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
#fides-modal .fides-banner-button-secondary.fides-save-button {
|
|
124
|
-
color: var(--fides-overlay-primary-button-background-color) !important;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
#fides-modal .fides-modal-footer {
|
|
128
|
-
background-color: ${theme.colors.white}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
#fides-modal .fides-toggle-display {
|
|
132
|
-
color: transparent;
|
|
133
|
-
padding: 0;
|
|
134
|
-
padding-block: 2px;
|
|
135
|
-
--offset: 0.2em !important;
|
|
136
|
-
--diameter: 1.2em !important;
|
|
137
|
-
background-color: #828285
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.fides-toggle .fides-toggle-input:checked + .fides-toggle-display {
|
|
141
|
-
background-color: var(--fides-overlay-primary-active-color) !important;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
#fides-modal .fides-divider {
|
|
145
|
-
display: none !important
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
#fides-modal .fides-modal-title {
|
|
149
|
-
text-align: left !important;
|
|
150
|
-
font-size: 20px !important;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
div#fides-banner-container {
|
|
154
|
-
bottom: 0 !important;
|
|
155
|
-
left: 0 !important;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
div#fides-banner-container button.fides-banner-button {
|
|
159
|
-
font-size: 16px !important;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
div#fides-banner {
|
|
163
|
-
line-height: var(--fides-overlay-line-height);
|
|
164
|
-
color: var(--fides-overlay-body-font-color) !important;
|
|
165
|
-
width: 100% !important;
|
|
166
|
-
overflow-y: hidden;
|
|
167
|
-
border: 0 !important;
|
|
168
|
-
box-shadow: 0 0 18px rgba(0, 0, 0, 0.2) !important;
|
|
169
|
-
background-color: ${theme.colors.white};
|
|
170
|
-
-webkit-font-smoothing: auto;
|
|
171
|
-
bottom: 1px;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
div#fides-banner:focus {
|
|
175
|
-
outline: 1px solid ${theme.colors.black} !important
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
div#fides-banner-inner {
|
|
179
|
-
display: flex;
|
|
180
|
-
flex-direction: column;
|
|
181
|
-
align-items: center;
|
|
182
|
-
max-width: 1436px;
|
|
183
|
-
margin: 0 auto;
|
|
184
|
-
row-gap: 16px;
|
|
185
|
-
row-gap: unset !important
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/* Responsive banner */
|
|
189
|
-
|
|
190
|
-
div#fides-banner-description {
|
|
191
|
-
margin-top: 0;
|
|
192
|
-
margin-bottom: 10px;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
div#fides-banner-description span {
|
|
196
|
-
line-height: 1.375rem !important;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
div#fides-banner-description > div {
|
|
200
|
-
text-align: center;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
div#fides-banner-description > div a {
|
|
204
|
-
font-weight: bold;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
div#fides-button-group {
|
|
208
|
-
justify-content: center;
|
|
209
|
-
gap: 2em;
|
|
210
|
-
background-color: transparent;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
#fides-banner div#fides-button-group {
|
|
214
|
-
margin-top: 0.5em;
|
|
215
|
-
display: flex;
|
|
216
|
-
display: flex;
|
|
217
|
-
justify-content: center;
|
|
218
|
-
background-color: transparent;
|
|
219
|
-
gap: 16px !important;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
div#fides-button-group .fides-banner-secondary-actions > button {
|
|
223
|
-
cursor: pointer;
|
|
224
|
-
text-decoration: none;
|
|
225
|
-
font-weight: bold;
|
|
226
|
-
padding: 10px 16px !important
|
|
227
|
-
padding-top: 3px !important;
|
|
228
|
-
margin-top: 0;
|
|
229
|
-
border: 1px solid var(--fides-overlay-primary-color);
|
|
230
|
-
border-radius: 2px;
|
|
231
|
-
box-sizing: border-box;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
#fides-banner .fides-acknowledge-button, #fides-banner .fides-manage-preferences-button {
|
|
235
|
-
margin-right: 0px !important;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.fides-modal-footer div#fides-button-group {
|
|
239
|
-
width: 100% !important
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
#fides-modal .fides-modal-button-group.fides-modal-primary-actions {
|
|
243
|
-
margin-left: 0 !important;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.fides-gpc-label {
|
|
247
|
-
display: none !important;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
button.fides-banner-button.fides-banner-button-tertiary {
|
|
251
|
-
background: none;
|
|
252
|
-
border: none;
|
|
253
|
-
padding: 0;
|
|
254
|
-
color: var(--fides-overlay-link-font-color);
|
|
255
|
-
text-decoration: underline;
|
|
256
|
-
cursor: pointer;
|
|
257
|
-
line-height: 2em;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
/** Modal */
|
|
261
|
-
|
|
262
|
-
div.fides-modal-content {
|
|
263
|
-
line-height: var(--fides-overlay-line-height);
|
|
264
|
-
color: var(--fides-overlay-body-font-color) !important;
|
|
265
|
-
box-sizing: border-box;
|
|
266
|
-
padding: var(--fides-overlay-padding);
|
|
267
|
-
border: 1px solid var(--fides-overlay-primary-color);
|
|
268
|
-
background-color: var(--fides-overlay-background-color);
|
|
269
|
-
border-radius: var(--fides-overlay-component-border-radius);
|
|
270
|
-
max-height: 100%;
|
|
271
|
-
max-width: 100%;
|
|
272
|
-
overflow-y: scroll;
|
|
273
|
-
z-index: 2;
|
|
274
|
-
position: fixed;
|
|
275
|
-
top: 50%;
|
|
276
|
-
left: 50%;
|
|
277
|
-
transform: translate(-50%, -50%);
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
.fides-toggle .fides-toggle-display {
|
|
281
|
-
--offset: 0.1em;
|
|
282
|
-
--diameter: 1em;
|
|
283
|
-
/** Because we have a "hidden" attr on this toggle element, some CSS libs customers use may include a global display: none on the hidden attr. To prevent our toggles from being hidden we use !important here **/
|
|
284
|
-
display: inline-flex !important;
|
|
285
|
-
align-items: center;
|
|
286
|
-
justify-content: space-around;
|
|
287
|
-
width: calc(var(--diameter) * 2 + var(--offset) * 2);
|
|
288
|
-
height: calc(var(--diameter) + var(--offset) * 2);
|
|
289
|
-
box-sizing: content-box;
|
|
290
|
-
position: relative;
|
|
291
|
-
border-radius: 100vw;
|
|
292
|
-
background-color: var(--fides-overlay-inactive-color);
|
|
293
|
-
transition: 250ms;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
/* Checked/unchecked states */
|
|
297
|
-
.fides-toggle .fides-toggle-input:checked + .fides-toggle-display {
|
|
298
|
-
background-color: var(--fides-overlay-primary-active-color);
|
|
299
|
-
}
|
|
300
|
-
.fides-toggle .fides-toggle-input:checked + .fides-toggle-display::before {
|
|
301
|
-
transform: translate(100%, -50%);
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
/* Disabled state */
|
|
305
|
-
.fides-toggle .fides-toggle-input:disabled {
|
|
306
|
-
cursor: not-allowed;
|
|
307
|
-
}
|
|
308
|
-
.fides-toggle .fides-toggle-input:disabled + .fides-toggle-display {
|
|
309
|
-
background-color: var(--fides-overlay-disabled-color);
|
|
310
|
-
}
|
|
311
|
-
.fides-toggle .fides-toggle-input:disabled:checked + .fides-toggle-display {
|
|
312
|
-
background-color: var(--fides-overlay-primary-active-disabled-color);
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
/* Focus ring when using keyboard */
|
|
316
|
-
.fides-toggle .fides-toggle-input:focus + .fides-toggle-display {
|
|
317
|
-
/* Firefox only has Highlight, not -webkit-focus-ring-color */
|
|
318
|
-
outline: 1px auto Highlight;
|
|
319
|
-
outline: 1px auto -webkit-focus-ring-color;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
/* Disclosure */
|
|
323
|
-
|
|
324
|
-
.fides-notice-toggle .fides-notice-toggle-title {
|
|
325
|
-
border: 0;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
#fides-modal .fides-modal-secondary-actions {
|
|
329
|
-
display: none !important;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
.fides-notice-toggle .fides-notice-toggle-trigger {
|
|
333
|
-
padding-left: 4px;
|
|
334
|
-
position: relative;
|
|
335
|
-
left: -4px;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
.fides-notice-toggle-trigger > .fides-flex-center.fides-justify-space-between {
|
|
339
|
-
font-weight: bold
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
/* Tabs */
|
|
343
|
-
|
|
344
|
-
.fides-tab-button::focus-visible {
|
|
345
|
-
outline: 1px auto ${theme.colors.black};
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
.fides-tab-button:focus:not(:focus-visible) {
|
|
349
|
-
outline: 4px solid ${theme.colors.hyper} !important;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
.fides-toggle-input.focus-visible + .fides-toggle-display,
|
|
353
|
-
.fides-banner-button.fides-banner-button-primary.focus-visible,
|
|
354
|
-
.fides-banner-button.fides-banner-button-secondary.focus-visible,
|
|
355
|
-
.fides-banner-button.fides-banner-button-tertiary.focus-visible {
|
|
356
|
-
outline: 3px solid ${theme.colors.hyper} !important;
|
|
357
|
-
outline-offset: 2px;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
/* Table */
|
|
361
|
-
|
|
362
|
-
.fides-cookies-table {
|
|
363
|
-
border-collapse: collapse;
|
|
364
|
-
width: 100%;
|
|
365
|
-
text-align: left;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
.fides-cookies-table th {
|
|
369
|
-
text-transform: uppercase;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
.fides-cookies-table td, .fides-cookies-table th {
|
|
373
|
-
border: 1px solid var(--fides-overlay-row-divider-color);
|
|
374
|
-
padding-left: 1.1em;
|
|
375
|
-
padding-right: 0.6em;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
#fides-banner #fides-button-group button {
|
|
379
|
-
font-weight: bold;
|
|
380
|
-
padding: 10px 16px;
|
|
381
|
-
margin-top: 0;
|
|
382
|
-
border: 1px solid var(--fides-overlay-primary-color);
|
|
383
|
-
border-radius: 2px;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
#fides-banner #fides-button-group div:nth-child(2) > button:nth-child(1) {
|
|
387
|
-
background-color: white;
|
|
388
|
-
color: #3a10e5;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
#fides-banner-button-tertiary {
|
|
392
|
-
display: none;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
#fides-banner-heading {
|
|
396
|
-
display: none !important;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
div#fides-banner-inner div#fides-button-group {
|
|
400
|
-
flex-direction: row !important;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
.fides-banner-description a:hover, .fides-modal-description a:hover {
|
|
404
|
-
text-decoration: none;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
#fides-banner-inner-container a.focus-visible {
|
|
408
|
-
outline: 1px solid ${theme.colors.black} !important;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
div#fides-banner-inner div#fides-button-group {
|
|
412
|
-
padding-top: 0 !important
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
#fides-banner .fides-acknowledge-button, #fides-banner .fides-manage-preferences-button {
|
|
416
|
-
width: auto !important
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
#fides-banner .fides-banner-button-group.fides-banner-primary-actions {
|
|
420
|
-
align-items: flex-end !important;
|
|
421
|
-
align-self: stretch !important
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
#fides-banner .fides-banner-button-group.fides-banner-secondary-actions {
|
|
425
|
-
align-items: flex-start !important;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
.fides-notice-toggle:focus-visible {
|
|
429
|
-
outline: 1px solid ${theme.colors.black} !important;
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
@media (min-width: 37.5rem) {
|
|
433
|
-
#fides-banner {
|
|
434
|
-
padding: 0.875rem 1rem !important;
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
${theme.breakpoints.sm} {
|
|
439
|
-
div#fides-button-group .fides-banner-secondary-actions > button {
|
|
440
|
-
padding: 4px 16px !important
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
div#fides-banner-inner {
|
|
444
|
-
row-gap: 16px;
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
#fides-banner {
|
|
448
|
-
padding: 0.875rem 1.25rem !important;
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
@media only screen and (min-width: 1650px) {
|
|
453
|
-
#fides-banner-inner {
|
|
454
|
-
flex-direction: row !important;
|
|
455
|
-
max-width: 1600px !important;
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
#fides-banner-inner-container {
|
|
459
|
-
width: 72%;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
#fides-banner div#fides-button-group {
|
|
463
|
-
width: 28% !important;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
div#fides-banner-description {
|
|
467
|
-
margin-bottom: 0 !important;
|
|
468
|
-
}
|
|
469
|
-
}`;
|
|
54
|
+
const rawStyles = "\n:root {\n /* Colors */\n\n --fides-overlay-primary-color: ".concat(theme.colors.hyper, ";\n --fides-overlay-body-font-color: #484848;\n\n /* Buttons */\n\n --fides-overlay-primary-button-background-hover-color: ").concat(theme.colors.hyper, ";\n\n /* Toggles */\n --fides-overlay-primary-active-color: var(--fides-overlay-primary-color);\n --fides-overlay-primary-active-disabled-color: #bda4f7;\n --fides-overlay-inactive-color: #cbd5e0;\n --fides-overlay-disabled-color: #e1e7ee;\n\n /* Everything else */\n --fides-overlay-button-border-radius: ").concat(theme.borderRadii.md, ";\n --fides-overlay-font-family: inherit;\n --fides-overlay-font-size-body: 0.875rem !important;\n --fides-overlay-line-height: 1.375rem !important;\n --fides-overlay-padding: padding: 1rem !important;\n --fides-overlay-padding: 0.875rem 1rem !important;\n}\n\n.fides-banner, .fides-modal-container {\n -webkit-font-smoothing: auto;\n}\n\ndiv#fides-overlay {\n font-size: var(--fides-overlay-font-size-body);\n line-height: var(--fides-overlay-line-height);\n z-index: 1000;\n position: fixed;\n white-space: pre-line;\n font-family: inherit;\n line-height: calc(1em + 0.4rem);\n -webkit-font-smoothing: auto;\n z-index: 9948031 !important\n}\n\n#fides-modal-link {\n cursor: pointer;\n display: none;\n}\n\n#fides-modal .fides-notice-toggle-title:hover {\n background-color: ").concat(theme.colors.white, " !important\n}\n\n#fides-modal .fides-modal-content {\n background-color: ").concat(theme.colors.white, " !important;\n border:0;\n font-size: 14px;\n line-height: 1.4;\n}\n\n.fides-modal-description a:focus {\n outline: 1px solid ").concat(theme.colors.black, " !important;\n}\n\n.fides-notice-toggle-title a:focus {\n outline: 1px solid ").concat(theme.colors.black, " !important;\n}\n\n#fides-modal .fides-notice-toggle, #fides-modal fides-notice-toggle-expanded {\n background-color: ").concat(theme.colors.white, " !important;\n}\n\n#fides-modal .fides-banner-button-secondary.fides-save-button {\n color: var(--fides-overlay-primary-button-background-color) !important;\n}\n\n#fides-modal .fides-modal-footer {\n background-color: ").concat(theme.colors.white, "\n}\n\n#fides-modal .fides-toggle-display {\n color: transparent;\n padding: 0;\n padding-block: 2px;\n --offset: 0.2em !important;\n --diameter: 1.2em !important;\n background-color: #828285\n}\n\n.fides-toggle .fides-toggle-input:checked + .fides-toggle-display {\n background-color: var(--fides-overlay-primary-active-color) !important;\n}\n\n#fides-modal .fides-divider {\n display: none !important\n}\n\n#fides-modal .fides-modal-title {\n text-align: left !important;\n font-size: 20px !important;\n}\n\ndiv#fides-banner-container {\n bottom: 0 !important;\n left: 0 !important;\n}\n\ndiv#fides-banner-container button.fides-banner-button {\n font-size: 16px !important;\n}\n\ndiv#fides-banner {\n line-height: var(--fides-overlay-line-height);\n color: var(--fides-overlay-body-font-color) !important;\n width: 100% !important;\n overflow-y: hidden;\n border: 0 !important;\n box-shadow: 0 0 18px rgba(0, 0, 0, 0.2) !important;\n background-color: ").concat(theme.colors.white, ";\n -webkit-font-smoothing: auto;\n bottom: 1px;\n}\n\ndiv#fides-banner:focus {\n outline: 1px solid ").concat(theme.colors.black, " !important\n}\n\ndiv#fides-banner-inner {\n display: flex;\n flex-direction: column;\n align-items: center;\n max-width: 1436px;\n margin: 0 auto;\n row-gap: 16px;\n row-gap: unset !important\n}\n\n/* Responsive banner */\n\ndiv#fides-banner-description {\n margin-top: 0;\n margin-bottom: 10px;\n}\n\ndiv#fides-banner-description span {\n line-height: 1.375rem !important;\n}\n\ndiv#fides-banner-description > div {\n text-align: center;\n}\n\ndiv#fides-banner-description > div a {\n font-weight: bold;\n}\n\ndiv#fides-button-group {\n justify-content: center;\n gap: 2em;\n background-color: transparent;\n}\n\n#fides-banner div#fides-button-group {\n margin-top: 0.5em;\n display: flex;\n display: flex;\n justify-content: center;\n background-color: transparent;\n gap: 16px !important;\n}\n\ndiv#fides-button-group .fides-banner-secondary-actions > button {\n cursor: pointer;\n text-decoration: none;\n font-weight: bold;\n padding: 10px 16px !important\n padding-top: 3px !important;\n margin-top: 0;\n border: 1px solid var(--fides-overlay-primary-color);\n border-radius: 2px;\n box-sizing: border-box;\n}\n\n#fides-banner .fides-acknowledge-button, #fides-banner .fides-manage-preferences-button {\n margin-right: 0px !important;\n}\n\n.fides-modal-footer div#fides-button-group {\n width: 100% !important\n}\n\n#fides-modal .fides-modal-button-group.fides-modal-primary-actions {\n margin-left: 0 !important;\n}\n\n.fides-gpc-label {\n display: none !important;\n}\n\nbutton.fides-banner-button.fides-banner-button-tertiary {\n background: none;\n border: none;\n padding: 0;\n color: var(--fides-overlay-link-font-color);\n text-decoration: underline;\n cursor: pointer;\n line-height: 2em;\n}\n\n/** Modal */\n\ndiv.fides-modal-content {\n line-height: var(--fides-overlay-line-height);\n color: var(--fides-overlay-body-font-color) !important;\n box-sizing: border-box;\n padding: var(--fides-overlay-padding);\n border: 1px solid var(--fides-overlay-primary-color);\n background-color: var(--fides-overlay-background-color);\n border-radius: var(--fides-overlay-component-border-radius);\n max-height: 100%;\n max-width: 100%;\n overflow-y: scroll;\n z-index: 2;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n\n.fides-toggle .fides-toggle-display {\n --offset: 0.1em;\n --diameter: 1em;\n /** Because we have a \"hidden\" attr on this toggle element, some CSS libs customers use may include a global display: none on the hidden attr. To prevent our toggles from being hidden we use !important here **/\n display: inline-flex !important;\n align-items: center;\n justify-content: space-around;\n width: calc(var(--diameter) * 2 + var(--offset) * 2);\n height: calc(var(--diameter) + var(--offset) * 2);\n box-sizing: content-box;\n position: relative;\n border-radius: 100vw;\n background-color: var(--fides-overlay-inactive-color);\n transition: 250ms;\n}\n\n/* Checked/unchecked states */\n.fides-toggle .fides-toggle-input:checked + .fides-toggle-display {\n background-color: var(--fides-overlay-primary-active-color);\n}\n.fides-toggle .fides-toggle-input:checked + .fides-toggle-display::before {\n transform: translate(100%, -50%);\n}\n\n/* Disabled state */\n.fides-toggle .fides-toggle-input:disabled {\n cursor: not-allowed;\n}\n.fides-toggle .fides-toggle-input:disabled + .fides-toggle-display {\n background-color: var(--fides-overlay-disabled-color);\n}\n.fides-toggle .fides-toggle-input:disabled:checked + .fides-toggle-display {\n background-color: var(--fides-overlay-primary-active-disabled-color);\n}\n\n/* Focus ring when using keyboard */\n.fides-toggle .fides-toggle-input:focus + .fides-toggle-display {\n /* Firefox only has Highlight, not -webkit-focus-ring-color */\n outline: 1px auto Highlight;\n outline: 1px auto -webkit-focus-ring-color;\n}\n\n/* Disclosure */\n\n.fides-notice-toggle .fides-notice-toggle-title {\n border: 0;\n}\n\n#fides-modal .fides-modal-secondary-actions {\n display: none !important;\n}\n\n.fides-notice-toggle .fides-notice-toggle-trigger {\n padding-left: 4px;\n position: relative;\n left: -4px;\n}\n\n.fides-notice-toggle-trigger > .fides-flex-center.fides-justify-space-between {\n font-weight: bold\n}\n\n/* Tabs */\n\n.fides-tab-button::focus-visible {\n outline: 1px auto ").concat(theme.colors.black, ";\n}\n\n.fides-tab-button:focus:not(:focus-visible) {\n outline: 4px solid ").concat(theme.colors.hyper, " !important;\n}\n\n.fides-toggle-input.focus-visible + .fides-toggle-display,\n.fides-banner-button.fides-banner-button-primary.focus-visible,\n.fides-banner-button.fides-banner-button-secondary.focus-visible,\n.fides-banner-button.fides-banner-button-tertiary.focus-visible {\n outline: 3px solid ").concat(theme.colors.hyper, " !important;\n outline-offset: 2px;\n}\n\n/* Table */\n\n.fides-cookies-table {\n border-collapse: collapse;\n width: 100%;\n text-align: left;\n}\n\n.fides-cookies-table th {\n text-transform: uppercase;\n}\n\n.fides-cookies-table td, .fides-cookies-table th {\n border: 1px solid var(--fides-overlay-row-divider-color);\n padding-left: 1.1em;\n padding-right: 0.6em;\n}\n\n#fides-banner #fides-button-group button {\n font-weight: bold;\n padding: 10px 16px;\n margin-top: 0;\n border: 1px solid var(--fides-overlay-primary-color);\n border-radius: 2px;\n}\n\n#fides-banner #fides-button-group div:nth-child(2) > button:nth-child(1) {\n background-color: white;\n color: #3a10e5;\n}\n\n#fides-banner-button-tertiary {\n display: none;\n}\n\n#fides-banner-heading {\n display: none !important;\n}\n\ndiv#fides-banner-inner div#fides-button-group {\n flex-direction: row !important;\n}\n\n.fides-banner-description a:hover, .fides-modal-description a:hover {\n text-decoration: none;\n}\n\n#fides-banner-inner-container a.focus-visible {\n outline: 1px solid ").concat(theme.colors.black, " !important;\n}\n\ndiv#fides-banner-inner div#fides-button-group {\n padding-top: 0 !important\n}\n\n#fides-banner .fides-acknowledge-button, #fides-banner .fides-manage-preferences-button {\n width: auto !important\n}\n\n#fides-banner .fides-banner-button-group.fides-banner-primary-actions {\n align-items: flex-end !important;\n align-self: stretch !important\n}\n\n#fides-banner .fides-banner-button-group.fides-banner-secondary-actions {\n align-items: flex-start !important;\n}\n\n.fides-notice-toggle:focus-visible {\n outline: 1px solid ").concat(theme.colors.black, " !important;\n}\n\n@media (min-width: 37.5rem) {\n #fides-banner {\n padding: 0.875rem 1rem !important;\n }\n}\n\n").concat(theme.breakpoints.sm, " {\n div#fides-button-group .fides-banner-secondary-actions > button {\n padding: 4px 16px !important\n }\n\n div#fides-banner-inner {\n row-gap: 16px;\n }\n\n #fides-banner {\n padding: 0.875rem 1.25rem !important;\n }\n}\n\n@media only screen and (min-width: 1650px) {\n #fides-banner-inner {\n flex-direction: row !important;\n max-width: 1600px !important;\n }\n\n #fides-banner-inner-container {\n width: 72%;\n }\n\n #fides-banner div#fides-button-group {\n width: 28% !important;\n }\n\n div#fides-banner-description {\n margin-bottom: 0 !important;\n }\n}");
|
package/dist/integrations/gtm.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export const OPT_OUT_DATALAYER_VAR = 'user_opted_out_external_tracking';
|
|
2
2
|
export const initializeGTM = _ref => {
|
|
3
|
+
var _scope$dataLayer;
|
|
3
4
|
let scope = _ref.scope,
|
|
4
5
|
environment = _ref.environment,
|
|
5
6
|
optedOutExternalTracking = _ref.optedOutExternalTracking,
|
|
6
7
|
enablePartytown = _ref.enablePartytown;
|
|
7
|
-
scope.dataLayer
|
|
8
|
+
(_scope$dataLayer = scope.dataLayer) !== null && _scope$dataLayer !== void 0 ? _scope$dataLayer : scope.dataLayer = [];
|
|
8
9
|
scope.dataLayer.push({
|
|
9
10
|
'gtm.start': new Date().getTime(),
|
|
10
11
|
event: 'gtm.js'
|
|
@@ -21,7 +22,7 @@ export const initializeGTM = _ref => {
|
|
|
21
22
|
preview_env = '>m_auth=VrQuCDuWXkLlTwNHJYEKTg>m_preview=env-232';
|
|
22
23
|
}
|
|
23
24
|
const gtm = document.createElement('script');
|
|
24
|
-
gtm.src =
|
|
25
|
+
gtm.src = "https://www.googletagmanager.com/gtm.js?id=GTM-KTLK85W".concat(preview_env);
|
|
25
26
|
if (enablePartytown) {
|
|
26
27
|
gtm.type = 'text/partytown';
|
|
27
28
|
} else {
|
|
@@ -11,15 +11,15 @@ export const initializeOneTrust = async _ref => {
|
|
|
11
11
|
script.setAttribute('async', 'true');
|
|
12
12
|
script.setAttribute('src', 'https://cdn.cookielaw.org/scripttemplates/otSDKStub.js');
|
|
13
13
|
script.setAttribute('type', 'text/javascript');
|
|
14
|
-
script.setAttribute('data-domain-script',
|
|
14
|
+
script.setAttribute('data-domain-script', "".concat(scriptId).concat(environment === 'production' ? '' : '-test'));
|
|
15
15
|
document.body.appendChild(script);
|
|
16
16
|
const style = document.createElement('style');
|
|
17
17
|
style.textContent = rawStyles;
|
|
18
18
|
document.body.appendChild(style);
|
|
19
19
|
return new Promise(resolve => {
|
|
20
20
|
scope.OptanonWrapper = () => {
|
|
21
|
-
var _script$parentNode;
|
|
22
|
-
scope.dataLayer
|
|
21
|
+
var _scope$dataLayer, _script$parentNode;
|
|
22
|
+
(_scope$dataLayer = scope.dataLayer) !== null && _scope$dataLayer !== void 0 ? _scope$dataLayer : scope.dataLayer = [];
|
|
23
23
|
scope.dataLayer.push({
|
|
24
24
|
event: 'OneTrustGroupsUpdated'
|
|
25
25
|
});
|
|
@@ -31,190 +31,4 @@ export const initializeOneTrust = async _ref => {
|
|
|
31
31
|
|
|
32
32
|
// For now, these three values duplicate theme colors from gamut-styles
|
|
33
33
|
// We don't want to take a full dependency on that package here...
|
|
34
|
-
const rawStyles =
|
|
35
|
-
:root {
|
|
36
|
-
--onetrust-brand-purple: #3A10E5;
|
|
37
|
-
--onetrust-color-gray-500: #828285;
|
|
38
|
-
--onetrust-color-white: #fff;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
#onetrust-banner-sdk {
|
|
42
|
-
padding: 1rem !important;
|
|
43
|
-
}
|
|
44
|
-
#onetrust-banner-sdk > .ot-sdk-container {
|
|
45
|
-
width: 100% !important;
|
|
46
|
-
}
|
|
47
|
-
#onetrust-banner-sdk > .ot-sdk-container > .ot-sdk-row {
|
|
48
|
-
display: flex !important;
|
|
49
|
-
flex-direction: column !important;
|
|
50
|
-
align-items: center !important;
|
|
51
|
-
max-width: 1436px !important;
|
|
52
|
-
margin: 0 auto !important;
|
|
53
|
-
}
|
|
54
|
-
#onetrust-banner-sdk > .ot-sdk-container > .ot-sdk-row:after {
|
|
55
|
-
content: none !important;
|
|
56
|
-
}
|
|
57
|
-
#onetrust-banner-sdk > div > .ot-sdk-container > .ot-sdk-row {
|
|
58
|
-
display: flex !important;
|
|
59
|
-
flex-direction: column !important;
|
|
60
|
-
align-items: center !important;
|
|
61
|
-
max-width: 1436px !important;
|
|
62
|
-
margin: 0 auto !important;
|
|
63
|
-
}
|
|
64
|
-
#onetrust-banner-sdk > div > .ot-sdk-container > .ot-sdk-row:after {
|
|
65
|
-
content: none !important;
|
|
66
|
-
}
|
|
67
|
-
#onetrust-group-container {
|
|
68
|
-
display: flex !important;
|
|
69
|
-
justify-content: center;
|
|
70
|
-
float: none !important;
|
|
71
|
-
width: 100% !important;
|
|
72
|
-
max-width: 1148px !important;
|
|
73
|
-
margin-left: 0 !important;
|
|
74
|
-
margin-bottom: 0.625rem !important;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
#onetrust-policy,
|
|
78
|
-
#onetrust-policy-text {
|
|
79
|
-
margin: 0 !important;
|
|
80
|
-
font-size: 0.875rem !important;
|
|
81
|
-
line-height: 1.375rem !important;
|
|
82
|
-
text-align: center !important;
|
|
83
|
-
float: none !important;
|
|
84
|
-
}
|
|
85
|
-
#onetrust-policy-text a {
|
|
86
|
-
text-decoration: none;
|
|
87
|
-
line-height: 26px !important;
|
|
88
|
-
margin-left: 0 !important;
|
|
89
|
-
}
|
|
90
|
-
#onetrust-button-group-parent {
|
|
91
|
-
position: relative !important;
|
|
92
|
-
top: initial !important;
|
|
93
|
-
left: initial !important;
|
|
94
|
-
transform: initial !important;
|
|
95
|
-
width: 264px !important;
|
|
96
|
-
margin: 0 !important;
|
|
97
|
-
padding: 0 !important;
|
|
98
|
-
float: none !important;
|
|
99
|
-
}
|
|
100
|
-
#onetrust-button-group {
|
|
101
|
-
display: flex !important;
|
|
102
|
-
margin: 0 !important;
|
|
103
|
-
}
|
|
104
|
-
#onetrust-pc-btn-handler, #onetrust-accept-btn-handler {
|
|
105
|
-
min-width: initial !important;
|
|
106
|
-
padding: 0.375rem 1rem !important;
|
|
107
|
-
margin: 0 !important;
|
|
108
|
-
opacity: 1 !important;
|
|
109
|
-
border-radius: 2px !important;
|
|
110
|
-
line-height: 1.5 !important;
|
|
111
|
-
user-select: none !important;
|
|
112
|
-
font-size: 1rem !important;
|
|
113
|
-
}
|
|
114
|
-
#onetrust-pc-btn-handler:focus, #onetrust-accept-btn-handler:focus {
|
|
115
|
-
box-shadow: 0 0 0 2px var(--onetrust-color-white), 0 0 0 4px var(--onetrust-brand-purple);
|
|
116
|
-
text-decoration: none !important;
|
|
117
|
-
outline: none !important;
|
|
118
|
-
}
|
|
119
|
-
#onetrust-pc-btn-handler{
|
|
120
|
-
color: var(--onetrust-brand-purple) !important;
|
|
121
|
-
border: 1px solid var(--onetrust-brand-purple)!important;
|
|
122
|
-
background: var(--onetrust-color-white) !important
|
|
123
|
-
}
|
|
124
|
-
#onetrust-accept-btn-handler {
|
|
125
|
-
color: var(--onetrust-color-white) !important;
|
|
126
|
-
background: var(--onetrust-brand-purple)!important;
|
|
127
|
-
margin-left: 1rem !important;
|
|
128
|
-
}
|
|
129
|
-
#onetrust-close-btn-container {
|
|
130
|
-
display: none !important;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.pc-logo {
|
|
134
|
-
display: none !important;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
#accept-recommended-btn-handler,
|
|
138
|
-
.ot-pc-refuse-all-handler,
|
|
139
|
-
.save-preference-btn-handler {
|
|
140
|
-
margin-left: 4px !important;
|
|
141
|
-
font-size: 14px !important;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
#accept-recommended-btn-handler:focus,
|
|
145
|
-
#onetrust-pc-sdk .ot-pc-refuse-all-handler:focus,
|
|
146
|
-
#onetrust-pc-sdk .save-preference-btn-handler:focus {
|
|
147
|
-
box-shadow: 0 0 0 2px var(--onetrust-color-white), 0 0 0 4px var(--onetrust-brand-purple);
|
|
148
|
-
text-decoration: none !important;
|
|
149
|
-
outline: none !important;
|
|
150
|
-
opacity: 1 !important;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.ot-switch-label {
|
|
154
|
-
border: 1px solid var(--onetrust-color-gray-500) !important;
|
|
155
|
-
background-color: var(--onetrust-color-gray-500) !important;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.ot-switch-nob {
|
|
159
|
-
background: var(--onetrust-color-white) !important;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.ot-switch-inner:before {
|
|
163
|
-
background-color: var(--onetrust-brand-purple) !important;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.switch-checkbox:checked+.ot-switch-label .ot-switch-nob {
|
|
167
|
-
border-color: var(--onetrust-brand-purple) !important;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.ot-pc-footer-logo {
|
|
171
|
-
display: none !important;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
#onetrust-banner-sdk>.ot-sdk-container {
|
|
175
|
-
overflow: visible !important;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
#onetrust-pc-sdk .category-item .ot-switch.ot-toggle input:focus + .ot-switch-label {
|
|
179
|
-
outline-color: var(--onetrust-brand-purple) !important;
|
|
180
|
-
}
|
|
181
|
-
#onetrust-pc-sdk .category-item .ot-switch.ot-toggle input:focus+.ot-switch-label {
|
|
182
|
-
outline-width: 3px !important;
|
|
183
|
-
outline-offset: 2px !important;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
@media (max-width: 30rem) {
|
|
187
|
-
#accept-recommended-btn-handler,
|
|
188
|
-
.ot-pc-refuse-all-handler,
|
|
189
|
-
.save-preference-btn-handler {
|
|
190
|
-
width: 96% !important;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
@media (min-width: 37.5rem) {
|
|
195
|
-
#onetrust-banner-sdk {
|
|
196
|
-
padding: 0.875rem 1rem !important;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
@media (min-width: 48rem) {
|
|
200
|
-
#onetrust-banner-sdk {
|
|
201
|
-
padding: 0.875rem 1.25rem !important;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
@media (min-width: 1650px) {
|
|
205
|
-
#onetrust-banner-sdk > .ot-sdk-container > .ot-sdk-row {
|
|
206
|
-
flex-direction: row !important;
|
|
207
|
-
justify-content: space-between !important;
|
|
208
|
-
}
|
|
209
|
-
#onetrust-banner-sdk > div > .ot-sdk-container > .ot-sdk-row {
|
|
210
|
-
flex-direction: row !important;
|
|
211
|
-
justify-content: space-between !important;
|
|
212
|
-
}
|
|
213
|
-
#onetrust-group-container {
|
|
214
|
-
margin-bottom: 0 !important;
|
|
215
|
-
}
|
|
216
|
-
#onetrust-button-group {
|
|
217
|
-
flex-direction: row !important;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
`;
|
|
34
|
+
const rawStyles = "\n:root {\n --onetrust-brand-purple: #3A10E5;\n --onetrust-color-gray-500: #828285;\n --onetrust-color-white: #fff;\n}\n\n#onetrust-banner-sdk {\n padding: 1rem !important;\n}\n#onetrust-banner-sdk > .ot-sdk-container {\n width: 100% !important;\n}\n#onetrust-banner-sdk > .ot-sdk-container > .ot-sdk-row {\n display: flex !important;\n flex-direction: column !important;\n align-items: center !important;\n max-width: 1436px !important;\n margin: 0 auto !important;\n}\n#onetrust-banner-sdk > .ot-sdk-container > .ot-sdk-row:after {\n content: none !important;\n}\n#onetrust-banner-sdk > div > .ot-sdk-container > .ot-sdk-row {\n display: flex !important;\n flex-direction: column !important;\n align-items: center !important;\n max-width: 1436px !important;\n margin: 0 auto !important;\n}\n#onetrust-banner-sdk > div > .ot-sdk-container > .ot-sdk-row:after {\n content: none !important;\n}\n#onetrust-group-container {\n display: flex !important;\n justify-content: center;\n float: none !important;\n width: 100% !important;\n max-width: 1148px !important;\n margin-left: 0 !important;\n margin-bottom: 0.625rem !important;\n}\n\n#onetrust-policy,\n#onetrust-policy-text {\n margin: 0 !important;\n font-size: 0.875rem !important;\n line-height: 1.375rem !important;\n text-align: center !important;\n float: none !important;\n}\n#onetrust-policy-text a {\n text-decoration: none;\n line-height: 26px !important;\n margin-left: 0 !important;\n}\n#onetrust-button-group-parent {\n position: relative !important;\n top: initial !important;\n left: initial !important;\n transform: initial !important;\n width: 264px !important;\n margin: 0 !important;\n padding: 0 !important;\n float: none !important;\n}\n#onetrust-button-group {\n display: flex !important;\n margin: 0 !important;\n}\n#onetrust-pc-btn-handler, #onetrust-accept-btn-handler {\n min-width: initial !important;\n padding: 0.375rem 1rem !important;\n margin: 0 !important;\n opacity: 1 !important;\n border-radius: 2px !important;\n line-height: 1.5 !important;\n user-select: none !important;\n font-size: 1rem !important;\n}\n#onetrust-pc-btn-handler:focus, #onetrust-accept-btn-handler:focus {\n box-shadow: 0 0 0 2px var(--onetrust-color-white), 0 0 0 4px var(--onetrust-brand-purple);\n text-decoration: none !important;\n outline: none !important;\n}\n#onetrust-pc-btn-handler{\n color: var(--onetrust-brand-purple) !important;\n border: 1px solid var(--onetrust-brand-purple)!important;\n background: var(--onetrust-color-white) !important\n}\n#onetrust-accept-btn-handler {\n color: var(--onetrust-color-white) !important;\n background: var(--onetrust-brand-purple)!important;\n margin-left: 1rem !important;\n}\n#onetrust-close-btn-container {\n display: none !important;\n}\n\n.pc-logo {\n display: none !important;\n}\n\n#accept-recommended-btn-handler,\n.ot-pc-refuse-all-handler,\n.save-preference-btn-handler {\n margin-left: 4px !important;\n font-size: 14px !important;\n}\n\n#accept-recommended-btn-handler:focus,\n#onetrust-pc-sdk .ot-pc-refuse-all-handler:focus,\n#onetrust-pc-sdk .save-preference-btn-handler:focus {\n box-shadow: 0 0 0 2px var(--onetrust-color-white), 0 0 0 4px var(--onetrust-brand-purple);\n text-decoration: none !important;\n outline: none !important;\n opacity: 1 !important;\n}\n\n.ot-switch-label {\n border: 1px solid var(--onetrust-color-gray-500) !important;\n background-color: var(--onetrust-color-gray-500) !important;\n}\n\n.ot-switch-nob {\n background: var(--onetrust-color-white) !important;\n}\n\n.ot-switch-inner:before {\n background-color: var(--onetrust-brand-purple) !important;\n}\n\n.switch-checkbox:checked+.ot-switch-label .ot-switch-nob {\n border-color: var(--onetrust-brand-purple) !important;\n}\n\n.ot-pc-footer-logo {\n display: none !important;\n}\n\n#onetrust-banner-sdk>.ot-sdk-container {\n overflow: visible !important;\n}\n\n#onetrust-pc-sdk .category-item .ot-switch.ot-toggle input:focus + .ot-switch-label {\n \toutline-color: var(--onetrust-brand-purple) !important;\n}\n#onetrust-pc-sdk .category-item .ot-switch.ot-toggle input:focus+.ot-switch-label {\n outline-width: 3px !important;\n outline-offset: 2px !important;\n}\n\n@media (max-width: 30rem) {\n #accept-recommended-btn-handler,\n .ot-pc-refuse-all-handler,\n .save-preference-btn-handler {\n width: 96% !important;\n }\n}\n\n@media (min-width: 37.5rem) {\n #onetrust-banner-sdk {\n padding: 0.875rem 1rem !important;\n }\n}\n@media (min-width: 48rem) {\n #onetrust-banner-sdk {\n padding: 0.875rem 1.25rem !important;\n }\n}\n@media (min-width: 1650px) {\n #onetrust-banner-sdk > .ot-sdk-container > .ot-sdk-row {\n flex-direction: row !important;\n justify-content: space-between !important;\n }\n #onetrust-banner-sdk > div > .ot-sdk-container > .ot-sdk-row {\n flex-direction: row !important;\n justify-content: space-between !important;\n }\n #onetrust-group-container {\n margin-bottom: 0 !important;\n }\n #onetrust-button-group {\n flex-direction: row !important;\n }\n}\n";
|
|
@@ -30,14 +30,14 @@ export const partytownConfig = () => ({
|
|
|
30
30
|
* see https://partytown.builder.io/facebook-pixel#proxy-requests
|
|
31
31
|
*/
|
|
32
32
|
if (url.hostname === 'connect.facebook.net') {
|
|
33
|
-
return new URL(
|
|
33
|
+
return new URL("partytown-fb".concat(url.pathname).concat(url.search), location.origin);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/*
|
|
37
37
|
* Proxy Reddit Pixel requests to resolve CORS issues
|
|
38
38
|
*/
|
|
39
39
|
if (url.hostname === 'www.redditstatic.com') {
|
|
40
|
-
return new URL(
|
|
40
|
+
return new URL("partytown-reddit".concat(url.pathname).concat(url.search), location.origin);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/*
|
|
@@ -49,21 +49,21 @@ export const partytownConfig = () => ({
|
|
|
49
49
|
// Google Ads returns a redirect if path has a trailing slash
|
|
50
50
|
p = p.slice(0, -1);
|
|
51
51
|
}
|
|
52
|
-
return new URL(
|
|
52
|
+
return new URL("partytown-googleads".concat(p).concat(url.search), location.origin);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/*
|
|
56
56
|
* Proxy Bing requests to resolve CORS issues
|
|
57
57
|
*/
|
|
58
58
|
if (url.hostname === 'bat.bing.com') {
|
|
59
|
-
return new URL(
|
|
59
|
+
return new URL("partytown-bing".concat(url.pathname).concat(url.search), location.origin);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/*
|
|
63
63
|
* Proxy YouTube requests to resolve CORS issues
|
|
64
64
|
*/
|
|
65
65
|
if (url.hostname === 'www.youtube.com') {
|
|
66
|
-
return new URL(
|
|
66
|
+
return new URL("partytown-youtube".concat(url.pathname).concat(url.search), location.origin);
|
|
67
67
|
}
|
|
68
68
|
return url;
|
|
69
69
|
}
|
|
@@ -3,7 +3,7 @@ import { partytownConfig } from './config';
|
|
|
3
3
|
import { gtmDoubleFrame } from './gtmDoubleFrame';
|
|
4
4
|
|
|
5
5
|
// Encapsulate to avoid collision of global vars aliased in minification.
|
|
6
|
-
const encapsulate = js =>
|
|
6
|
+
const encapsulate = js => "(() => {".concat(js, "})();");
|
|
7
7
|
export function initializePartytown() {
|
|
8
8
|
const ptScript = document.createElement('script');
|
|
9
9
|
ptScript.innerHTML = encapsulate(partytownSnippet(partytownConfig()));
|
|
@@ -19,6 +19,6 @@ export function initializePartytown() {
|
|
|
19
19
|
* restore the style (and remove the added whitespace).
|
|
20
20
|
*/
|
|
21
21
|
const styles = document.createElement('style');
|
|
22
|
-
styles.innerText =
|
|
22
|
+
styles.innerText = "body > img[aria-hidden=true] { position: absolute; }";
|
|
23
23
|
document.head.appendChild(styles);
|
|
24
24
|
}
|
package/package.json
CHANGED