@mjhls/mjh-framework 1.0.999 → 1.0.1001-popup-polls

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 (152) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/AD.js +1 -1
  3. package/dist/cjs/AD300x250.js +3 -2
  4. package/dist/cjs/AD300x250x600.js +3 -2
  5. package/dist/cjs/AD728x90.js +3 -2
  6. package/dist/cjs/ADFloatingFooter.js +3 -2
  7. package/dist/cjs/ADGutter.js +3 -2
  8. package/dist/cjs/ADSkyscraper.js +3 -2
  9. package/dist/cjs/ADSponsoredResources.js +3 -2
  10. package/dist/cjs/ADWebcast.js +3 -2
  11. package/dist/cjs/ADWelcome.js +3 -2
  12. package/dist/cjs/AdSlot.js +3 -2
  13. package/dist/cjs/AdSlotsProvider.js +3 -2
  14. package/dist/cjs/AlgoliaSearch.js +521 -1068
  15. package/dist/cjs/ArticleCarousel.js +1 -1
  16. package/dist/cjs/ArticleProgramLandingPage.js +7 -5
  17. package/dist/cjs/ArticleSeriesLandingPage.js +5 -4
  18. package/dist/cjs/ArticleSeriesListing.js +3 -2
  19. package/dist/cjs/Auth.js +11 -40
  20. package/dist/cjs/AuthWrapper.js +19 -89
  21. package/dist/cjs/CMEDeck.js +3 -2
  22. package/dist/cjs/Column3.js +3 -2
  23. package/dist/cjs/ContentCardPaginated.js +5 -4
  24. package/dist/cjs/DeckContent.js +4 -3
  25. package/dist/cjs/DeckQueue.js +3 -2
  26. package/dist/cjs/DeckQueuePaginated.js +4 -3
  27. package/dist/cjs/{Dfp-67646058.js → Dfp-c313a700.js} +2 -1
  28. package/dist/cjs/EventsDeck.js +2 -2
  29. package/dist/cjs/ExternalResources.js +12 -9
  30. package/dist/cjs/Feature.js +1 -1
  31. package/dist/cjs/GridContent.js +5 -4
  32. package/dist/cjs/GridContentPaginated.js +6 -5
  33. package/dist/cjs/HamMagazine.js +2 -2
  34. package/dist/cjs/HorizontalArticleListing.js +7 -5
  35. package/dist/cjs/{ImageSlider-1ec0408b.js → ImageSlider-17fdaf3b.js} +116 -156
  36. package/dist/cjs/IssueLanding.js +9 -7
  37. package/dist/cjs/LeftNav.js +3 -2
  38. package/dist/cjs/MasterDeck.js +5 -4
  39. package/dist/cjs/MasterDeckPaginated.js +6 -5
  40. package/dist/cjs/{MediaSeriesCard-78f709ca.js → MediaSeriesCard-eacea66a.js} +1 -1
  41. package/dist/cjs/MediaSeriesLanding.js +11 -9
  42. package/dist/cjs/MediaSeriesLandingPaginated.js +12 -10
  43. package/dist/cjs/NavMagazine.js +2 -2
  44. package/dist/cjs/NavNative.js +1 -1
  45. package/dist/cjs/{Pagination-6359861a.js → Pagination-842c556f.js} +1 -1
  46. package/dist/cjs/PartnerDetailListing.js +11 -8
  47. package/dist/cjs/PartnerDetailListingPaginated.js +12 -9
  48. package/dist/cjs/PodcastsLanding.js +9 -7
  49. package/dist/cjs/PubSection.js +5 -4
  50. package/dist/cjs/QueueDeckExpanded.js +5 -4
  51. package/dist/cjs/QueueDeckExpandedPaginated.js +6 -5
  52. package/dist/cjs/SeriesListingDeck.js +4 -3
  53. package/dist/cjs/{SeriesSlider-18fc6e71.js → SeriesSlider-3d57985d.js} +1 -1
  54. package/dist/cjs/{SocialSearchComponent-ca9c0c45.js → SocialSearchComponent-62bceb87.js} +1 -1
  55. package/dist/cjs/TaxonomyDescription.js +7 -5
  56. package/dist/cjs/TemplateNormal.js +4 -3
  57. package/dist/cjs/{Tooltip-71754b2a.js → Tooltip-4cb8849a.js} +272 -355
  58. package/dist/cjs/Ustream.js +1 -1
  59. package/dist/cjs/VideoProgramLandingPage.js +7 -5
  60. package/dist/cjs/VideoSeriesLandingPage.js +5 -4
  61. package/dist/cjs/VideoSeriesListing.js +3 -2
  62. package/dist/cjs/View.js +10 -7
  63. package/dist/cjs/YoutubeGroup.js +1 -1
  64. package/dist/cjs/defineProperty-e0fb52c5.js +73 -0
  65. package/dist/cjs/events-1b438fe7.js +469 -0
  66. package/dist/cjs/getSerializers.js +7 -5
  67. package/dist/cjs/{index-e4f1fe32.js → index-19fbbcea.js} +161 -99
  68. package/dist/cjs/index-50be6759.js +105 -0
  69. package/dist/cjs/{index-7435b964.js → index-d2a6ef75.js} +2 -467
  70. package/dist/cjs/{index-96c331fd.js → index-f86bb269.js} +52 -53
  71. package/dist/cjs/index.js +13 -10
  72. package/dist/cjs/{main-6054981e.js → main-3643d499.js} +9 -4
  73. package/dist/cjs/typeof-1358762e.js +33 -0
  74. package/dist/esm/AD.js +1 -1
  75. package/dist/esm/AD300x250.js +3 -2
  76. package/dist/esm/AD300x250x600.js +3 -2
  77. package/dist/esm/AD728x90.js +3 -2
  78. package/dist/esm/ADFloatingFooter.js +3 -2
  79. package/dist/esm/ADGutter.js +3 -2
  80. package/dist/esm/ADSkyscraper.js +3 -2
  81. package/dist/esm/ADSponsoredResources.js +3 -2
  82. package/dist/esm/ADWebcast.js +3 -2
  83. package/dist/esm/ADWelcome.js +3 -2
  84. package/dist/esm/AdSlot.js +3 -2
  85. package/dist/esm/AdSlotsProvider.js +3 -2
  86. package/dist/esm/AlgoliaSearch.js +518 -1065
  87. package/dist/esm/ArticleCarousel.js +1 -1
  88. package/dist/esm/ArticleProgramLandingPage.js +7 -5
  89. package/dist/esm/ArticleSeriesLandingPage.js +5 -4
  90. package/dist/esm/ArticleSeriesListing.js +3 -2
  91. package/dist/esm/Auth.js +11 -40
  92. package/dist/esm/AuthWrapper.js +16 -86
  93. package/dist/esm/CMEDeck.js +3 -2
  94. package/dist/esm/Column3.js +3 -2
  95. package/dist/esm/ContentCardPaginated.js +5 -4
  96. package/dist/esm/DeckContent.js +4 -3
  97. package/dist/esm/DeckQueue.js +3 -2
  98. package/dist/esm/DeckQueuePaginated.js +4 -3
  99. package/dist/esm/{Dfp-cf85d203.js → Dfp-102f0beb.js} +2 -1
  100. package/dist/esm/EventsDeck.js +2 -2
  101. package/dist/esm/ExternalResources.js +12 -9
  102. package/dist/esm/Feature.js +1 -1
  103. package/dist/esm/GridContent.js +5 -4
  104. package/dist/esm/GridContentPaginated.js +6 -5
  105. package/dist/esm/HamMagazine.js +2 -2
  106. package/dist/esm/HorizontalArticleListing.js +7 -5
  107. package/dist/esm/{ImageSlider-83913c4c.js → ImageSlider-f84174cb.js} +117 -157
  108. package/dist/esm/IssueLanding.js +9 -7
  109. package/dist/esm/LeftNav.js +3 -2
  110. package/dist/esm/MasterDeck.js +5 -4
  111. package/dist/esm/MasterDeckPaginated.js +6 -5
  112. package/dist/esm/{MediaSeriesCard-db0176b5.js → MediaSeriesCard-f56c8274.js} +1 -1
  113. package/dist/esm/MediaSeriesLanding.js +11 -9
  114. package/dist/esm/MediaSeriesLandingPaginated.js +12 -10
  115. package/dist/esm/NavMagazine.js +2 -2
  116. package/dist/esm/NavNative.js +1 -1
  117. package/dist/esm/{Pagination-9fe9f61d.js → Pagination-dc30727b.js} +1 -1
  118. package/dist/esm/PartnerDetailListing.js +11 -8
  119. package/dist/esm/PartnerDetailListingPaginated.js +12 -9
  120. package/dist/esm/PodcastsLanding.js +9 -7
  121. package/dist/esm/PubSection.js +5 -4
  122. package/dist/esm/QueueDeckExpanded.js +5 -4
  123. package/dist/esm/QueueDeckExpandedPaginated.js +6 -5
  124. package/dist/esm/SeriesListingDeck.js +4 -3
  125. package/dist/esm/{SeriesSlider-5728e349.js → SeriesSlider-f771e20d.js} +1 -1
  126. package/dist/esm/{SocialSearchComponent-68d948b9.js → SocialSearchComponent-165b4ae7.js} +1 -1
  127. package/dist/esm/TaxonomyDescription.js +7 -5
  128. package/dist/esm/TemplateNormal.js +4 -3
  129. package/dist/esm/{Tooltip-8307d9d1.js → Tooltip-95655b44.js} +67 -150
  130. package/dist/esm/Ustream.js +1 -1
  131. package/dist/esm/VideoProgramLandingPage.js +7 -5
  132. package/dist/esm/VideoSeriesLandingPage.js +5 -4
  133. package/dist/esm/VideoSeriesListing.js +3 -2
  134. package/dist/esm/View.js +10 -7
  135. package/dist/esm/YoutubeGroup.js +1 -1
  136. package/dist/esm/defineProperty-23a8f8cd.js +68 -0
  137. package/dist/esm/events-6c3a7a63.js +467 -0
  138. package/dist/esm/getSerializers.js +7 -5
  139. package/dist/esm/{index-3bb56969.js → index-5d8b0a9d.js} +161 -99
  140. package/dist/esm/{index-30a6257d.js → index-79cfd25c.js} +52 -53
  141. package/dist/esm/index-98ca9cec.js +100 -0
  142. package/dist/esm/{index-5cc7b406.js → index-f0fc23eb.js} +1 -466
  143. package/dist/esm/index.js +13 -10
  144. package/dist/esm/{main-9f6806ea.js → main-1894c974.js} +9 -4
  145. package/dist/esm/typeof-2f07d0e8.js +30 -0
  146. package/package.json +1 -1
  147. package/dist/cjs/index-b95410f0.js +0 -54
  148. package/dist/esm/index-174b5baf.js +0 -52
  149. /package/dist/cjs/{ADInfeed-ef933a08.js → ADInfeed-0394f391.js} +0 -0
  150. /package/dist/cjs/{ADlgInfeed-0e931f24.js → ADlgInfeed-759969d6.js} +0 -0
  151. /package/dist/esm/{ADInfeed-f946441a.js → ADInfeed-5765a73a.js} +0 -0
  152. /package/dist/esm/{ADlgInfeed-012e6f16.js → ADlgInfeed-5e36f317.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  import 'react';
2
- export { g as default } from './index-3bb56969.js';
2
+ export { g as default } from './index-5d8b0a9d.js';
3
3
  import './BlockContent-1e73bd2c.js';
4
4
  import './entities-6d9154b4.js';
5
5
  import './slicedToArray-6ebcbfea.js';
@@ -9,7 +9,8 @@ import './core.get-iterator-method-ea258bb1.js';
9
9
  import 'react-bootstrap';
10
10
  import './urlFor.js';
11
11
  import './index-3f5c03b2.js';
12
- import './index-5cc7b406.js';
12
+ import './index-f0fc23eb.js';
13
+ import './events-6c3a7a63.js';
13
14
  import 'prop-types';
14
15
  import 'next/router';
15
16
  import './index-c7e2ac95.js';
@@ -20,7 +21,7 @@ import './asyncToGenerator-958ef5fc.js';
20
21
  import './_library-528f1934.js';
21
22
  import './_iter-detect-98db3b07.js';
22
23
  import './Segment.js';
23
- import './main-9f6806ea.js';
24
+ import './main-1894c974.js';
24
25
  import './extends-6d8e3924.js';
25
26
  import './_object-pie-133f504a.js';
26
27
  import './urlForFile-b69adffc.js';
@@ -29,6 +30,9 @@ import 'react-dom';
29
30
  import './typeof-e9fc0c5d.js';
30
31
  import './_is-array-8d21b9e3.js';
31
32
  import './brightcove-react-player-loader.es-57a70a56.js';
33
+ import './_object-to-array-2300e51b.js';
34
+ import './keys-31dcdb31.js';
35
+ import './_object-sap-7cee6f84.js';
32
36
  import 'react-bootstrap/Modal';
33
37
  import 'react-bootstrap/Button';
34
38
  import 'react-bootstrap/Form';
@@ -39,7 +43,6 @@ import './moment-bc12cb97.js';
39
43
  import './SocialShare.js';
40
44
  import 'next/head';
41
45
  import 'react-share';
42
- import './_object-to-array-2300e51b.js';
43
46
  import './toConsumableArray-f7074d7c.js';
44
47
  import 'react-bootstrap/Pagination';
45
48
  import './AdSlot.js';
@@ -49,7 +52,6 @@ import './toNumber-5aeba6e7.js';
49
52
  import 'react-bootstrap/Row';
50
53
  import 'react-bootstrap/Col';
51
54
  import './inherits-a6ba2ec4.js';
52
- import './_object-sap-7cee6f84.js';
53
55
  import './define-property-5f1bda73.js';
54
56
  import './index.esm-eb1e8e80.js';
55
57
  import './iconBase-ccc56b97.js';
@@ -2,7 +2,7 @@ import React__default, { useState, useEffect, useRef, useLayoutEffect, useCallba
2
2
  import { _ as _slicedToArray, a as _getIterator } from './slicedToArray-6ebcbfea.js';
3
3
  import { Carousel, Table, Figure as Figure$1, Card, Row, Col, Button as Button$1, ProgressBar } from 'react-bootstrap';
4
4
  import urlFor from './urlFor.js';
5
- import { l as lib_3 } from './index-5cc7b406.js';
5
+ import { l as lib_3 } from './index-f0fc23eb.js';
6
6
  import Router, { useRouter } from 'next/router';
7
7
  import { g as getYoutubeId } from './index-c7e2ac95.js';
8
8
  import PropTypes from 'prop-types';
@@ -10,7 +10,7 @@ import { c as createCommonjsModule, u as unwrapExports } from './_commonjsHelper
10
10
  import { u as util } from './util-8ed16d48.js';
11
11
  import './Beam.js';
12
12
  import Segment from './Segment.js';
13
- import { e as main_18, b as main_42, m as main_43 } from './main-9f6806ea.js';
13
+ import { e as main_18, b as main_42, m as main_43 } from './main-1894c974.js';
14
14
  import { B as BlockContent } from './BlockContent-1e73bd2c.js';
15
15
  import { _ as _extends, b as _extends$1 } from './extends-6d8e3924.js';
16
16
  import { u as urlForFile } from './urlForFile-b69adffc.js';
@@ -19,6 +19,9 @@ import { _ as _asyncToGenerator, r as regenerator } from './asyncToGenerator-958
19
19
  import { _ as _typeof$1 } from './typeof-e9fc0c5d.js';
20
20
  import { R as ReactPlayerLoader } from './brightcove-react-player-loader.es-57a70a56.js';
21
21
  import { _ as _JSON$stringify } from './stringify-2b084bee.js';
22
+ import { _ as _export, a as _core } from './core.get-iterator-method-ea258bb1.js';
23
+ import { _ as _objectToArray } from './_object-to-array-2300e51b.js';
24
+ import { _ as _Object$keys } from './keys-31dcdb31.js';
22
25
  import Modal from 'react-bootstrap/Modal';
23
26
  import Button from 'react-bootstrap/Button';
24
27
  import Form from 'react-bootstrap/Form';
@@ -26,8 +29,6 @@ import ReactGA from 'react-ga';
26
29
  import GroupDeck from './GroupDeck.js';
27
30
  import { m as moment } from './moment-bc12cb97.js';
28
31
  import SocialShare from './SocialShare.js';
29
- import { _ as _export, a as _core } from './core.get-iterator-method-ea258bb1.js';
30
- import { _ as _objectToArray } from './_object-to-array-2300e51b.js';
31
32
  import { a as _Array$from, _ as _toConsumableArray } from './toConsumableArray-f7074d7c.js';
32
33
  import Pagination from 'react-bootstrap/Pagination';
33
34
  import { h as html_decode_1 } from './entities-6d9154b4.js';
@@ -1628,11 +1629,13 @@ function shouldUpdateVideo(prevProps, props) {
1628
1629
 
1629
1630
  function filterResetOptions(opts) {
1630
1631
  return _objectSpread(_objectSpread({}, opts), {}, {
1631
- playerVars: _objectSpread({
1632
+ height: 0,
1633
+ width: 0,
1634
+ playerVars: _objectSpread(_objectSpread({}, opts.playerVars), {}, {
1632
1635
  autoplay: 0,
1633
1636
  start: 0,
1634
1637
  end: 0
1635
- }, opts.playerVars)
1638
+ })
1636
1639
  });
1637
1640
  }
1638
1641
  /**
@@ -1647,7 +1650,7 @@ function filterResetOptions(opts) {
1647
1650
 
1648
1651
 
1649
1652
  function shouldResetPlayer(prevProps, props) {
1650
- return !fastDeepEqual(filterResetOptions(prevProps.opts), filterResetOptions(props.opts));
1653
+ return prevProps.videoId !== props.videoId || !fastDeepEqual(filterResetOptions(prevProps.opts), filterResetOptions(props.opts));
1651
1654
  }
1652
1655
  /**
1653
1656
  * Check whether a props change should result in an id or className update.
@@ -1658,7 +1661,7 @@ function shouldResetPlayer(prevProps, props) {
1658
1661
 
1659
1662
 
1660
1663
  function shouldUpdatePlayer(prevProps, props) {
1661
- return prevProps.id !== props.id || prevProps.className !== props.className;
1664
+ return prevProps.id !== props.id || prevProps.className !== props.className || prevProps.opts.width !== props.opts.width || prevProps.opts.height !== props.opts.height || prevProps.title !== props.title;
1662
1665
  }
1663
1666
 
1664
1667
  var YouTube = /*#__PURE__*/function (_React$Component) {
@@ -1745,6 +1748,9 @@ var YouTube = /*#__PURE__*/function (_React$Component) {
1745
1748
  _this.internalPlayer.getIframe().then(function (iframe) {
1746
1749
  if (_this.props.id) iframe.setAttribute('id', _this.props.id);else iframe.removeAttribute('id');
1747
1750
  if (_this.props.className) iframe.setAttribute('class', _this.props.className);else iframe.removeAttribute('class');
1751
+ if (_this.props.opts && _this.props.opts.width) iframe.setAttribute('width', _this.props.opts.width);else iframe.removeAttribute('width');
1752
+ if (_this.props.opts && _this.props.opts.height) iframe.setAttribute('height', _this.props.opts.height);else iframe.removeAttribute('height');
1753
+ if (typeof _this.props.title === 'string') iframe.setAttribute('title', _this.props.title);else iframe.setAttribute('title', 'YouTube video player');
1748
1754
  });
1749
1755
  });
1750
1756
 
@@ -1843,7 +1849,8 @@ var YouTube = /*#__PURE__*/function (_React$Component) {
1843
1849
  }, /*#__PURE__*/React__default.createElement("div", {
1844
1850
  id: this.props.id,
1845
1851
  className: this.props.className,
1846
- ref: this.refContainer
1852
+ ref: this.refContainer,
1853
+ loading: this.props.loading
1847
1854
  }));
1848
1855
  }
1849
1856
  }]);
