@mjhls/mjh-framework 1.0.686 → 1.0.688

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/AD300x250.js +2 -1
  3. package/dist/cjs/AD300x250x600.js +2 -1
  4. package/dist/cjs/AD728x90.js +2 -1
  5. package/dist/cjs/ADFloatingFooter.js +2 -1
  6. package/dist/cjs/ADGutter.js +2 -1
  7. package/dist/cjs/ADSkyscraper.js +2 -1
  8. package/dist/cjs/ADSponsoredResources.js +2 -1
  9. package/dist/cjs/ADWebcast.js +2 -1
  10. package/dist/cjs/ADWelcome.js +2 -1
  11. package/dist/cjs/AdSlot.js +6 -5
  12. package/dist/cjs/Beam.js +340 -4
  13. package/dist/cjs/Column2.js +1 -2
  14. package/dist/cjs/Column3.js +2 -1
  15. package/dist/cjs/DeckContent.js +3 -2
  16. package/dist/cjs/ExternalResources.js +3 -2
  17. package/dist/cjs/GridContent.js +4 -3
  18. package/dist/cjs/HamMagazine.js +31 -8
  19. package/dist/cjs/IssueLanding.js +4 -3
  20. package/dist/cjs/LeftNav.js +3 -4
  21. package/dist/cjs/MasterDeck.js +4 -3
  22. package/dist/cjs/NavDvm.js +21 -9
  23. package/dist/cjs/NavMagazine.js +15 -8
  24. package/dist/cjs/NavNative.js +15 -8
  25. package/dist/cjs/NavNormal.js +2 -4
  26. package/dist/cjs/PartnerDetailListing.js +5 -4
  27. package/dist/cjs/QueueDeckExpanded.js +4 -3
  28. package/dist/cjs/Segment.js +346 -4
  29. package/dist/cjs/SideFooter.js +2 -4
  30. package/dist/cjs/TemplateNormal.js +2 -1
  31. package/dist/cjs/View.js +3 -2
  32. package/dist/cjs/getSerializers.js +3 -2
  33. package/dist/cjs/{index-8c9e8ca7.js → index-a1090dcd.js} +47 -47
  34. package/dist/cjs/index.js +7 -6
  35. package/dist/esm/AD300x250.js +2 -1
  36. package/dist/esm/AD300x250x600.js +2 -1
  37. package/dist/esm/AD728x90.js +2 -1
  38. package/dist/esm/ADFloatingFooter.js +2 -1
  39. package/dist/esm/ADGutter.js +2 -1
  40. package/dist/esm/ADSkyscraper.js +2 -1
  41. package/dist/esm/ADSponsoredResources.js +2 -1
  42. package/dist/esm/ADWebcast.js +2 -1
  43. package/dist/esm/ADWelcome.js +2 -1
  44. package/dist/esm/AdSlot.js +2 -1
  45. package/dist/esm/Beam.js +343 -3
  46. package/dist/esm/Column2.js +1 -2
  47. package/dist/esm/Column3.js +2 -1
  48. package/dist/esm/DeckContent.js +3 -2
  49. package/dist/esm/ExternalResources.js +3 -2
  50. package/dist/esm/GridContent.js +4 -3
  51. package/dist/esm/HamMagazine.js +31 -8
  52. package/dist/esm/IssueLanding.js +4 -3
  53. package/dist/esm/LeftNav.js +2 -3
  54. package/dist/esm/MasterDeck.js +4 -3
  55. package/dist/esm/NavDvm.js +22 -10
  56. package/dist/esm/NavMagazine.js +15 -8
  57. package/dist/esm/NavNative.js +15 -8
  58. package/dist/esm/NavNormal.js +1 -3
  59. package/dist/esm/PartnerDetailListing.js +5 -4
  60. package/dist/esm/QueueDeckExpanded.js +4 -3
  61. package/dist/esm/Segment.js +349 -3
  62. package/dist/esm/SideFooter.js +1 -3
  63. package/dist/esm/TemplateNormal.js +2 -1
  64. package/dist/esm/View.js +3 -2
  65. package/dist/esm/getSerializers.js +3 -2
  66. package/dist/esm/{index-5505d4f9.js → index-a3da0503.js} +2 -2
  67. package/dist/esm/index.js +5 -4
  68. package/package.json +1 -1
  69. package/dist/cjs/beam-7217b7e7.js +0 -733
  70. package/dist/esm/beam-681a9749.js +0 -730
  71. /package/dist/cjs/{ADInfeed-c676389b.js → ADInfeed-cf81b7aa.js} +0 -0
  72. /package/dist/cjs/{ADlgInfeed-57d63c87.js → ADlgInfeed-ebc1bf56.js} +0 -0
  73. /package/dist/esm/{ADInfeed-97b8cea7.js → ADInfeed-898b9c8f.js} +0 -0
  74. /package/dist/esm/{ADlgInfeed-3ab91c75.js → ADlgInfeed-a747451b.js} +0 -0
