@codecademy/tracking 1.6.1-alpha.fac52eba8.0 → 1.6.1

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.
@@ -55,7 +55,7 @@ export const createTracker = _ref => {
55
55
  if (navigator.sendBeacon && navigator.sendBeacon(uri, form)) {
56
56
  return;
57
57
  }
58
- } catch {
58
+ } catch (_unused) {
59
59
  // Even with the proper scoping, Chrome 79-80 still gives "Illegal invocation" crashes. Sigh.
60
60
  }
61
61
 
@@ -97,7 +97,7 @@ export const createTracker = _ref => {
97
97
  client: getClientType()
98
98
  }) : userData;
99
99
  if (verbose) {
100
- console.groupCollapsed(`%cTracking Event Fired: ${category}:${event}`, 'color: #4b35ef; font-style: italic;');
100
+ console.groupCollapsed("%cTracking Event Fired: ".concat(category, ":").concat(event), 'color: #4b35ef; font-style: italic;');
101
101
  console.log({
102
102
  category,
103
103
  event,
@@ -113,14 +113,14 @@ export const createTracker = _ref => {
113
113
  if (typeof window !== 'undefined') {
114
114
  // This allows the UTM query params to get registered in the user session.
115
115
  const queryParams = window.location.search;
116
- beacon(`${basePath}/${category}${queryParams}`, {
116
+ beacon("".concat(basePath, "/").concat(category).concat(queryParams), {
117
117
  category,
118
118
  event,
119
119
  properties: JSON.stringify(properties),
120
- gdpr_safe: `${options.gdprSafe}`
120
+ gdpr_safe: "".concat(options.gdprSafe)
121
121
  });
122
122
  } else {
123
- serverSideBeacon(`${basePath}/${category}`, {
123
+ serverSideBeacon("".concat(basePath, "/").concat(category), {
124
124
  category,
125
125
  event,
126
126
  properties: JSON.stringify(properties)
@@ -133,7 +133,8 @@ export const createTracker = _ref => {
133
133
  impression: data => event('user', 'impression', data),
134
134
  visit: data => event('user', 'visit', data),
135
135
  pushDataLayerEvent: eventName => {
136
- (window.dataLayer ||= []).push({
136
+ var _ref6;
137
+ ((_ref6 = window).dataLayer || (_ref6.dataLayer = [])).push({
137
138
  event: eventName
138
139
  });
139
140
  },
@@ -141,7 +142,8 @@ export const createTracker = _ref => {
141
142
  if (!contentIds) return;
142
143
  const hashedId = await getHashedContentId(contentIds);
143
144
  if (hashedId) {
144
- (window.dataLayer ||= []).push({
145
+ var _ref7;
146
+ ((_ref7 = window).dataLayer || (_ref7.dataLayer = [])).push({
145
147
  event: 'content_id_loaded',
146
148
  content_id: hashedId
147
149
  });
@@ -1,5 +1,5 @@
1
1
  export const fetchUser = async apiBaseUrl => {
2
- const response = await fetch(`${apiBaseUrl}/users/web`, {
2
+ const response = await fetch("".concat(apiBaseUrl, "/users/web"), {
3
3
  method: 'GET',
4
4
  headers: {
5
5
  'Content-type': 'application/json',
@@ -23,7 +23,7 @@ const importFides = async () => {
23
23
  };
24
24
 
25
25
  // Fides gets stored on the window object
26
- await import(/* webpackIgnore: true */`https://skillsoft-codecademy.fides-cdn.ethyca.com/fides.js?property_id=${PROPERTY_ID}&ot_fides_mapping=${ot_fides_mapping}`);
26
+ 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));
27
27
  if (oldAmd) {
28
28
  win.define.amd = oldAmd;
29
29
  }
@@ -55,420 +55,4 @@ export const initializeFides = async () => {
55
55
 
56
56
  // For now, these three values duplicate theme colors from gamut-styles
57
57
  // We don't want to take a full dependency on that package here...
58
- const rawStyles = `
59
- :root {
60
- /* Colors */
61
-
62
- --fides-overlay-primary-color: ${theme.colors.hyper};
63
- --fides-overlay-body-font-color: #484848;
64
-
65
- /* Buttons */
66
-
67
- --fides-overlay-primary-button-background-hover-color: ${theme.colors.hyper};
68
-
69
- /* Toggles */
70
- --fides-overlay-primary-active-color: var(--fides-overlay-primary-color);
71
- --fides-overlay-primary-active-disabled-color: #bda4f7;
72
- --fides-overlay-inactive-color: #cbd5e0;
73
- --fides-overlay-disabled-color: #e1e7ee;
74
-
75
- /* Everything else */
76
- --fides-overlay-button-border-radius: ${theme.borderRadii.md};
77
- --fides-overlay-font-family: inherit;
78
- --fides-overlay-font-size-body: 0.875rem !important;
79
- --fides-overlay-line-height: 1.375rem !important;
80
- --fides-overlay-padding: padding: 1rem !important;
81
- --fides-overlay-padding: 0.875rem 1rem !important;
82
- }
83
-
84
- .fides-banner, .fides-modal-container {
85
- -webkit-font-smoothing: auto;
86
- }
87
-
88
- div#fides-overlay {
89
- font-size: var(--fides-overlay-font-size-body);
90
- line-height: var(--fides-overlay-line-height);
91
- z-index: 1000;
92
- position: fixed;
93
- white-space: pre-line;
94
- font-family: inherit;
95
- line-height: calc(1em + 0.4rem);
96
- -webkit-font-smoothing: auto;
97
- z-index: 9948031 !important
98
- }
99
-
100
- #fides-modal-link {
101
- cursor: pointer;
102
- display: none;
103
- }
104
-
105
- #fides-modal .fides-notice-toggle-title:hover {
106
- background-color: ${theme.colors.white} !important
107
- }
108
-
109
- #fides-modal .fides-modal-content {
110
- background-color: ${theme.colors.white} !important;
111
- border:0;
112
- font-size: 14px;
113
- line-height: 1.4;
114
- }
115
-
116
- .fides-modal-description a:focus {
117
- outline: 1px solid ${theme.colors.black} !important;
118
- }
119
-
120
- .fides-notice-toggle-title a:focus {
121
- outline: 1px solid ${theme.colors.black} !important;
122
- }
123
-
124
- #fides-modal .fides-notice-toggle, #fides-modal fides-notice-toggle-expanded {
125
- background-color: ${theme.colors.white} !important;
126
- }
127
-
128
- #fides-modal .fides-banner-button-secondary.fides-save-button {
129
- color: var(--fides-overlay-primary-button-background-color) !important;
130
- }
131
-
132
- #fides-modal .fides-modal-footer {
133
- background-color: ${theme.colors.white}
134
- }
135
-
136
- #fides-modal .fides-toggle-display {
137
- color: transparent;
138
- padding: 0;
139
- padding-block: 2px;
140
- --offset: 0.2em !important;
141
- --diameter: 1.2em !important;
142
- background-color: #828285
143
- }
144
-
145
- .fides-toggle .fides-toggle-input:checked + .fides-toggle-display {
146
- background-color: var(--fides-overlay-primary-active-color) !important;
147
- }
148
-
149
- #fides-modal .fides-divider {
150
- display: none !important
151
- }
152
-
153
- #fides-modal .fides-modal-title {
154
- text-align: left !important;
155
- font-size: 20px !important;
156
- }
157
-
158
- div#fides-banner-container {
159
- bottom: 0 !important;
160
- left: 0 !important;
161
- }
162
-
163
- div#fides-banner-container button.fides-banner-button {
164
- font-size: 16px !important;
165
- }
166
-
167
- div#fides-banner {
168
- line-height: var(--fides-overlay-line-height);
169
- color: var(--fides-overlay-body-font-color) !important;
170
- width: 100% !important;
171
- overflow-y: hidden;
172
- border: 0 !important;
173
- box-shadow: 0 0 18px rgba(0, 0, 0, 0.2) !important;
174
- background-color: ${theme.colors.white};
175
- -webkit-font-smoothing: auto;
176
- bottom: 1px;
177
- }
178
-
179
- div#fides-banner:focus {
180
- outline: 1px solid ${theme.colors.black} !important
181
- }
182
-
183
- div#fides-banner-inner {
184
- display: flex;
185
- flex-direction: column;
186
- align-items: center;
187
- max-width: 1436px;
188
- margin: 0 auto;
189
- row-gap: 16px;
190
- row-gap: unset !important
191
- }
192
-
193
- /* Responsive banner */
194
-
195
- div#fides-banner-description {
196
- margin-top: 0;
197
- margin-bottom: 10px;
198
- }
199
-
200
- div#fides-banner-description span {
201
- line-height: 1.375rem !important;
202
- }
203
-
204
- div#fides-banner-description > div {
205
- text-align: center;
206
- }
207
-
208
- div#fides-banner-description > div a {
209
- font-weight: bold;
210
- }
211
-
212
- div#fides-button-group {
213
- justify-content: center;
214
- gap: 2em;
215
- background-color: transparent;
216
- }
217
-
218
- #fides-banner div#fides-button-group {
219
- margin-top: 0.5em;
220
- display: flex;
221
- display: flex;
222
- justify-content: center;
223
- background-color: transparent;
224
- gap: 16px !important;
225
- }
226
-
227
- div#fides-button-group .fides-banner-secondary-actions > button {
228
- cursor: pointer;
229
- text-decoration: none;
230
- font-weight: bold;
231
- padding: 10px 16px !important
232
- padding-top: 3px !important;
233
- margin-top: 0;
234
- border: 1px solid var(--fides-overlay-primary-color);
235
- border-radius: 2px;
236
- box-sizing: border-box;
237
- }
238
-
239
- #fides-banner .fides-acknowledge-button, #fides-banner .fides-manage-preferences-button {
240
- margin-right: 0px !important;
241
- }
242
-
243
- .fides-modal-footer div#fides-button-group {
244
- width: 100% !important
245
- }
246
-
247
- #fides-modal .fides-modal-button-group.fides-modal-primary-actions {
248
- margin-left: 0 !important;
249
- }
250
-
251
- .fides-gpc-label {
252
- display: none !important;
253
- }
254
-
255
- button.fides-banner-button.fides-banner-button-tertiary {
256
- background: none;
257
- border: none;
258
- padding: 0;
259
- color: var(--fides-overlay-link-font-color);
260
- text-decoration: underline;
261
- cursor: pointer;
262
- line-height: 2em;
263
- }
264
-
265
- /** Modal */
266
-
267
- div.fides-modal-content {
268
- line-height: var(--fides-overlay-line-height);
269
- color: var(--fides-overlay-body-font-color) !important;
270
- box-sizing: border-box;
271
- padding: var(--fides-overlay-padding);
272
- border: 1px solid var(--fides-overlay-primary-color);
273
- background-color: var(--fides-overlay-background-color);
274
- border-radius: var(--fides-overlay-component-border-radius);
275
- max-height: 100%;
276
- max-width: 100%;
277
- overflow-y: scroll;
278
- z-index: 2;
279
- position: fixed;
280
- top: 50%;
281
- left: 50%;
282
- transform: translate(-50%, -50%);
283
- }
284
-
285
- .fides-toggle .fides-toggle-display {
286
- --offset: 0.1em;
287
- --diameter: 1em;
288
- /** 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 **/
289
- display: inline-flex !important;
290
- align-items: center;
291
- justify-content: space-around;
292
- width: calc(var(--diameter) * 2 + var(--offset) * 2);
293
- height: calc(var(--diameter) + var(--offset) * 2);
294
- box-sizing: content-box;
295
- position: relative;
296
- border-radius: 100vw;
297
- background-color: var(--fides-overlay-inactive-color);
298
- transition: 250ms;
299
- }
300
-
301
- /* Checked/unchecked states */
302
- .fides-toggle .fides-toggle-input:checked + .fides-toggle-display {
303
- background-color: var(--fides-overlay-primary-active-color);
304
- }
305
- .fides-toggle .fides-toggle-input:checked + .fides-toggle-display::before {
306
- transform: translate(100%, -50%);
307
- }
308
-
309
- /* Disabled state */
310
- .fides-toggle .fides-toggle-input:disabled {
311
- cursor: not-allowed;
312
- }
313
- .fides-toggle .fides-toggle-input:disabled + .fides-toggle-display {
314
- background-color: var(--fides-overlay-disabled-color);
315
- }
316
- .fides-toggle .fides-toggle-input:disabled:checked + .fides-toggle-display {
317
- background-color: var(--fides-overlay-primary-active-disabled-color);
318
- }
319
-
320
- /* Focus ring when using keyboard */
321
- .fides-toggle .fides-toggle-input:focus + .fides-toggle-display {
322
- /* Firefox only has Highlight, not -webkit-focus-ring-color */
323
- outline: 1px auto Highlight;
324
- outline: 1px auto -webkit-focus-ring-color;
325
- }
326
-
327
- /* Disclosure */
328
-
329
- .fides-notice-toggle .fides-notice-toggle-title {
330
- border: 0;
331
- }
332
-
333
- #fides-modal .fides-modal-secondary-actions {
334
- display: none !important;
335
- }
336
-
337
- .fides-notice-toggle .fides-notice-toggle-trigger {
338
- padding-left: 4px;
339
- position: relative;
340
- left: -4px;
341
- }
342
-
343
- .fides-notice-toggle-trigger > .fides-flex-center.fides-justify-space-between {
344
- font-weight: bold
345
- }
346
-
347
- /* Tabs */
348
-
349
- .fides-tab-button::focus-visible {
350
- outline: 1px auto ${theme.colors.black};
351
- }
352
-
353
- .fides-tab-button:focus:not(:focus-visible) {
354
- outline: 4px solid ${theme.colors.hyper} !important;
355
- }
356
-
357
- .fides-toggle-input.focus-visible + .fides-toggle-display,
358
- .fides-banner-button.fides-banner-button-primary.focus-visible,
359
- .fides-banner-button.fides-banner-button-secondary.focus-visible,
360
- .fides-banner-button.fides-banner-button-tertiary.focus-visible {
361
- outline: 3px solid ${theme.colors.hyper} !important;
362
- outline-offset: 2px;
363
- }
364
-
365
- /* Table */
366
-
367
- .fides-cookies-table {
368
- border-collapse: collapse;
369
- width: 100%;
370
- text-align: left;
371
- }
372
-
373
- .fides-cookies-table th {
374
- text-transform: uppercase;
375
- }
376
-
377
- .fides-cookies-table td, .fides-cookies-table th {
378
- border: 1px solid var(--fides-overlay-row-divider-color);
379
- padding-left: 1.1em;
380
- padding-right: 0.6em;
381
- }
382
-
383
- #fides-banner #fides-button-group button {
384
- font-weight: bold;
385
- padding: 10px 16px;
386
- margin-top: 0;
387
- border: 1px solid var(--fides-overlay-primary-color);
388
- border-radius: 2px;
389
- }
390
-
391
- #fides-banner #fides-button-group div:nth-child(2) > button:nth-child(1) {
392
- background-color: white;
393
- color: #3a10e5;
394
- }
395
-
396
- #fides-banner-button-tertiary {
397
- display: none;
398
- }
399
-
400
- #fides-banner-heading {
401
- display: none !important;
402
- }
403
-
404
- div#fides-banner-inner div#fides-button-group {
405
- flex-direction: row !important;
406
- }
407
-
408
- .fides-banner-description a:hover, .fides-modal-description a:hover {
409
- text-decoration: none;
410
- }
411
-
412
- #fides-banner-inner-container a.focus-visible {
413
- outline: 1px solid ${theme.colors.black} !important;
414
- }
415
-
416
- div#fides-banner-inner div#fides-button-group {
417
- padding-top: 0 !important
418
- }
419
-
420
- #fides-banner .fides-acknowledge-button, #fides-banner .fides-manage-preferences-button {
421
- width: auto !important
422
- }
423
-
424
- #fides-banner .fides-banner-button-group.fides-banner-primary-actions {
425
- align-items: flex-end !important;
426
- align-self: stretch !important
427
- }
428
-
429
- #fides-banner .fides-banner-button-group.fides-banner-secondary-actions {
430
- align-items: flex-start !important;
431
- }
432
-
433
- .fides-notice-toggle:focus-visible {
434
- outline: 1px solid ${theme.colors.black} !important;
435
- }
436
-
437
- @media (min-width: 37.5rem) {
438
- #fides-banner {
439
- padding: 0.875rem 1rem !important;
440
- }
441
- }
442
-
443
- ${theme.breakpoints.sm} {
444
- div#fides-button-group .fides-banner-secondary-actions > button {
445
- padding: 4px 16px !important
446
- }
447
-
448
- div#fides-banner-inner {
449
- row-gap: 16px;
450
- }
451
-
452
- #fides-banner {
453
- padding: 0.875rem 1.25rem !important;
454
- }
455
- }
456
-
457
- @media only screen and (min-width: 1650px) {
458
- #fides-banner-inner {
459
- flex-direction: row !important;
460
- max-width: 1600px !important;
461
- }
462
-
463
- #fides-banner-inner-container {
464
- width: 72%;
465
- }
466
-
467
- #fides-banner div#fides-button-group {
468
- width: 28% !important;
469
- }
470
-
471
- div#fides-banner-description {
472
- margin-bottom: 0 !important;
473
- }
474
- }`;
58
+ 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}");
@@ -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 = '&gtm_auth=VrQuCDuWXkLlTwNHJYEKTg&gtm_preview=env-232';
22
23
  }
23
24
  const gtm = document.createElement('script');
24
- gtm.src = `https://www.googletagmanager.com/gtm.js?id=GTM-KTLK85W${preview_env}`;
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 {
@@ -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(`partytown-fb${url.pathname}${url.search}`, location.origin);
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(`partytown-reddit${url.pathname}${url.search}`, location.origin);
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(`partytown-googleads${p}${url.search}`, location.origin);
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(`partytown-bing${url.pathname}${url.search}`, location.origin);
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(`partytown-youtube${url.pathname}${url.search}`, location.origin);
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 => `(() => {${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 = `body > img[aria-hidden=true] { position: absolute; }`;
22
+ styles.innerText = "body > img[aria-hidden=true] { position: absolute; }";
23
23
  document.head.appendChild(styles);
24
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codecademy/tracking",
3
- "version": "1.6.1-alpha.fac52eba8.0",
3
+ "version": "1.6.1",
4
4
  "description": "Tracking library for Codecademy",
5
5
  "license": "MIT",
6
6
  "repository": "git@github.com:codecademy-engineering/mono.git",