@@ -1868,6 +1875,10 @@ YouTube.propTypes = {
1868
1875
  className: PropTypes.string,
1869
1876
  // custom class name for player container element
1870
1877
  containerClassName: PropTypes.string,
1878
+ // custom title for the iFrame, see https://www.w3.org/TR/WCAG20-TECHS/H64.html
1879
+ title: PropTypes.string,
1880
+ // custom loading for player element
1881
+ loading: PropTypes.oneOf(['lazy', 'eager', 'auto']),
1871
1882
  // https://developers.google.com/youtube/iframe_api_reference#Loading_a_Video_Player
1872
1883
  opts: PropTypes.objectOf(PropTypes.any),
1873
1884
  // event subscriptions
@@ -1884,6 +1895,7 @@ YouTube.defaultProps = {
1884
1895
  videoId: null,
1885
1896
  id: null,
1886
1897
  className: null,
1898
+ loading: null,
1887
1899
  opts: {},
1888
1900
  containerClassName: '',
1889
1901
  onReady: function onReady() {},
@@ -1893,7 +1905,8 @@ YouTube.defaultProps = {
1893
1905
  onEnd: function onEnd() {},
1894
1906
  onStateChange: function onStateChange() {},
1895
1907
  onPlaybackRateChange: function onPlaybackRateChange() {},
1896
- onPlaybackQualityChange: function onPlaybackQualityChange() {}
1908
+ onPlaybackQualityChange: function onPlaybackQualityChange() {},
1909
+ title: null
1897
1910
  };
1898
1911
 
1899
1912
  var YouTubePlayer = function YouTubePlayer(_ref) {
@@ -2199,6 +2212,24 @@ var IFrame = function IFrame(_ref) {
2199
2212
  );
2200
2213
  };
2201
2214
 
2215
+ // https://github.com/tc39/proposal-object-values-entries
2216
+
2217
+ var $values = _objectToArray(false);
2218
+
2219
+ _export(_export.S, 'Object', {
2220
+ values: function values(it) {
2221
+ return $values(it);
2222
+ }
2223
+ });
2224
+
2225
+ var values$1 = _core.Object.values;
2226
+
2227
+ var values = createCommonjsModule(function (module) {
2228
+ module.exports = { "default": values$1, __esModule: true };
2229
+ });
2230
+
2231
+ var _Object$values = unwrapExports(values);
2232
+
2202
2233
  var PopupMultiChoice = function PopupMultiChoice(_ref) {
2203
2234
  var question = _ref.question,
2204
2235
  choices = _ref.choices,
@@ -2209,7 +2240,7 @@ var PopupMultiChoice = function PopupMultiChoice(_ref) {
2209
2240
  inline: true,
2210
2241
  label: choice.choiceText,
2211
2242
  value: choice.choiceText,
2212
- name: 'radioButton',
2243
+ name: question,
2213
2244
  type: 'radio',
2214
2245
  className: 'radioButton',
2215
2246
  onClick: handlePollAnswer
@@ -2279,10 +2310,15 @@ var PopupPollModal = function PopupPollModal(props) {
2279
2310
  pollAnswer = _useState2[0],
2280
2311
  setPollAnswer = _useState2[1];
2281
2312
 
2282
- var _useState3 = useState(''),
2313
+ var _useState3 = useState({}),
2283
2314
  _useState4 = _slicedToArray(_useState3, 2),
2284
- textAnswer = _useState4[0],
2285
- setTextAnswer = _useState4[1];
2315
+ multiItemPollAnswers = _useState4[0],
2316
+ setMultiItemPollAnswers = _useState4[1];
2317
+
2318
+ var _useState5 = useState(''),
2319
+ _useState6 = _slicedToArray(_useState5, 2),
2320
+ textAnswer = _useState6[0],
2321
+ setTextAnswer = _useState6[1];
2286
2322
 
2287
2323
  useEffect(function () {
2288
2324
  var modal = document.getElementById('modalDiv');
@@ -2297,77 +2333,98 @@ var PopupPollModal = function PopupPollModal(props) {
2297
2333
  setPollAnswer(e.target.value);
2298
2334
  };
2299
2335
 
2336
+ var handleMultiItemPollAnswers = function handleMultiItemPollAnswers(e) {
2337
+ var question = e.target.name;
2338
+ var answer = e.target.value;
2339
+ var tempObj = {};
2340
+ tempObj[question] = answer;
2341
+ setMultiItemPollAnswers(function (prev) {
2342
+ return _extends({}, prev, tempObj);
2343
+ });
2344
+ };
2345
+
2300
2346
  var handleSubmit = function handleSubmit(e) {
2301
2347
  var currentDate = new Date(Date.now()).toUTCString();
2302
2348
  // eslint-disable-next-line no-undef
2303
2349
  var anonymousID = typeof analytics !== 'undefined' && typeof analytics.user === 'function' && analytics.user() && analytics.user().anonymousId();
2350
+ var formData = {};
2351
+
2304
2352
  pollItems.forEach(function (item) {
2305
- var submitAnswer = void 0;
2306
- if (item.format === 'multiChoice') submitAnswer = pollAnswer;
2307
- if (item.format === 'textInput') submitAnswer = textAnswer;
2308
- var formData = {
2353
+ formData = {
2309
2354
  uuid: anonymousID,
2310
2355
  url: pollUrl,
2311
2356
  date: currentDate,
2312
- question: item.question,
2313
- answer: submitAnswer
2357
+ questionsArray: _Object$keys(multiItemPollAnswers),
2358
+ answersArray: _Object$values(multiItemPollAnswers)
2314
2359
  };
2315
- var requestOptions = {
2316
- method: 'POST',
2317
- headers: { 'content-type': 'application/json' },
2318
- body: _JSON$stringify({ data: formData })
2319
- };
2320
- var insertData = function () {
2321
- var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
2322
- return regenerator.wrap(function _callee$(_context) {
2323
- while (1) {
2324
- switch (_context.prev = _context.next) {
2325
- case 0:
2326
- _context.prev = 0;
2327
- _context.next = 3;
2328
- return fetch('/api/popup_polls', requestOptions).then(function (res) {
2329
- return res.json();
2330
- }).then(function (res) {
2331
- return console.log(res);
2332
- });
2333
-
2334
- case 3:
2335
- _context.next = 8;
2336
- break;
2337
-
2338
- case 5:
2339
- _context.prev = 5;
2340
- _context.t0 = _context['catch'](0);
2341
-
2342
- if (_context.t0) console.log('There was an error in insertData in PopupPollModal.js: ' + _context.t0);
2343
-
2344
- case 8:
2345
- case 'end':
2346
- return _context.stop();
2347
- }
2360
+ item.question ? formData.question = item.question : null;
2361
+ pollAnswer && item.format === 'multiChoice' ? formData.answer = pollAnswer : pollAnswer && item.format === 'textInput' ? formData.answer = textAnswer : null;
2362
+ _Object$keys(multiItemPollAnswers).length > 0 ? formData.multiItemQandA = multiItemPollAnswers : null;
2363
+ });
2364
+ var requestOptions = {
2365
+ method: 'POST',
2366
+ headers: { 'content-type': 'application/json' },
2367
+ body: _JSON$stringify({ data: formData })
2368
+ };
2369
+ var insertData = function () {
2370
+ var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
2371
+ return regenerator.wrap(function _callee$(_context) {
2372
+ while (1) {
2373
+ switch (_context.prev = _context.next) {
2374
+ case 0:
2375
+ _context.prev = 0;
2376
+ _context.next = 3;
2377
+ return fetch('/api/popup_polls', requestOptions).then(function (res) {
2378
+ return res.json();
2379
+ }).then(function (res) {
2380
+ return console.log(res);
2381
+ });
2382
+
2383
+ case 3:
2384
+ _context.next = 8;
2385
+ break;
2386
+
2387
+ case 5:
2388
+ _context.prev = 5;
2389
+ _context.t0 = _context['catch'](0);
2390
+
2391
+ if (_context.t0) console.log('There was an error in insertData in PopupPollModal.js: ' + _context.t0);
2392
+
2393
+ case 8:
2394
+ case 'end':
2395
+ return _context.stop();
2348
2396
  }
2349
- }, _callee, _this, [[0, 5]]);
2350
- }));
2397
+ }
2398
+ }, _callee, _this, [[0, 5]]);
2399
+ }));
2351
2400
 
2352
- return function insertData() {
2353
- return _ref.apply(this, arguments);
2354
- };
2355
- }();
2356
- console.log('formData', formData);
2357
- insertData();
2358
- });
2401
+ return function insertData() {
2402
+ return _ref.apply(this, arguments);
2403
+ };
2404
+ }();
2405
+ // console.log('formData', formData)
2406
+ insertData();
2359
2407
  restartPlayer();
2360
- // setIsPollingTime(false)
2361
2408
  e.preventDefault();
2362
2409
  };
2363
2410
 
2364
2411
  var pollArray = [];
2412
+
2365
2413
  pollItems.forEach(function (item, ind) {
2366
- if (item.format === 'multiChoice') {
2367
- pollArray.push(React__default.createElement(PopupMultiChoice, { question: item.question, choices: item.choices, handlePollAnswer: handlePollAnswer, key: ind }));
2368
- }
2369
- if (item.format === 'textInput') {
2370
- pollArray.push(React__default.createElement(PopupPollTextInput, { textInputQuestion: item.question, textanswer: textAnswer, handleTextAnswer: handleTextAnswer, key: ind }));
2414
+ if (!item.atStart) {
2415
+ if (item.format === 'multiChoice') {
2416
+ pollArray.push(React__default.createElement(PopupMultiChoice, { question: item.question, choices: item.choices, handlePollAnswer: handlePollAnswer, key: ind }));
2417
+ }
2418
+ if (item.format === 'textInput') {
2419
+ pollArray.push(React__default.createElement(PopupPollTextInput, { textInputQuestion: item.question, textanswer: textAnswer, handleTextAnswer: handleTextAnswer, key: ind }));
2420
+ }
2421
+ } else {
2422
+ if (item.pollItems[0] && item.pollItems[0].format === 'multiChoice') {
2423
+ pollArray.push(React__default.createElement(PopupMultiChoice, { question: item.pollItems[0].question, choices: item.pollItems[0].choices, handlePollAnswer: handleMultiItemPollAnswers, key: ind }));
2424
+ }
2425
+ if (item.pollItems[0] && item.pollItems[0].format === 'textInput') {
2426
+ pollArray.push(React__default.createElement(PopupPollTextInput, { textInputQuestion: item.pollItems[0].question, textanswer: textAnswer, handleTextAnswer: handleTextAnswer, key: ind }));
2427
+ }
2371
2428
  }
2372
2429
  });
2373
2430
 
@@ -2376,7 +2433,10 @@ var PopupPollModal = function PopupPollModal(props) {
2376
2433
  { className: 'modalDiv', id: 'modalDiv' },
2377
2434
  React__default.createElement(
2378
2435
  Modal.Dialog,
2379
- null,
2436
+ { className: pollItems.length > 1 ? 'modal-dialog-overflow' : null, scrollable: pollItems.length > 1 },
2437
+ props.closeable && React__default.createElement(Modal.Header, { closeButton: true, onClick: function onClick() {
2438
+ return restartPlayer();
2439
+ } }),
2380
2440
  React__default.createElement(
2381
2441
  Modal.Body,
2382
2442
  null,
@@ -2388,10 +2448,14 @@ var PopupPollModal = function PopupPollModal(props) {
2388
2448
  Button,
2389
2449
  { className: 'submitButton', type: 'submit', variant: 'success', disabled: !textAnswer },
2390
2450
  'Submit'
2391
- ) : React__default.createElement(
2451
+ ) : !textInputRender && multiChoiceRender ? React__default.createElement(
2392
2452
  Button,
2393
2453
  { className: 'submitButton', type: 'submit', variant: 'success', disabled: !pollAnswer },
2394
2454
  'Submit'
2455
+ ) : React__default.createElement(
2456
+ Button,
2457
+ { className: 'submitButton', type: 'submit', variant: 'success' },
2458
+ 'Submit'
2395
2459
  )
2396
2460
  )
2397
2461
  )
@@ -2610,6 +2674,7 @@ var Video = function Video(_ref) {
2610
2674
  experienceID = node.experienceID;
2611
2675
 
2612
2676
  var polls = void 0;
2677
+
2613
2678
  if (node.polls) polls = node.polls;
2614
2679
 
2615
2680
  var _useState = useState(false),
@@ -2654,10 +2719,16 @@ var Video = function Video(_ref) {
2654
2719
  return minutes * 60 + seconds;
2655
2720
  };
2656
2721
  var modalTimes = [];
2722
+ var initPolls = [];
2723
+ var nonInitPolls = [];
2657
2724
  if (polls) {
2658
2725
  polls.forEach(function (pollObj) {
2659
- return modalTimes.push(convertTime(pollObj.timestamp));
2726
+ return pollObj.timestamp !== '0:00' && pollObj.timestamp !== '00:00' ? modalTimes.push(convertTime(pollObj.timestamp)) : null;
2660
2727
  });
2728
+ polls.forEach(function (pollObj) {
2729
+ return pollObj.atStart ? initPolls.push(pollObj) : nonInitPolls.push(pollObj);
2730
+ });
2731
+ if (nonInitPolls.length > 0) polls = nonInitPolls;
2661
2732
  }
2662
2733
 
2663
2734
  var restartPlayer = function restartPlayer() {
@@ -2732,7 +2803,14 @@ var Video = function Video(_ref) {
2732
2803
  return _ref2.apply(this, arguments);
2733
2804
  };
2734
2805
  }();
2735
-
2806
+ // console.log('initPolls', initPolls)
2807
+ if (initPolls.length > 0) {
2808
+ player.pause();
2809
+ setPollItems(initPolls);
2810
+ setPollUrl(targeting.document_url[0]);
2811
+ setIsPollingTime(true);
2812
+ initPolls = [];
2813
+ }
2736
2814
  if (autoplay) {
2737
2815
  autoPlayVideo();
2738
2816
  }
@@ -2740,20 +2818,15 @@ var Video = function Video(_ref) {
2740
2818
  // Beam.report_beam_video('Ready', deviceType, duration, current, segment, 'BrightCove', accountIDs.brightcove.playerId, accountIDs.brightcove.accountId, videoID)
2741
2819
  Segment.report_video_event('Video Ready', main_18, duration, current, segment, 'BrightCove', accountIDs.brightcove.playerId, accountIDs.brightcove.accountId, videoID);
2742
2820
  });
2743
- // let intId
2744
- // const convertTime = (timeStr) => {
2745
- // const minutes = parseInt(timeStr.slice(0, 2))
2746
- // const seconds = parseInt(timeStr.slice(3))
2747
- // return minutes * 60 + seconds
2748
- // }
2749
- // const modalTimes = []
2750
- // polls.forEach(pollObj => modalTimes.push(convertTime(pollObj.timestamp)))
2821
+
2751
2822
  player.on('play', function (evt) {
2823
+ console.log('in player.on');
2752
2824
  var duration = player.mediainfo.duration;
2753
2825
  var current = player.currentTime();
2754
2826
  var queue = Math.floor(duration / 10);
2755
2827
  var segment = Math.floor(current / queue);
2756
- if (polls) {
2828
+
2829
+ if (polls && initPolls.length === 0) {
2757
2830
  var vidPlayer = this;
2758
2831
  intId = setInterval(function () {
2759
2832
  var ct = player.currentTime();
@@ -2854,6 +2927,8 @@ var Video = function Video(_ref) {
2854
2927
  , textInputRender: textInputRender
2855
2928
  // eslint-disable-next-line react/jsx-indent-props
2856
2929
  , multiChoiceRender: multiChoiceRender
2930
+ // eslint-disable-next-line react/jsx-indent-props
2931
+ , closeable: node.polls && node.polls[0] ? node.polls[0].closeable : null
2857
2932
  }) : null,
2858
2933
  React__default.createElement(ReactPlayerLoader, {
2859
2934
  onSuccess: onVideoSuccess,
@@ -2886,6 +2961,8 @@ var Video = function Video(_ref) {
2886
2961
  , textInputRender: textInputRender
2887
2962
  // eslint-disable-next-line react/jsx-indent-props
2888
2963
  , multiChoiceRender: multiChoiceRender
2964
+ // eslint-disable-next-line react/jsx-indent-props
2965
+ , closeable: node.polls && node.polls[0] ? node.polls[0].closeable : null
2889
2966
  }) : null,
2890
2967
  React__default.createElement(ReactPlayerLoader, {
2891
2968
  accountId: accountIDs.brightcove.accountId,
@@ -2919,6 +2996,9 @@ var Video = function Video(_ref) {
2919
2996
  , textInputRender: textInputRender
2920
2997
  // eslint-disable-next-line react/jsx-indent-props
2921
2998
  , multiChoiceRender: multiChoiceRender
2999
+ // eslint-disable-next-line react/jsx-indent-props
3000
+ , closeable: node.polls && node.polls[0] ? node.polls[0].closeable : null
3001
+
2922
3002
  }) : null
2923
3003
  );
2924
3004
  }
@@ -8135,24 +8215,6 @@ var Poll$1 = function Poll(_ref) {
8135
8215
  );
8136
8216
  };
8137
8217
 
8138
- // https://github.com/tc39/proposal-object-values-entries
8139
-
8140
- var $values = _objectToArray(false);
8141
-
8142
- _export(_export.S, 'Object', {
8143
- values: function values(it) {
8144
- return $values(it);
8145
- }
8146
- });
8147
-
8148
- var values$1 = _core.Object.values;
8149
-
8150
- var values = createCommonjsModule(function (module) {
8151
- module.exports = { "default": values$1, __esModule: true };
8152
- });
8153
-
8154
- var _Object$values = unwrapExports(values);
8155
-
8156
8218
  var Poll = function Poll(_ref) {
8157
8219
  var node = _ref.node;
8158
8220
  _ref.client;