@@ -9,11 +9,10 @@ import React__default, { useRef, useState, useEffect } from 'react';
9
9
  import 'prop-types';
10
10
  import Container from 'react-bootstrap/Container';
11
11
  import { a as main_40 } from './main-0465b2a0.js';
12
- import './stringify-008c8802.js';
13
12
  import { _ as _slicedToArray } from './slicedToArray-7021e5df.js';
14
13
  import './asyncToGenerator-7c654f36.js';
15
14
  import './_set-species-cede29f8.js';
16
- import { S as Segment } from './beam-681a9749.js';
15
+ import Segment from './Segment.js';
17
16
  import './react-social-icons-a7d5c5c7.js';
18
17
  import './iconBase-602d52fe.js';
19
18
  import { b as IoMdLogIn } from './index.esm-85cb09e6.js';
@@ -109,6 +108,14 @@ var NavMagazine = function NavMagazine(props) {
109
108
 
110
109
  // Initial screenwidth setup on refresh or on load
111
110
  setScreenWidth(parseInt(window.innerWidth));
111
+
112
+ var segmentLinks = navRef.current.querySelectorAll('a[needsegmentsupport="true"]');
113
+ for (var i = 0; i < segmentLinks.length; i++) {
114
+ var link = segmentLinks[i];
115
+ var href = link.getAttribute('href');
116
+ var newRef = Segment.getURL(href, { needSegmentSupport: true });
117
+ link.setAttribute('href', newRef);
118
+ }
112
119
  }, []);
113
120
 
114
121
  // Check for browser resize
@@ -417,7 +424,7 @@ var NavMagazine = function NavMagazine(props) {
417
424
  if (ddRow.url && ddRow.name) {
418
425
  return ddRow.url && ddRow.name ? React__default.createElement(
419
426
  'a',
420
- { key: subIndex, href: Segment.getURL(ddRow.url, ddRow), target: ddRow.blank ? '_blank' : '_self', className: 'dropdown-item' },
427
+ { key: subIndex, needsegmentsupport: ddRow.needSegmentSupport ? 'true' : '', href: ddRow.url, target: ddRow.blank ? '_blank' : '_self', className: 'dropdown-item' },
421
428
  ddRow.name
422
429
  ) : null;
423
430
  } else return null;
@@ -437,7 +444,7 @@ var NavMagazine = function NavMagazine(props) {
437
444
  if (ddRow.url && ddRow.name) {
438
445
  return ddRow.url && ddRow.name ? React__default.createElement(
439
446
  'a',
440
- { key: subIndex, href: Segment.getURL(ddRow.url, ddRow), target: ddRow.blank ? '_blank' : '_self', className: 'dropdown-item' },
447
+ { key: subIndex, needsegmentsupport: ddRow.needSegmentSupport ? 'true' : '', href: ddRow.url, target: ddRow.blank ? '_blank' : '_self', className: 'dropdown-item' },
441
448
  ddRow.name
442
449
  ) : null;
443
450
  } else return null;
@@ -449,7 +456,7 @@ var NavMagazine = function NavMagazine(props) {
449
456
  } else {
450
457
  return row.url && row.name ? React__default.createElement(
451
458
  'a',
452
- { key: index, href: Segment.getURL(row.url, row), target: row.blank ? '_blank' : '_self', className: 'nav-link' },
459
+ { key: index, needsegmentsupport: row.needSegmentSupport ? 'true' : '', href: row.url, target: row.blank ? '_blank' : '_self', className: 'nav-link' },
453
460
  row.name
454
461
  ) : null;
455
462
  }
@@ -485,7 +492,7 @@ var NavMagazine = function NavMagazine(props) {
485
492
  } else {
486
493
  return ddRow.url && ddRow.name ? React__default.createElement(
487
494
  'a',
488
- { key: subIndex, href: Segment.getURL(ddRow.url, ddRow), target: ddRow.blank ? '_blank' : '_self', className: 'dropdown-item' },
495
+ { key: subIndex, needsegmentsupport: ddRow.needSegmentSupport ? 'true' : '', href: ddRow.url, target: ddRow.blank ? '_blank' : '_self', className: 'dropdown-item' },
489
496
  ddRow.name
490
497
  ) : null;
491
498
  }
@@ -503,7 +510,7 @@ var NavMagazine = function NavMagazine(props) {
503
510
  } else {
504
511
  return ddRow.url && ddRow.name ? React__default.createElement(
505
512
  'a',
506
- { key: subIndex, href: Segment.getURL(ddRow.url, ddRow), target: ddRow.blank ? '_blank' : '_self', className: 'dropdown-item' },
513
+ { key: subIndex, needsegmentsupport: ddRow.needSegmentSupport ? 'true' : '', href: ddRow.url, target: ddRow.blank ? '_blank' : '_self', className: 'dropdown-item' },
507
514
  ddRow.name
508
515
  ) : null;
509
516
  }
@@ -514,7 +521,7 @@ var NavMagazine = function NavMagazine(props) {
514
521
  } else {
515
522
  return row.url && row.name ? React__default.createElement(
516
523
  'a',
517
- { key: index, href: Segment.getURL(row.url, row), target: row.blank ? '_blank' : '_self', className: 'nav-link' },
524
+ { key: index, needsegmentsupport: row.needSegmentSupport ? 'true' : '', href: row.url, target: row.blank ? '_blank' : '_self', className: 'nav-link' },
518
525
  row.name
519
526
  ) : null;
520
527
  }
@@ -9,11 +9,10 @@ import React__default, { useRef, useState, useEffect } from 'react';
9
9
  import 'prop-types';
10
10
  import Container from 'react-bootstrap/Container';
11
11
  import { a as main_40 } from './main-0465b2a0.js';
12
- import './stringify-008c8802.js';
13
12
  import { _ as _slicedToArray } from './slicedToArray-7021e5df.js';
14
13
  import './asyncToGenerator-7c654f36.js';
15
14
  import './_set-species-cede29f8.js';
16
- import { S as Segment } from './beam-681a9749.js';
15
+ import Segment from './Segment.js';
17
16
  import './react-social-icons-a7d5c5c7.js';
18
17
  import { I as IconContext } from './iconBase-602d52fe.js';
19
18
  import Button from 'react-bootstrap/Button';
@@ -86,6 +85,14 @@ var NavNative = function NavNative(props) {
86
85
  var topNavHeight = document.querySelector('.nav-brands') && document.querySelector('.nav-brands').offsetHeight;
87
86
  // Setting the top of the search component based on the offset of navigation component.
88
87
  searchRef.current.style.top = (topNavHeight ? topNavHeight + navRef.current.offsetHeight : navRef.current.offsetHeight) + 1 + 'px';
88
+
89
+ var segmentLinks = navRef.current.querySelectorAll('a[needsegmentsupport="true"]');
90
+ for (var i = 0; i < segmentLinks.length; i++) {
91
+ var link = segmentLinks[i];
92
+ var href = link.getAttribute('href');
93
+ var newRef = Segment.getURL(href, { needSegmentSupport: true });
94
+ link.setAttribute('href', newRef);
95
+ }
89
96
  }, []);
90
97
 
91
98
  useEffect(function () {
@@ -355,7 +362,7 @@ var NavNative = function NavNative(props) {
355
362
  if (ddRow.url && ddRow.name) {
356
363
  return ddRow.url && ddRow.name ? React__default.createElement(
357
364
  'a',
358
- { key: subIndex, href: Segment.getURL(ddRow.url, ddRow), target: ddRow.blank ? '_blank' : '_self', className: 'dropdown-item' },
365
+ { key: subIndex, needsegmentsupport: ddRow.needSegmentSupport ? 'true' : '', href: ddRow.url, target: ddRow.blank ? '_blank' : '_self', className: 'dropdown-item' },
359
366
  ddRow.name
360
367
  ) : null;
361
368
  } else return null;
@@ -375,7 +382,7 @@ var NavNative = function NavNative(props) {
375
382
  if (ddRow.url && ddRow.name) {
376
383
  return ddRow.url && ddRow.name ? React__default.createElement(
377
384
  'a',
378
- { key: subIndex, href: Segment.getURL(ddRow.url, ddRow), target: ddRow.blank ? '_blank' : '_self', className: 'dropdown-item' },
385
+ { key: subIndex, needsegmentsupport: ddRow.needSegmentSupport ? 'true' : '', href: ddRow.url, target: ddRow.blank ? '_blank' : '_self', className: 'dropdown-item' },
379
386
  ddRow.name
380
387
  ) : null;
381
388
  } else return null;
@@ -387,7 +394,7 @@ var NavNative = function NavNative(props) {
387
394
  } else {
388
395
  return row.url && row.name ? React__default.createElement(
389
396
  'a',
390
- { key: index, href: Segment.getURL(row.url, row), target: row.blank ? '_blank' : '_self', className: 'nav-link' },
397
+ { key: index, needsegmentsupport: ddRow.needSegmentSupport ? 'true' : '', href: ddRow.url, target: row.blank ? '_blank' : '_self', className: 'nav-link' },
391
398
  row.name
392
399
  ) : null;
393
400
  }
@@ -414,7 +421,7 @@ var NavNative = function NavNative(props) {
414
421
  } else {
415
422
  return ddRow.url && ddRow.name ? React__default.createElement(
416
423
  'a',
417
- { key: subIndex, href: Segment.getURL(ddRow.url, ddRow), target: ddRow.blank ? '_blank' : '_self', className: 'dropdown-item' },
424
+ { key: subIndex, needsegmentsupport: ddRow.needSegmentSupport ? 'true' : '', href: ddRow.url, target: ddRow.blank ? '_blank' : '_self', className: 'dropdown-item' },
418
425
  ddRow.name
419
426
  ) : null;
420
427
  }
@@ -432,7 +439,7 @@ var NavNative = function NavNative(props) {
432
439
  } else {
433
440
  return ddRow.url && ddRow.name ? React__default.createElement(
434
441
  'a',
435
- { key: subIndex, href: Segment.getURL(ddRow.url, ddRow), target: ddRow.blank ? '_blank' : '_self', className: 'dropdown-item' },
442
+ { key: subIndex, needsegmentsupport: ddRow.needSegmentSupport ? 'true' : '', href: ddRow.url, target: ddRow.blank ? '_blank' : '_self', className: 'dropdown-item' },
436
443
  ddRow.name
437
444
  ) : null;
438
445
  }
@@ -443,7 +450,7 @@ var NavNative = function NavNative(props) {
443
450
  } else {
444
451
  return row.url && row.name ? React__default.createElement(
445
452
  'a',
446
- { key: index, href: Segment.getURL(row.url, row), target: row.blank ? '_blank' : '_self', className: 'nav-link' },
453
+ { key: index, needsegmentsupport: row.needSegmentSupport ? 'true' : '', href: row.url, target: row.blank ? '_blank' : '_self', className: 'nav-link' },
447
454
  row.name
448
455
  ) : null;
449
456
  }
@@ -7,11 +7,10 @@ import './core.get-iterator-method-54d2e411.js';
7
7
  import './web.dom.iterable-8956f9a5.js';
8
8
  import React__default, { useRef, useEffect } from 'react';
9
9
  import Container from 'react-bootstrap/Container';
10
- import './stringify-008c8802.js';
11
10
  import './slicedToArray-7021e5df.js';
12
11
  import './asyncToGenerator-7c654f36.js';
13
12
  import './_set-species-cede29f8.js';
14
- import { S as Segment } from './beam-681a9749.js';
13
+ import Segment from './Segment.js';
15
14
  import './iconBase-602d52fe.js';
16
15
  import 'react-bootstrap/Button';
17
16
  import 'react-bootstrap/Form';
@@ -32,7 +31,6 @@ var NavNormal = function NavNormal(props) {
32
31
  var ref = useRef(null);
33
32
 
34
33
  useEffect(function () {
35
- Segment.init(); // auto init if not done yet
36
34
  var segmentLinks = ref.current.querySelectorAll('a[needsegmentsupport="true"]');
37
35
  for (var i = 0; i < segmentLinks.length; i++) {
38
36
  var link = segmentLinks[i];
@@ -34,11 +34,12 @@ import './stringify-008c8802.js';
34
34
  import { _ as _slicedToArray } from './slicedToArray-7021e5df.js';
35
35
  import { a as _asyncToGenerator, r as regenerator, _ as _Promise } from './asyncToGenerator-7c654f36.js';
36
36
  import './_set-species-cede29f8.js';
37
- import './beam-681a9749.js';
37
+ import './Segment.js';
38
+ import './Beam.js';
38
39
  import './AdSlot.js';
39
- import './ADInfeed-97b8cea7.js';
40
+ import './ADInfeed-898b9c8f.js';
40
41
  import './lodash-17fdfebb.js';
41
- import './ADlgInfeed-3ab91c75.js';
42
+ import './ADlgInfeed-a747451b.js';
42
43
  import './getContentCategory-15dcc413.js';
43
44
  import './AuthorComponent-00f13201.js';
44
45
  import { B as BlockContent } from './BlockContent-a614acdf.js';
@@ -48,7 +49,7 @@ import 'react-bootstrap';
48
49
  import './timeDifferenceCalc.js';
49
50
  import QueueDeckExpanded from './QueueDeckExpanded.js';
50
51
  import 'react-bootstrap/Button';
51
- import { g as getSerializers } from './index-5505d4f9.js';
52
+ import { g as getSerializers } from './index-a3da0503.js';
52
53
  import './util-7700fc59.js';
53
54
  import './brightcove-react-player-loader.es-83f53e4e.js';
54
55
  import 'react-bootstrap/Pagination';
@@ -27,11 +27,12 @@ import './stringify-008c8802.js';
27
27
  import { _ as _slicedToArray } from './slicedToArray-7021e5df.js';
28
28
  import './asyncToGenerator-7c654f36.js';
29
29
  import './_set-species-cede29f8.js';
30
- import './beam-681a9749.js';
30
+ import './Segment.js';
31
+ import './Beam.js';
31
32
  import './AdSlot.js';
32
- import { A as ADInfeed } from './ADInfeed-97b8cea7.js';
33
+ import { A as ADInfeed } from './ADInfeed-898b9c8f.js';
33
34
  import { l as lodash } from './lodash-17fdfebb.js';
34
- import { A as ADlgInfeed } from './ADlgInfeed-3ab91c75.js';
35
+ import { A as ADlgInfeed } from './ADlgInfeed-a747451b.js';
35
36
  import { g as getContentCategory } from './getContentCategory-15dcc413.js';
36
37
  import { A as AuthorComponent } from './AuthorComponent-00f13201.js';
37
38
  import { Container, Media } from 'react-bootstrap';
@@ -5,7 +5,353 @@ import './_library-528f1934.js';
5
5
  import './_iter-detect-59409a32.js';
6
6
  import './core.get-iterator-method-54d2e411.js';
7
7
  import './web.dom.iterable-8956f9a5.js';
8
- import './stringify-008c8802.js';
9
- import './asyncToGenerator-7c654f36.js';
8
+ import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-7c654f36.js';
10
9
  import './_set-species-cede29f8.js';
11
- export { S as default } from './beam-681a9749.js';
10
+
11
+ require("babel-polyfill");
12
+
13
+ var Segment = {
14
+ identify: function identify(eKey) {
15
+ if (!eKey) {
16
+ throw new Error('eKey is not present');
17
+ }
18
+
19
+ if (typeof analytics === 'undefined') {
20
+ console.error('Segment not initialized', analytics);
21
+ return;
22
+ }
23
+
24
+ var buff = Buffer.from(eKey, 'base64');
25
+ var email = buff.toString('ascii');
26
+
27
+ analytics.identify(eKey, {
28
+ email: email
29
+ });
30
+ },
31
+ getURL: function getURL(url) {
32
+ var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
33
+
34
+ if (!data || !data.needSegmentSupport) {
35
+ return url;
36
+ }
37
+
38
+ if (typeof analytics === 'undefined') {
39
+ console.error('segment not defined');
40
+ return url;
41
+ }
42
+
43
+ var user = analytics.user();
44
+ if (!user) {
45
+ console.log('segment user not defined');
46
+ return url;
47
+ }
48
+
49
+ var anonymouseId = user.anonymousId();
50
+ //const eKey = Beam.proc_eKey(Beam.proc_url())
51
+ var eKey = user._getId();
52
+ if (eKey) {
53
+ url += (url.includes('?') ? '&' : '?') + 'ekey=' + eKey;
54
+ } else {
55
+ url += (url.includes('?') ? '&' : '?') + 'anonymousid=' + anonymouseId;
56
+ }
57
+
58
+ return url;
59
+ },
60
+ getIDs: function getIDs() {
61
+ var _this = this;
62
+
63
+ return _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
64
+ var res, json;
65
+ return regenerator.wrap(function _callee$(_context) {
66
+ while (1) {
67
+ switch (_context.prev = _context.next) {
68
+ case 0:
69
+ _context.next = 2;
70
+ return fetch('https://beam.mjhlifesciences.com/api/beam/id', {
71
+ headers: {
72
+ 'Content-Type': 'application/json',
73
+ Accept: 'application/json'
74
+ },
75
+ method: 'post',
76
+ credentials: 'include'
77
+ });
78
+
79
+ case 2:
80
+ res = _context.sent;
81
+ _context.next = 5;
82
+ return res.json();
83
+
84
+ case 5:
85
+ json = _context.sent;
86
+ return _context.abrupt('return', json);
87
+
88
+ case 7:
89
+ case 'end':
90
+ return _context.stop();
91
+ }
92
+ }
93
+ }, _callee, _this);
94
+ }))();
95
+ },
96
+ pageview: function pageview(domain) {
97
+ var _this2 = this;
98
+
99
+ return _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2() {
100
+ var result, beam_id, session_id;
101
+ return regenerator.wrap(function _callee2$(_context2) {
102
+ while (1) {
103
+ switch (_context2.prev = _context2.next) {
104
+ case 0:
105
+ if (!(typeof analytics === 'undefined')) {
106
+ _context2.next = 3;
107
+ break;
108
+ }
109
+
110
+ console.error('Segment not initialized', window);
111
+ return _context2.abrupt('return');
112
+
113
+ case 3:
114
+ _context2.next = 5;
115
+ return _this2.getIDs();
116
+
117
+ case 5:
118
+ result = _context2.sent;
119
+ beam_id = result.beam_id ? result.beam_id : '';
120
+ session_id = result.session_id ? result.session_id : '';
121
+
122
+
123
+ analytics.track('pageviews', {
124
+ beamid: beam_id,
125
+ sessionid: session_id,
126
+ category: '',
127
+ domain: domain
128
+ });
129
+
130
+ case 9:
131
+ case 'end':
132
+ return _context2.stop();
133
+ }
134
+ }
135
+ }, _callee2, _this2);
136
+ }))();
137
+ },
138
+ report_video_event: function report_video_event(action, deviceType, duration, current, segmentData) {
139
+ var videoType = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'Youtube';
140
+ var brightCovePlayerID = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : '';
141
+
142
+ var _this3 = this;
143
+
144
+ var brightCoveAccountID = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : '';
145
+ var brightCoveVideoID = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : '';
146
+ return _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee3() {
147
+ var result, beam_id, session_id, domain, data;
148
+ return regenerator.wrap(function _callee3$(_context3) {
149
+ while (1) {
150
+ switch (_context3.prev = _context3.next) {
151
+ case 0:
152
+ if (!(typeof analytics === 'undefined')) {
153
+ _context3.next = 3;
154
+ break;
155
+ }
156
+
157
+ console.error('Segment not initialized');
158
+ return _context3.abrupt('return');
159
+
160
+ case 3:
161
+ _context3.next = 5;
162
+ return _this3.getIDs();
163
+
164
+ case 5:
165
+ result = _context3.sent;
166
+ beam_id = result.beam_id ? result.beam_id : '';
167
+ session_id = result.session_id ? result.session_id : '';
168
+ domain = typeof window !== 'undefined' && window.location ? window.location.hostname : '';
169
+ data = {
170
+ beamid: beam_id,
171
+ sessionid: session_id,
172
+ domain: domain,
173
+ Devicetype: deviceType,
174
+ videoid: brightCoveVideoID,
175
+ title: '',
176
+ category: '',
177
+ videoplayer: videoType,
178
+ totalduration: duration,
179
+ currentduration: current,
180
+ segment: segmentData,
181
+ queue: Math.floor(duration / 10),
182
+ brightCovePlayerID: brightCovePlayerID,
183
+ brightCoveAccountID: brightCoveAccountID
184
+ };
185
+
186
+
187
+ console.log('Segment ' + videoType, action, data);
188
+
189
+ analytics.track(action, data);
190
+
191
+ case 12:
192
+ case 'end':
193
+ return _context3.stop();
194
+ }
195
+ }
196
+ }, _callee3, _this3);
197
+ }))();
198
+ },
199
+ report_ad_event: function report_ad_event(action, deviceType, duration) {
200
+ var adType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'brightcove';
201
+ var adId = arguments[4];
202
+
203
+ var _this4 = this;
204
+
205
+ var brightCovePlayerID = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : '';
206
+ var brightCoveAccountID = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : '';
207
+ return _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee4() {
208
+ var result, beam_id, session_id, domain, data;
209
+ return regenerator.wrap(function _callee4$(_context4) {
210
+ while (1) {
211
+ switch (_context4.prev = _context4.next) {
212
+ case 0:
213
+ if (!(typeof analytics === 'undefined')) {
214
+ _context4.next = 3;
215
+ break;
216
+ }
217
+
218
+ console.error('Segment not initialized');
219
+ return _context4.abrupt('return');
220
+
221
+ case 3:
222
+ _context4.next = 5;
223
+ return _this4.getIDs();
224
+
225
+ case 5:
226
+ result = _context4.sent;
227
+ beam_id = result.beam_id ? result.beam_id : '';
228
+ session_id = result.session_id ? result.session_id : '';
229
+ domain = typeof window !== 'undefined' && window.location ? window.location.hostname : '';
230
+ data = {
231
+ beamid: beam_id,
232
+ sessionid: session_id,
233
+ domain: domain,
234
+ Devicetype: deviceType,
235
+ title: '',
236
+ category: '',
237
+ adType: adType,
238
+ totalduration: duration,
239
+ adId: adId,
240
+ brightCovePlayerID: brightCovePlayerID,
241
+ brightCoveAccountID: brightCoveAccountID
242
+ };
243
+
244
+
245
+ console.log('Segment ' + adType, action, data);
246
+
247
+ analytics.track(action, data);
248
+
249
+ case 12:
250
+ case 'end':
251
+ return _context4.stop();
252
+ }
253
+ }
254
+ }, _callee4, _this4);
255
+ }))();
256
+ },
257
+ adClicked: function adClicked(domain, advertiserid, campaignid, creativeid, itemid, size, isemptyline, sourceAgnosticCreativeId, sourceAgnosticlineId) {
258
+ var _this5 = this;
259
+
260
+ return _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee5() {
261
+ var result, beam_id, session_id;
262
+ return regenerator.wrap(function _callee5$(_context5) {
263
+ while (1) {
264
+ switch (_context5.prev = _context5.next) {
265
+ case 0:
266
+ if (!(typeof analytics === 'undefined')) {
267
+ _context5.next = 3;
268
+ break;
269
+ }
270
+
271
+ console.error('Segment not initialized');
272
+ return _context5.abrupt('return');
273
+
274
+ case 3:
275
+ _context5.next = 5;
276
+ return _this5.getIDs();
277
+
278
+ case 5:
279
+ result = _context5.sent;
280
+ beam_id = result.beam_id ? result.beam_id : '';
281
+ session_id = result.session_id ? result.session_id : '';
282
+
283
+
284
+ analytics.track('Ad Clicked', {
285
+ beamid: beam_id,
286
+ sessionid: session_id,
287
+ advertiserid: advertiserid,
288
+ campaignid: campaignid,
289
+ creativeid: creativeid,
290
+ itemid: itemid,
291
+ size: size,
292
+ isemptyline: isemptyline,
293
+ sourceAgnosticCreativeId: sourceAgnosticCreativeId,
294
+ sourceAgnosticlineId: sourceAgnosticlineId,
295
+ domain: domain
296
+ });
297
+
298
+ case 9:
299
+ case 'end':
300
+ return _context5.stop();
301
+ }
302
+ }
303
+ }, _callee5, _this5);
304
+ }))();
305
+ },
306
+ adViewed: function adViewed(domain, advertiserid, campaignid, creativeid, itemid, size, isemptyline, sourceAgnosticCreativeId, sourceAgnosticlineId) {
307
+ var _this6 = this;
308
+
309
+ return _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee6() {
310
+ var result, beam_id, session_id;
311
+ return regenerator.wrap(function _callee6$(_context6) {
312
+ while (1) {
313
+ switch (_context6.prev = _context6.next) {
314
+ case 0:
315
+ if (!(typeof analytics === 'undefined')) {
316
+ _context6.next = 3;
317
+ break;
318
+ }
319
+
320
+ console.error('Segment not initialized');
321
+ return _context6.abrupt('return');
322
+
323
+ case 3:
324
+ _context6.next = 5;
325
+ return _this6.getIDs();
326
+
327
+ case 5:
328
+ result = _context6.sent;
329
+ beam_id = result.beam_id ? result.beam_id : '';
330
+ session_id = result.session_id ? result.session_id : '';
331
+
332
+
333
+ analytics.track('Impression Viewed', {
334
+ beamid: beam_id,
335
+ sessionid: session_id,
336
+ advertiserid: advertiserid,
337
+ campaignid: campaignid,
338
+ creativeid: creativeid,
339
+ itemid: itemid,
340
+ size: size,
341
+ isemptyline: isemptyline,
342
+ sourceAgnosticCreativeId: sourceAgnosticCreativeId,
343
+ sourceAgnosticlineId: sourceAgnosticlineId,
344
+ domain: domain
345
+ });
346
+
347
+ case 9:
348
+ case 'end':
349
+ return _context6.stop();
350
+ }
351
+ }
352
+ }, _callee6, _this6);
353
+ }))();
354
+ }
355
+ };
356
+
357
+ export default Segment;
@@ -9,10 +9,9 @@ import './web.dom.iterable-8956f9a5.js';
9
9
  import React__default, { useRef, useEffect } from 'react';
10
10
  import 'prop-types';
11
11
  import './isSymbol-807e927e.js';
12
- import './stringify-008c8802.js';
13
12
  import './asyncToGenerator-7c654f36.js';
14
13
  import './_set-species-cede29f8.js';
15
- import { S as Segment } from './beam-681a9749.js';
14
+ import Segment from './Segment.js';
16
15
  import { g as get_1 } from './get-5ee14cda.js';
17
16
  import { r as reactSocialIcons_1 } from './react-social-icons-a7d5c5c7.js';
18
17
  import { _ as _defineProperty } from './defineProperty-b798470d.js';
@@ -53,7 +52,6 @@ var SideFooter = function SideFooter(props) {
53
52
  var sfRef = useRef(null);
54
53
 
55
54
  useEffect(function () {
56
- Segment.init(); // auto init if not done yet
57
55
  // this adds ?eKey=xxx or ?anonymousid=xxx for forms that's outside - eg) formstack forms
58
56
  // for tracking same user
59
57
  var segmentLinks = sfRef.current.querySelectorAll('a[needsegmentsupport="true"]');
@@ -20,7 +20,8 @@ import './stringify-008c8802.js';
20
20
  import { _ as _slicedToArray } from './slicedToArray-7021e5df.js';
21
21
  import './asyncToGenerator-7c654f36.js';
22
22
  import './_set-species-cede29f8.js';
23
- import './beam-681a9749.js';
23
+ import './Segment.js';
24
+ import './Beam.js';
24
25
  import './AdSlot.js';
25
26
  import './get-5ee14cda.js';
26
27
  import './react-social-icons-a7d5c5c7.js';
package/dist/esm/View.js CHANGED
@@ -32,7 +32,8 @@ import { _ as _JSON$stringify } from './stringify-008c8802.js';
32
32
  import { a as _getIterator, _ as _slicedToArray } from './slicedToArray-7021e5df.js';
33
33
  import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-7c654f36.js';
34
34
  import './_set-species-cede29f8.js';
35
- import './beam-681a9749.js';
35
+ import './Segment.js';
36
+ import './Beam.js';
36
37
  import DFPAdSlot from './AdSlot.js';
37
38
  import { B as BlockContent } from './BlockContent-a614acdf.js';
38
39
  import './smoothscroll-4b699764.js';
@@ -42,7 +43,7 @@ import './iconBase-602d52fe.js';
42
43
  import Button from 'react-bootstrap/Button';
43
44
  import { _ as _defineProperty } from './defineProperty-b798470d.js';
44
45
  import Form from 'react-bootstrap/Form';
45
- import { I as InscreenSensor, r as renderAuthor, g as getSerializers } from './index-5505d4f9.js';
46
+ import { I as InscreenSensor, r as renderAuthor, g as getSerializers } from './index-a3da0503.js';
46
47
  import './util-7700fc59.js';
47
48
  import './brightcove-react-player-loader.es-83f53e4e.js';
48
49
  import 'react-bootstrap/Pagination';
@@ -31,14 +31,15 @@ import './stringify-008c8802.js';
31
31
  import './slicedToArray-7021e5df.js';
32
32
  import './asyncToGenerator-7c654f36.js';
33
33
  import './_set-species-cede29f8.js';
34
- import './beam-681a9749.js';
34
+ import './Segment.js';
35
+ import './Beam.js';
35
36
  import './AdSlot.js';
36
37
  import './BlockContent-a614acdf.js';
37
38
  import './smoothscroll-4b699764.js';
38
39
  import './GroupDeck.js';
39
40
  import 'react-bootstrap';
40
41
  import 'react-bootstrap/Button';
41
- export { g as default } from './index-5505d4f9.js';
42
+ export { g as default } from './index-a3da0503.js';
42
43
  import './util-7700fc59.js';
43
44
  import './brightcove-react-player-loader.es-83f53e4e.js';
44
45
  import 'react-bootstrap/Pagination';