@mjhls/mjh-framework 1.0.239 → 1.0.241

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 (49) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/AdSlot-c472fff6.js +1192 -0
  3. package/dist/cjs/DeckContent.js +6 -5
  4. package/dist/cjs/DeckQueue.js +5 -5
  5. package/dist/cjs/{Dfp-045b016b.js → Dfp-7a5533f9.js} +1 -1
  6. package/dist/cjs/{GridContent-21bc198f.js → GridContent-463c504f.js} +7 -7
  7. package/dist/cjs/GridContent.js +8 -7
  8. package/dist/cjs/MasterDeck.js +331 -13
  9. package/dist/cjs/{Normal-c89b709d.js → Normal-0f06cc52.js} +3 -3
  10. package/dist/cjs/QueueDeckExpanded.js +2 -2
  11. package/dist/cjs/TemplateNormal.js +6 -5
  12. package/dist/cjs/VideoSeriesListing.js +2 -2
  13. package/dist/cjs/{debounce-bbca43c4.js → debounce-783eb233.js} +3 -0
  14. package/dist/cjs/{get-af2516a4.js → get-1f91592f.js} +1 -1
  15. package/dist/cjs/index.js +399 -1151
  16. package/dist/cjs/{inherits-5b5ca8db.js → inherits-9898af5a.js} +2 -4
  17. package/dist/cjs/{main-d9a1b014.js → main-0ea1b808.js} +51 -0
  18. package/dist/cjs/{MasterDeck-f8fbac3c.js → promise-b96c61f8.js} +7 -340
  19. package/dist/cjs/{toConsumableArray-7e4caf3c.js → toConsumableArray-f05a306f.js} +5 -52
  20. package/dist/esm/AdSlot-bdd7a629.js +1183 -0
  21. package/dist/esm/DeckContent.js +11 -10
  22. package/dist/esm/DeckQueue.js +9 -9
  23. package/dist/esm/{Dfp-01f14ae3.js → Dfp-71879c9d.js} +5 -5
  24. package/dist/esm/{GridContent-73c97039.js → GridContent-2a48fb19.js} +8 -8
  25. package/dist/esm/GridContent.js +13 -12
  26. package/dist/esm/MasterDeck.js +333 -15
  27. package/dist/esm/{Normal-fdd55386.js → Normal-aa76b53c.js} +4 -4
  28. package/dist/esm/QueueDeckExpanded.js +7 -7
  29. package/dist/esm/{TaxonomyCard-a7b7ded8.js → TaxonomyCard-2d0ab635.js} +1 -1
  30. package/dist/esm/TaxonomyCard.js +3 -3
  31. package/dist/esm/TemplateNormal.js +10 -9
  32. package/dist/esm/{Ustream-62a07a32.js → Ustream-d51b9b11.js} +1 -1
  33. package/dist/esm/Ustream.js +5 -5
  34. package/dist/esm/VideoSeriesListing.js +5 -5
  35. package/dist/esm/{_to-object-86553f76.js → _to-object-b9b796ec.js} +1 -1
  36. package/dist/esm/{core.get-iterator-method-709061dc.js → core.get-iterator-method-31c1fb1a.js} +2 -2
  37. package/dist/esm/{debounce-fa7fbf11.js → debounce-806f886b.js} +3 -1
  38. package/dist/esm/{extends-7f88fa22.js → extends-dbbe308d.js} +1 -1
  39. package/dist/esm/{get-8d382479.js → get-b2201dc8.js} +1 -1
  40. package/dist/esm/index.js +407 -1161
  41. package/dist/esm/{inherits-a82a4471.js → inherits-a75c8a1c.js} +5 -6
  42. package/dist/esm/{main-eecf7b27.js → main-155ec04f.js} +48 -1
  43. package/dist/esm/{MasterDeck-238f31d7.js → promise-683a9c54.js} +6 -335
  44. package/dist/esm/{slicedToArray-eb7eca9e.js → slicedToArray-d0a9593a.js} +3 -3
  45. package/dist/esm/{toConsumableArray-08d50169.js → toConsumableArray-eb308ede.js} +5 -49
  46. package/dist/esm/{web.dom.iterable-f05d2f57.js → web.dom.iterable-3be50d6c.js} +2 -2
  47. package/package.json +4 -2
  48. package/dist/cjs/AdSlot-1fe1c231.js +0 -69
  49. package/dist/esm/AdSlot-017b8051.js +0 -64
package/dist/cjs/index.js CHANGED
@@ -7,10 +7,12 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
7
7
  var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
8
8
  var _toObject = require('./_to-object-329a650b.js');
9
9
  require('./web.dom.iterable-0998bdc3.js');
10
- var inherits$2 = require('./inherits-5b5ca8db.js');
11
- var toConsumableArray = require('./toConsumableArray-7e4caf3c.js');
10
+ var debounce = require('./debounce-783eb233.js');
11
+ var main = require('./main-0ea1b808.js');
12
+ var toConsumableArray = require('./toConsumableArray-f05a306f.js');
12
13
  require('./core.get-iterator-method-e049ca4a.js');
13
14
  var _extends$2 = require('./extends-e94dbea5.js');
15
+ var inherits$2 = require('./inherits-9898af5a.js');
14
16
  var React = require('react');
15
17
  var React__default = _interopDefault(React);
16
18
  var index = require('./index-fa3cec70.js');
@@ -23,17 +25,16 @@ var visibilitySensor = require('./visibility-sensor-b72d9527.js');
23
25
  var Link = _interopDefault(require('next/link'));
24
26
  var Router = require('next/router');
25
27
  var Router__default = _interopDefault(Router);
26
- var debounce = require('./debounce-bbca43c4.js');
27
28
  require('react-dom');
28
29
  var index$1 = require('./index-be0c82be.js');
29
30
  require('./index-fa0fb52c.js');
30
- var main = require('./main-d9a1b014.js');
31
31
  var entities = require('./entities-310b46ee.js');
32
32
  var slicedToArray = require('./slicedToArray-e38fb29d.js');
33
- var AdSlot = require('./AdSlot-1fe1c231.js');
33
+ var AdSlot = require('./AdSlot-c472fff6.js');
34
+ require('./promise-b96c61f8.js');
34
35
  var DeckContent = require('./DeckContent.js');
35
- require('./get-af2516a4.js');
36
- var GridContent = require('./GridContent-21bc198f.js');
36
+ require('./get-1f91592f.js');
37
+ var GridContent = require('./GridContent-463c504f.js');
37
38
  var DeckQueue = require('./DeckQueue.js');
38
39
  require('react-bootstrap/Media');
39
40
  var ThumbnailCard = require('./ThumbnailCard.js');
@@ -44,14 +45,14 @@ var reactBootstrap = require('react-bootstrap');
44
45
  var QueueDeckExpanded = require('./QueueDeckExpanded.js');
45
46
  var index_esm = require('./index.esm-340d3792.js');
46
47
  var VideoSeriesListing = require('./VideoSeriesListing.js');
47
- var MasterDeck = require('./MasterDeck-f8fbac3c.js');
48
+ var MasterDeck = require('./MasterDeck.js');
48
49
  var Button = _interopDefault(require('react-bootstrap/Button'));
49
50
  var PublicationDeck = require('./PublicationDeck.js');
50
51
  var IssueDeck = require('./IssueDeck.js');
51
52
  require('react-bootstrap/Badge');
52
53
  var IssueContentDeck = require('./IssueContentDeck.js');
53
54
  var Spinner = _interopDefault(require('react-bootstrap/Spinner'));
54
- var TemplateNormal = require('./Normal-c89b709d.js');
55
+ var TemplateNormal = require('./Normal-0f06cc52.js');
55
56
  require('react-bootstrap/ListGroup');
56
57
  var Head = _interopDefault(require('next/head'));
57
58
  var Accordion = _interopDefault(require('react-bootstrap/Accordion'));
@@ -69,17 +70,6 @@ var DropdownButton = _interopDefault(require('react-bootstrap/DropdownButton'));
69
70
  var Dropdown = _interopDefault(require('react-bootstrap/Dropdown'));
70
71
  var Ustream = require('./Ustream-85b14a8d.js');
71
72
 
72
- var $JSON = _toObject._core.JSON || (_toObject._core.JSON = { stringify: JSON.stringify });
73
- var stringify = function stringify(it) { // eslint-disable-line no-unused-vars
74
- return $JSON.stringify.apply($JSON, arguments);
75
- };
76
-
77
- var stringify$1 = _commonjsHelpers.createCommonjsModule(function (module) {
78
- module.exports = { "default": stringify, __esModule: true };
79
- });
80
-
81
- var _JSON$stringify = _commonjsHelpers.unwrapExports(stringify$1);
82
-
83
73
  var momentTimezone = _commonjsHelpers.createCommonjsModule(function (module) {
84
74
  //! moment-timezone.js
85
75
  //! version : 0.5.31
@@ -1631,12 +1621,12 @@ var latest = {
1631
1621
  };
1632
1622
 
1633
1623
  var latest$1 = /*#__PURE__*/Object.freeze({
1634
- __proto__: null,
1635
- version: version,
1636
- zones: zones,
1637
- links: links,
1638
- countries: countries,
1639
- 'default': latest
1624
+ __proto__: null,
1625
+ version: version,
1626
+ zones: zones,
1627
+ links: links,
1628
+ countries: countries,
1629
+ 'default': latest
1640
1630
  });
1641
1631
 
1642
1632
  var require$$1 = _commonjsHelpers.getCjsExportFromNamespace(latest$1);
@@ -1646,10 +1636,166 @@ var moment = module.exports = momentTimezone;
1646
1636
  moment.tz.load(require$$1);
1647
1637
  });
1648
1638
 
1639
+ var js_cookie = _commonjsHelpers.createCommonjsModule(function (module, exports) {
1640
+ (function (factory) {
1641
+ var registeredInModuleLoader;
1642
+ {
1643
+ module.exports = factory();
1644
+ registeredInModuleLoader = true;
1645
+ }
1646
+ if (!registeredInModuleLoader) {
1647
+ var OldCookies = window.Cookies;
1648
+ var api = window.Cookies = factory();
1649
+ api.noConflict = function () {
1650
+ window.Cookies = OldCookies;
1651
+ return api;
1652
+ };
1653
+ }
1654
+ }(function () {
1655
+ function extend () {
1656
+ var i = 0;
1657
+ var result = {};
1658
+ for (; i < arguments.length; i++) {
1659
+ var attributes = arguments[ i ];
1660
+ for (var key in attributes) {
1661
+ result[key] = attributes[key];
1662
+ }
1663
+ }
1664
+ return result;
1665
+ }
1666
+
1667
+ function decode (s) {
1668
+ return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
1669
+ }
1670
+
1671
+ function init (converter) {
1672
+ function api() {}
1673
+
1674
+ function set (key, value, attributes) {
1675
+ if (typeof document === 'undefined') {
1676
+ return;
1677
+ }
1678
+
1679
+ attributes = extend({
1680
+ path: '/'
1681
+ }, api.defaults, attributes);
1682
+
1683
+ if (typeof attributes.expires === 'number') {
1684
+ attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);
1685
+ }
1686
+
1687
+ // We're using "expires" because "max-age" is not supported by IE
1688
+ attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
1689
+
1690
+ try {
1691
+ var result = JSON.stringify(value);
1692
+ if (/^[\{\[]/.test(result)) {
1693
+ value = result;
1694
+ }
1695
+ } catch (e) {}
1696
+
1697
+ value = converter.write ?
1698
+ converter.write(value, key) :
1699
+ encodeURIComponent(String(value))
1700
+ .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
1701
+
1702
+ key = encodeURIComponent(String(key))
1703
+ .replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)
1704
+ .replace(/[\(\)]/g, escape);
1705
+
1706
+ var stringifiedAttributes = '';
1707
+ for (var attributeName in attributes) {
1708
+ if (!attributes[attributeName]) {
1709
+ continue;
1710
+ }
1711
+ stringifiedAttributes += '; ' + attributeName;
1712
+ if (attributes[attributeName] === true) {
1713
+ continue;
1714
+ }
1715
+
1716
+ // Considers RFC 6265 section 5.2:
1717
+ // ...
1718
+ // 3. If the remaining unparsed-attributes contains a %x3B (";")
1719
+ // character:
1720
+ // Consume the characters of the unparsed-attributes up to,
1721
+ // not including, the first %x3B (";") character.
1722
+ // ...
1723
+ stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
1724
+ }
1725
+
1726
+ return (document.cookie = key + '=' + value + stringifiedAttributes);
1727
+ }
1728
+
1729
+ function get (key, json) {
1730
+ if (typeof document === 'undefined') {
1731
+ return;
1732
+ }
1733
+
1734
+ var jar = {};
1735
+ // To prevent the for loop in the first place assign an empty array
1736
+ // in case there are no cookies at all.
1737
+ var cookies = document.cookie ? document.cookie.split('; ') : [];
1738
+ var i = 0;
1739
+
1740
+ for (; i < cookies.length; i++) {
1741
+ var parts = cookies[i].split('=');
1742
+ var cookie = parts.slice(1).join('=');
1743
+
1744
+ if (!json && cookie.charAt(0) === '"') {
1745
+ cookie = cookie.slice(1, -1);
1746
+ }
1747
+
1748
+ try {
1749
+ var name = decode(parts[0]);
1750
+ cookie = (converter.read || converter)(cookie, name) ||
1751
+ decode(cookie);
1752
+
1753
+ if (json) {
1754
+ try {
1755
+ cookie = JSON.parse(cookie);
1756
+ } catch (e) {}
1757
+ }
1758
+
1759
+ jar[name] = cookie;
1760
+
1761
+ if (key === name) {
1762
+ break;
1763
+ }
1764
+ } catch (e) {}
1765
+ }
1766
+
1767
+ return key ? jar[key] : jar;
1768
+ }
1769
+
1770
+ api.set = set;
1771
+ api.get = function (key) {
1772
+ return get(key, false /* read as raw */);
1773
+ };
1774
+ api.getJSON = function (key) {
1775
+ return get(key, true /* read as json */);
1776
+ };
1777
+ api.remove = function (key, attributes) {
1778
+ set(key, '', extend(attributes, {
1779
+ expires: -1
1780
+ }));
1781
+ };
1782
+
1783
+ api.defaults = {};
1784
+
1785
+ api.withConverter = init;
1786
+
1787
+ return api;
1788
+ }
1789
+
1790
+ return init(function () {});
1791
+ }));
1792
+ });
1793
+
1649
1794
  var clientId = process.env.CVENT_CLIENT_ID;
1650
1795
  var clientSecret = process.env.CVENT_CLIENT_SECRET;
1651
1796
  var corsProxy = 'https://cors-anywhere.herokuapp.com/';
1652
1797
  var currentTime = momentTimezone$1().toISOString();
1798
+ var itemsPerPage = 10;
1653
1799
 
1654
1800
  var EventsDeck = function EventsDeck(_ref) {
1655
1801
  var _ref$autoScroll = _ref.autoScroll,
@@ -1680,8 +1826,8 @@ var EventsDeck = function EventsDeck(_ref) {
1680
1826
 
1681
1827
  var _useState7 = React.useState(null),
1682
1828
  _useState8 = slicedToArray._slicedToArray(_useState7, 2),
1683
- nextPagingToken = _useState8[0],
1684
- setNextPagingToken = _useState8[1];
1829
+ nextPageLink = _useState8[0],
1830
+ setNextPageLink = _useState8[1];
1685
1831
 
1686
1832
  var _useState9 = React.useState(true),
1687
1833
  _useState10 = slicedToArray._slicedToArray(_useState9, 2),
@@ -1690,41 +1836,37 @@ var EventsDeck = function EventsDeck(_ref) {
1690
1836
 
1691
1837
  var _useState11 = React.useState(1),
1692
1838
  _useState12 = slicedToArray._slicedToArray(_useState11, 2),
1693
- page = _useState12[0],
1694
- setPage = _useState12[1];
1839
+ currentPage = _useState12[0],
1840
+ setCurrentPage = _useState12[1];
1695
1841
 
1696
- var _useState13 = React.useState(1),
1697
- _useState14 = slicedToArray._slicedToArray(_useState13, 2),
1698
- currentPage = _useState14[0],
1699
- setCurrentPage = _useState14[1];
1842
+ var currentPageRef = React.useRef(currentPage);
1843
+
1844
+ var getEvents = function getEvents(params) {
1845
+ var url = params.url;
1700
1846
 
1701
- var getEvents = function getEvents() {
1702
- var itemsPerPage = 10;
1703
- var url = corsProxy + 'https://api-platform.cvent.com/event/v1/events/filter?limit=' + itemsPerPage;
1704
1847
  fetch(url, {
1705
1848
  headers: {
1706
1849
  Accept: 'application/json',
1707
1850
  'x-api-key': clientId,
1708
1851
  Authorization: 'Bearer ' + accessToken
1709
1852
  },
1710
- body: _JSON$stringify({ filter: filter }),
1853
+ body: AdSlot._JSON$stringify({ filter: filter }),
1711
1854
  method: 'POST'
1712
1855
  }).then(function (response) {
1713
1856
  return response.json();
1714
1857
  }).then(function (events) {
1715
1858
  setIsLoading(false);
1716
- var newData = events.data.map(function (item) {
1717
- return _extends$2._extends({}, item, {
1718
- pageNumber: page
1859
+ if (events.data && events.data.length > 0) {
1860
+ var newData = events.data.map(function (item) {
1861
+ return _extends$2._extends({}, item, {
1862
+ pageNumber: currentPage
1863
+ });
1719
1864
  });
1720
- });
1721
- console.log(events.paging);
1722
- if (newData.length > 0) {
1723
1865
  setData(function (prevData) {
1724
1866
  return [].concat(toConsumableArray._toConsumableArray(prevData), toConsumableArray._toConsumableArray(newData));
1725
1867
  });
1726
- setNextPagingToken(events.paging.nextToken ? events.paging.nextToken : null);
1727
- setScrolling(true);
1868
+ setNextPageLink(events.paging._links.next ? events.paging._links.next.href : null);
1869
+ newData.length === itemsPerPage ? setScrolling(true) : setScrolling(false);
1728
1870
  } else {
1729
1871
  setScrolling(false);
1730
1872
  }
@@ -1733,83 +1875,59 @@ var EventsDeck = function EventsDeck(_ref) {
1733
1875
 
1734
1876
  React.useEffect(function () {
1735
1877
  // load initial data
1736
- if (accessToken && page === 1 && currentPage === 1) {
1737
- getEvents();
1878
+ if (accessToken && currentPage === 1) {
1879
+ var initailUrl = 'https://api-platform.cvent.com/event/v1/events/filter?limit=' + itemsPerPage;
1880
+ getEvents({ url: initailUrl });
1881
+ }
1882
+ }, [accessToken, currentPage, filter]);
1883
+
1884
+ React.useEffect(function () {
1885
+ // load more events
1886
+ if (accessToken && nextPageLink && currentPage !== 1 && currentPage !== currentPageRef.current) {
1887
+ getEvents({ url: nextPageLink });
1738
1888
  }
1739
- }, [accessToken, filter, page, currentPage]);
1889
+ }, [currentPage]);
1740
1890
 
1741
1891
  React.useEffect(function () {
1742
1892
  // reset state when filter changes
1743
1893
  setIsLoading(true);
1744
1894
  setData([]);
1745
- setPage(1);
1746
1895
  setCurrentPage(1);
1896
+ currentPageRef.current = 1;
1747
1897
  }, [filter]);
1748
1898
 
1749
1899
  React.useEffect(function () {
1750
1900
  // get access token
1751
- var encodedData = window.btoa(clientId + ':' + clientSecret);
1752
- var url = corsProxy + 'https://api-platform.cvent.com/ea/oauth2/token';
1753
- fetch(url, {
1754
- headers: {
1755
- 'Content-Type': 'application/x-www-form-urlencoded',
1756
- Authorization: 'Basic ' + encodedData
1757
- },
1758
- method: 'POST',
1759
- body: 'grant_type=client_credentials&client_id=' + clientId
1760
- }).then(function (response) {
1761
- return response.json();
1762
- }).then(function (json) {
1763
- return setAccessToken(json.access_token);
1764
- }).catch(function (e) {
1765
- return console.log(e);
1766
- });
1767
- }, []);
1768
-
1769
- var loadMore = debounce.debounce_1(function () {
1770
- setPage(function (prevPage) {
1771
- return prevPage + 1;
1772
- });
1773
- }, 0);
1774
-
1775
- React.useEffect(function () {
1776
- // load more events
1777
- page !== 1 && page !== currentPage && loadMoreEvents();
1778
- }, [page]);
1779
-
1780
- var loadMoreEvents = function loadMoreEvents() {
1781
- console.log(nextPagingToken, 'nextPagingToken');
1782
- if (nextPagingToken) {
1783
- var url = corsProxy + 'https://api-platform.cvent.com/event/v1/events/filter?token=' + nextPagingToken;
1901
+ var cventAccessToken = js_cookie.get('cvent_access_token');
1902
+ if (cventAccessToken) {
1903
+ setAccessToken(cventAccessToken);
1904
+ } else {
1905
+ var encodedData = window.btoa(clientId + ':' + clientSecret);
1906
+ var url = corsProxy + 'https://api-platform.cvent.com/ea/oauth2/token';
1784
1907
  fetch(url, {
1785
1908
  headers: {
1786
- Accept: 'application/json',
1787
- 'x-api-key': clientId,
1788
- Authorization: 'Bearer ' + accessToken
1909
+ 'Content-Type': 'application/x-www-form-urlencoded',
1910
+ Authorization: 'Basic ' + encodedData
1789
1911
  },
1790
- body: _JSON$stringify({ filter: filter }),
1791
- method: 'POST'
1912
+ method: 'POST',
1913
+ body: 'grant_type=client_credentials&client_id=' + clientId
1792
1914
  }).then(function (response) {
1793
1915
  return response.json();
1794
- }).then(function (events) {
1795
- var newData = events.data.map(function (item) {
1796
- return _extends$2._extends({}, item, {
1797
- pageNumber: page
1798
- });
1799
- });
1800
- console.log(events.paging);
1801
- if (newData.length > 0) {
1802
- setData(function (prevData) {
1803
- return [].concat(toConsumableArray._toConsumableArray(prevData), toConsumableArray._toConsumableArray(newData));
1804
- });
1805
- setNextPagingToken(events.paging.nextToken ? events.paging.nextToken : null);
1806
- setScrolling(true);
1807
- } else {
1808
- setScrolling(false);
1809
- }
1916
+ }).then(function (json) {
1917
+ var inOneHour = new Date(new Date().getTime() + 60 * 60 * 1000);
1918
+ js_cookie.set('cvent_access_token', json.access_token, { expires: inOneHour });
1919
+ setAccessToken(json.access_token);
1920
+ }).catch(function (e) {
1921
+ return console.log(e);
1810
1922
  });
1811
1923
  }
1812
- };
1924
+ }, []);
1925
+
1926
+ var loadMore = debounce.debounce_1(function () {
1927
+ setCurrentPage(function (prevCurrentPage) {
1928
+ return prevCurrentPage + 1;
1929
+ });
1930
+ }, 0);
1813
1931
 
1814
1932
  var changePageNumber = function changePageNumber(pageNumber) {
1815
1933
  if (seoPaginate) {
@@ -1817,7 +1935,6 @@ var EventsDeck = function EventsDeck(_ref) {
1817
1935
  var qrIndex = path.indexOf('?');
1818
1936
  var pathname = router.pathname;
1819
1937
  var queryString = '';
1820
-
1821
1938
  if (qrIndex > 0) {
1822
1939
  path = path.substring(1, qrIndex);
1823
1940
 
@@ -1842,10 +1959,10 @@ var EventsDeck = function EventsDeck(_ref) {
1842
1959
 
1843
1960
  pageNumber = parseInt(pageNumber);
1844
1961
 
1845
- if (currentPage !== pageNumber) {
1962
+ if (pageNumber !== currentPageRef.current) {
1846
1963
  index.lib_3.refresh();
1847
1964
 
1848
- setCurrentPage(pageNumber);
1965
+ currentPageRef.current = pageNumber;
1849
1966
  if (path[0] !== '/') {
1850
1967
  path = '/' + path;
1851
1968
  }
@@ -2019,891 +2136,84 @@ var EventsDeck = function EventsDeck(_ref) {
2019
2136
  );
2020
2137
  }
2021
2138
 
2022
- if (data.length > 0) {
2023
- return React__default.createElement(
2024
- 'div',
2025
- { className: 'contentDeck' },
2026
- autoScroll ? React__default.createElement(
2027
- React__default.Fragment,
2028
- null,
2029
- React__default.createElement(
2030
- visibilitySensor.InfiniteScroll,
2031
- { dataLength: data.length, next: loadMore, hasMore: scrolling, scrollThreshold: 0.9 },
2032
- React__default.createElement(
2033
- Container,
2034
- null,
2035
- cardLoader()
2036
- )
2037
- ),
2038
- React__default.createElement(
2039
- 'noscript',
2040
- null,
2041
- renderManualPagination()
2042
- )
2043
- ) : React__default.createElement(
2044
- React__default.Fragment,
2045
- null,
2046
- React__default.createElement(
2047
- Container,
2048
- null,
2049
- cardLoader()
2050
- ),
2051
- React__default.createElement(
2052
- 'div',
2053
- { style: { padding: '0px 10px' } },
2054
- scrolling ? React__default.createElement(
2055
- 'button',
2056
- {
2057
- style: { margin: 'auto', width: '100%' },
2058
- onClick: function onClick(e) {
2059
- loadMore();
2060
- } },
2061
- 'Load More'
2062
- ) : React__default.createElement(
2063
- 'p',
2064
- { style: { textAlign: 'center' } },
2065
- React__default.createElement(
2066
- 'b',
2067
- null,
2068
- 'End of data'
2069
- )
2070
- )
2071
- ),
2072
- React__default.createElement(
2073
- 'noscript',
2074
- null,
2075
- renderManualPagination()
2076
- )
2077
- )
2078
- );
2079
- } else {
2080
- return React__default.createElement(
2081
- 'div',
2082
- null,
2083
- React__default.createElement(
2084
- 'div',
2085
- null,
2086
- 'No events found '
2087
- )
2088
- );
2089
- }
2090
- };
2091
-
2092
- var runtime = _commonjsHelpers.createCommonjsModule(function (module) {
2093
- /**
2094
- * Copyright (c) 2014-present, Facebook, Inc.
2095
- *
2096
- * This source code is licensed under the MIT license found in the
2097
- * LICENSE file in the root directory of this source tree.
2098
- */
2099
-
2100
- !(function(global) {
2101
-
2102
- var Op = Object.prototype;
2103
- var hasOwn = Op.hasOwnProperty;
2104
- var undefined$1; // More compressible than void 0.
2105
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
2106
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
2107
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
2108
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
2109
- var runtime = global.regeneratorRuntime;
2110
- if (runtime) {
2111
- {
2112
- // If regeneratorRuntime is defined globally and we're in a module,
2113
- // make the exports object identical to regeneratorRuntime.
2114
- module.exports = runtime;
2115
- }
2116
- // Don't bother evaluating the rest of this file if the runtime was
2117
- // already defined globally.
2118
- return;
2119
- }
2120
-
2121
- // Define the runtime globally (as expected by generated code) as either
2122
- // module.exports (if we're in a module) or a new, empty object.
2123
- runtime = global.regeneratorRuntime = module.exports ;
2124
-
2125
- function wrap(innerFn, outerFn, self, tryLocsList) {
2126
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
2127
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
2128
- var generator = Object.create(protoGenerator.prototype);
2129
- var context = new Context(tryLocsList || []);
2130
-
2131
- // The ._invoke method unifies the implementations of the .next,
2132
- // .throw, and .return methods.
2133
- generator._invoke = makeInvokeMethod(innerFn, self, context);
2134
-
2135
- return generator;
2136
- }
2137
- runtime.wrap = wrap;
2138
-
2139
- // Try/catch helper to minimize deoptimizations. Returns a completion
2140
- // record like context.tryEntries[i].completion. This interface could
2141
- // have been (and was previously) designed to take a closure to be
2142
- // invoked without arguments, but in all the cases we care about we
2143
- // already have an existing method we want to call, so there's no need
2144
- // to create a new function object. We can even get away with assuming
2145
- // the method takes exactly one argument, since that happens to be true
2146
- // in every case, so we don't have to touch the arguments object. The
2147
- // only additional allocation required is the completion record, which
2148
- // has a stable shape and so hopefully should be cheap to allocate.
2149
- function tryCatch(fn, obj, arg) {
2150
- try {
2151
- return { type: "normal", arg: fn.call(obj, arg) };
2152
- } catch (err) {
2153
- return { type: "throw", arg: err };
2154
- }
2155
- }
2156
-
2157
- var GenStateSuspendedStart = "suspendedStart";
2158
- var GenStateSuspendedYield = "suspendedYield";
2159
- var GenStateExecuting = "executing";
2160
- var GenStateCompleted = "completed";
2161
-
2162
- // Returning this object from the innerFn has the same effect as
2163
- // breaking out of the dispatch switch statement.
2164
- var ContinueSentinel = {};
2165
-
2166
- // Dummy constructor functions that we use as the .constructor and
2167
- // .constructor.prototype properties for functions that return Generator
2168
- // objects. For full spec compliance, you may wish to configure your
2169
- // minifier not to mangle the names of these two functions.
2170
- function Generator() {}
2171
- function GeneratorFunction() {}
2172
- function GeneratorFunctionPrototype() {}
2173
-
2174
- // This is a polyfill for %IteratorPrototype% for environments that
2175
- // don't natively support it.
2176
- var IteratorPrototype = {};
2177
- IteratorPrototype[iteratorSymbol] = function () {
2178
- return this;
2179
- };
2180
-
2181
- var getProto = Object.getPrototypeOf;
2182
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
2183
- if (NativeIteratorPrototype &&
2184
- NativeIteratorPrototype !== Op &&
2185
- hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
2186
- // This environment has a native %IteratorPrototype%; use it instead
2187
- // of the polyfill.
2188
- IteratorPrototype = NativeIteratorPrototype;
2189
- }
2190
-
2191
- var Gp = GeneratorFunctionPrototype.prototype =
2192
- Generator.prototype = Object.create(IteratorPrototype);
2193
- GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
2194
- GeneratorFunctionPrototype.constructor = GeneratorFunction;
2195
- GeneratorFunctionPrototype[toStringTagSymbol] =
2196
- GeneratorFunction.displayName = "GeneratorFunction";
2197
-
2198
- // Helper for defining the .next, .throw, and .return methods of the
2199
- // Iterator interface in terms of a single ._invoke method.
2200
- function defineIteratorMethods(prototype) {
2201
- ["next", "throw", "return"].forEach(function(method) {
2202
- prototype[method] = function(arg) {
2203
- return this._invoke(method, arg);
2204
- };
2205
- });
2206
- }
2207
-
2208
- runtime.isGeneratorFunction = function(genFun) {
2209
- var ctor = typeof genFun === "function" && genFun.constructor;
2210
- return ctor
2211
- ? ctor === GeneratorFunction ||
2212
- // For the native GeneratorFunction constructor, the best we can
2213
- // do is to check its .name property.
2214
- (ctor.displayName || ctor.name) === "GeneratorFunction"
2215
- : false;
2216
- };
2217
-
2218
- runtime.mark = function(genFun) {
2219
- if (Object.setPrototypeOf) {
2220
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
2221
- } else {
2222
- genFun.__proto__ = GeneratorFunctionPrototype;
2223
- if (!(toStringTagSymbol in genFun)) {
2224
- genFun[toStringTagSymbol] = "GeneratorFunction";
2225
- }
2226
- }
2227
- genFun.prototype = Object.create(Gp);
2228
- return genFun;
2229
- };
2230
-
2231
- // Within the body of any async function, `await x` is transformed to
2232
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
2233
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
2234
- // meant to be awaited.
2235
- runtime.awrap = function(arg) {
2236
- return { __await: arg };
2237
- };
2238
-
2239
- function AsyncIterator(generator) {
2240
- function invoke(method, arg, resolve, reject) {
2241
- var record = tryCatch(generator[method], generator, arg);
2242
- if (record.type === "throw") {
2243
- reject(record.arg);
2244
- } else {
2245
- var result = record.arg;
2246
- var value = result.value;
2247
- if (value &&
2248
- typeof value === "object" &&
2249
- hasOwn.call(value, "__await")) {
2250
- return Promise.resolve(value.__await).then(function(value) {
2251
- invoke("next", value, resolve, reject);
2252
- }, function(err) {
2253
- invoke("throw", err, resolve, reject);
2254
- });
2255
- }
2256
-
2257
- return Promise.resolve(value).then(function(unwrapped) {
2258
- // When a yielded Promise is resolved, its final value becomes
2259
- // the .value of the Promise<{value,done}> result for the
2260
- // current iteration. If the Promise is rejected, however, the
2261
- // result for this iteration will be rejected with the same
2262
- // reason. Note that rejections of yielded Promises are not
2263
- // thrown back into the generator function, as is the case
2264
- // when an awaited Promise is rejected. This difference in
2265
- // behavior between yield and await is important, because it
2266
- // allows the consumer to decide what to do with the yielded
2267
- // rejection (swallow it and continue, manually .throw it back
2268
- // into the generator, abandon iteration, whatever). With
2269
- // await, by contrast, there is no opportunity to examine the
2270
- // rejection reason outside the generator function, so the
2271
- // only option is to throw it from the await expression, and
2272
- // let the generator function handle the exception.
2273
- result.value = unwrapped;
2274
- resolve(result);
2275
- }, reject);
2276
- }
2277
- }
2278
-
2279
- var previousPromise;
2280
-
2281
- function enqueue(method, arg) {
2282
- function callInvokeWithMethodAndArg() {
2283
- return new Promise(function(resolve, reject) {
2284
- invoke(method, arg, resolve, reject);
2285
- });
2286
- }
2287
-
2288
- return previousPromise =
2289
- // If enqueue has been called before, then we want to wait until
2290
- // all previous Promises have been resolved before calling invoke,
2291
- // so that results are always delivered in the correct order. If
2292
- // enqueue has not been called before, then it is important to
2293
- // call invoke immediately, without waiting on a callback to fire,
2294
- // so that the async generator function has the opportunity to do
2295
- // any necessary setup in a predictable way. This predictability
2296
- // is why the Promise constructor synchronously invokes its
2297
- // executor callback, and why async functions synchronously
2298
- // execute code before the first await. Since we implement simple
2299
- // async functions in terms of async generators, it is especially
2300
- // important to get this right, even though it requires care.
2301
- previousPromise ? previousPromise.then(
2302
- callInvokeWithMethodAndArg,
2303
- // Avoid propagating failures to Promises returned by later
2304
- // invocations of the iterator.
2305
- callInvokeWithMethodAndArg
2306
- ) : callInvokeWithMethodAndArg();
2307
- }
2308
-
2309
- // Define the unified helper method that is used to implement .next,
2310
- // .throw, and .return (see defineIteratorMethods).
2311
- this._invoke = enqueue;
2312
- }
2313
-
2314
- defineIteratorMethods(AsyncIterator.prototype);
2315
- AsyncIterator.prototype[asyncIteratorSymbol] = function () {
2316
- return this;
2317
- };
2318
- runtime.AsyncIterator = AsyncIterator;
2319
-
2320
- // Note that simple async functions are implemented on top of
2321
- // AsyncIterator objects; they just return a Promise for the value of
2322
- // the final result produced by the iterator.
2323
- runtime.async = function(innerFn, outerFn, self, tryLocsList) {
2324
- var iter = new AsyncIterator(
2325
- wrap(innerFn, outerFn, self, tryLocsList)
2326
- );
2327
-
2328
- return runtime.isGeneratorFunction(outerFn)
2329
- ? iter // If outerFn is a generator, return the full iterator.
2330
- : iter.next().then(function(result) {
2331
- return result.done ? result.value : iter.next();
2332
- });
2333
- };
2334
-
2335
- function makeInvokeMethod(innerFn, self, context) {
2336
- var state = GenStateSuspendedStart;
2337
-
2338
- return function invoke(method, arg) {
2339
- if (state === GenStateExecuting) {
2340
- throw new Error("Generator is already running");
2341
- }
2342
-
2343
- if (state === GenStateCompleted) {
2344
- if (method === "throw") {
2345
- throw arg;
2346
- }
2347
-
2348
- // Be forgiving, per 25.3.3.3.3 of the spec:
2349
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
2350
- return doneResult();
2351
- }
2352
-
2353
- context.method = method;
2354
- context.arg = arg;
2355
-
2356
- while (true) {
2357
- var delegate = context.delegate;
2358
- if (delegate) {
2359
- var delegateResult = maybeInvokeDelegate(delegate, context);
2360
- if (delegateResult) {
2361
- if (delegateResult === ContinueSentinel) continue;
2362
- return delegateResult;
2363
- }
2364
- }
2365
-
2366
- if (context.method === "next") {
2367
- // Setting context._sent for legacy support of Babel's
2368
- // function.sent implementation.
2369
- context.sent = context._sent = context.arg;
2370
-
2371
- } else if (context.method === "throw") {
2372
- if (state === GenStateSuspendedStart) {
2373
- state = GenStateCompleted;
2374
- throw context.arg;
2375
- }
2376
-
2377
- context.dispatchException(context.arg);
2378
-
2379
- } else if (context.method === "return") {
2380
- context.abrupt("return", context.arg);
2381
- }
2382
-
2383
- state = GenStateExecuting;
2384
-
2385
- var record = tryCatch(innerFn, self, context);
2386
- if (record.type === "normal") {
2387
- // If an exception is thrown from innerFn, we leave state ===
2388
- // GenStateExecuting and loop back for another invocation.
2389
- state = context.done
2390
- ? GenStateCompleted
2391
- : GenStateSuspendedYield;
2392
-
2393
- if (record.arg === ContinueSentinel) {
2394
- continue;
2395
- }
2396
-
2397
- return {
2398
- value: record.arg,
2399
- done: context.done
2400
- };
2401
-
2402
- } else if (record.type === "throw") {
2403
- state = GenStateCompleted;
2404
- // Dispatch the exception by looping back around to the
2405
- // context.dispatchException(context.arg) call above.
2406
- context.method = "throw";
2407
- context.arg = record.arg;
2408
- }
2409
- }
2410
- };
2411
- }
2412
-
2413
- // Call delegate.iterator[context.method](context.arg) and handle the
2414
- // result, either by returning a { value, done } result from the
2415
- // delegate iterator, or by modifying context.method and context.arg,
2416
- // setting context.delegate to null, and returning the ContinueSentinel.
2417
- function maybeInvokeDelegate(delegate, context) {
2418
- var method = delegate.iterator[context.method];
2419
- if (method === undefined$1) {
2420
- // A .throw or .return when the delegate iterator has no .throw
2421
- // method always terminates the yield* loop.
2422
- context.delegate = null;
2423
-
2424
- if (context.method === "throw") {
2425
- if (delegate.iterator.return) {
2426
- // If the delegate iterator has a return method, give it a
2427
- // chance to clean up.
2428
- context.method = "return";
2429
- context.arg = undefined$1;
2430
- maybeInvokeDelegate(delegate, context);
2431
-
2432
- if (context.method === "throw") {
2433
- // If maybeInvokeDelegate(context) changed context.method from
2434
- // "return" to "throw", let that override the TypeError below.
2435
- return ContinueSentinel;
2436
- }
2437
- }
2438
-
2439
- context.method = "throw";
2440
- context.arg = new TypeError(
2441
- "The iterator does not provide a 'throw' method");
2442
- }
2443
-
2444
- return ContinueSentinel;
2445
- }
2446
-
2447
- var record = tryCatch(method, delegate.iterator, context.arg);
2448
-
2449
- if (record.type === "throw") {
2450
- context.method = "throw";
2451
- context.arg = record.arg;
2452
- context.delegate = null;
2453
- return ContinueSentinel;
2454
- }
2455
-
2456
- var info = record.arg;
2457
-
2458
- if (! info) {
2459
- context.method = "throw";
2460
- context.arg = new TypeError("iterator result is not an object");
2461
- context.delegate = null;
2462
- return ContinueSentinel;
2463
- }
2464
-
2465
- if (info.done) {
2466
- // Assign the result of the finished delegate to the temporary
2467
- // variable specified by delegate.resultName (see delegateYield).
2468
- context[delegate.resultName] = info.value;
2469
-
2470
- // Resume execution at the desired location (see delegateYield).
2471
- context.next = delegate.nextLoc;
2472
-
2473
- // If context.method was "throw" but the delegate handled the
2474
- // exception, let the outer generator proceed normally. If
2475
- // context.method was "next", forget context.arg since it has been
2476
- // "consumed" by the delegate iterator. If context.method was
2477
- // "return", allow the original .return call to continue in the
2478
- // outer generator.
2479
- if (context.method !== "return") {
2480
- context.method = "next";
2481
- context.arg = undefined$1;
2482
- }
2483
-
2484
- } else {
2485
- // Re-yield the result returned by the delegate method.
2486
- return info;
2487
- }
2488
-
2489
- // The delegate iterator is finished, so forget it and continue with
2490
- // the outer generator.
2491
- context.delegate = null;
2492
- return ContinueSentinel;
2493
- }
2494
-
2495
- // Define Generator.prototype.{next,throw,return} in terms of the
2496
- // unified ._invoke helper method.
2497
- defineIteratorMethods(Gp);
2498
-
2499
- Gp[toStringTagSymbol] = "Generator";
2500
-
2501
- // A Generator should always return itself as the iterator object when the
2502
- // @@iterator function is called on it. Some browsers' implementations of the
2503
- // iterator prototype chain incorrectly implement this, causing the Generator
2504
- // object to not be returned from this call. This ensures that doesn't happen.
2505
- // See https://github.com/facebook/regenerator/issues/274 for more details.
2506
- Gp[iteratorSymbol] = function() {
2507
- return this;
2508
- };
2509
-
2510
- Gp.toString = function() {
2511
- return "[object Generator]";
2512
- };
2513
-
2514
- function pushTryEntry(locs) {
2515
- var entry = { tryLoc: locs[0] };
2516
-
2517
- if (1 in locs) {
2518
- entry.catchLoc = locs[1];
2519
- }
2520
-
2521
- if (2 in locs) {
2522
- entry.finallyLoc = locs[2];
2523
- entry.afterLoc = locs[3];
2524
- }
2525
-
2526
- this.tryEntries.push(entry);
2527
- }
2528
-
2529
- function resetTryEntry(entry) {
2530
- var record = entry.completion || {};
2531
- record.type = "normal";
2532
- delete record.arg;
2533
- entry.completion = record;
2534
- }
2535
-
2536
- function Context(tryLocsList) {
2537
- // The root entry object (effectively a try statement without a catch
2538
- // or a finally block) gives us a place to store values thrown from
2539
- // locations where there is no enclosing try statement.
2540
- this.tryEntries = [{ tryLoc: "root" }];
2541
- tryLocsList.forEach(pushTryEntry, this);
2542
- this.reset(true);
2543
- }
2544
-
2545
- runtime.keys = function(object) {
2546
- var keys = [];
2547
- for (var key in object) {
2548
- keys.push(key);
2549
- }
2550
- keys.reverse();
2551
-
2552
- // Rather than returning an object with a next method, we keep
2553
- // things simple and return the next function itself.
2554
- return function next() {
2555
- while (keys.length) {
2556
- var key = keys.pop();
2557
- if (key in object) {
2558
- next.value = key;
2559
- next.done = false;
2560
- return next;
2561
- }
2562
- }
2563
-
2564
- // To avoid creating an additional object, we just hang the .value
2565
- // and .done properties off the next function object itself. This
2566
- // also ensures that the minifier will not anonymize the function.
2567
- next.done = true;
2568
- return next;
2569
- };
2570
- };
2571
-
2572
- function values(iterable) {
2573
- if (iterable) {
2574
- var iteratorMethod = iterable[iteratorSymbol];
2575
- if (iteratorMethod) {
2576
- return iteratorMethod.call(iterable);
2577
- }
2578
-
2579
- if (typeof iterable.next === "function") {
2580
- return iterable;
2581
- }
2582
-
2583
- if (!isNaN(iterable.length)) {
2584
- var i = -1, next = function next() {
2585
- while (++i < iterable.length) {
2586
- if (hasOwn.call(iterable, i)) {
2587
- next.value = iterable[i];
2588
- next.done = false;
2589
- return next;
2590
- }
2591
- }
2592
-
2593
- next.value = undefined$1;
2594
- next.done = true;
2595
-
2596
- return next;
2597
- };
2598
-
2599
- return next.next = next;
2600
- }
2601
- }
2602
-
2603
- // Return an iterator with no values.
2604
- return { next: doneResult };
2605
- }
2606
- runtime.values = values;
2607
-
2608
- function doneResult() {
2609
- return { value: undefined$1, done: true };
2610
- }
2611
-
2612
- Context.prototype = {
2613
- constructor: Context,
2614
-
2615
- reset: function(skipTempReset) {
2616
- this.prev = 0;
2617
- this.next = 0;
2618
- // Resetting context._sent for legacy support of Babel's
2619
- // function.sent implementation.
2620
- this.sent = this._sent = undefined$1;
2621
- this.done = false;
2622
- this.delegate = null;
2623
-
2624
- this.method = "next";
2625
- this.arg = undefined$1;
2626
-
2627
- this.tryEntries.forEach(resetTryEntry);
2628
-
2629
- if (!skipTempReset) {
2630
- for (var name in this) {
2631
- // Not sure about the optimal order of these conditions:
2632
- if (name.charAt(0) === "t" &&
2633
- hasOwn.call(this, name) &&
2634
- !isNaN(+name.slice(1))) {
2635
- this[name] = undefined$1;
2636
- }
2637
- }
2638
- }
2639
- },
2640
-
2641
- stop: function() {
2642
- this.done = true;
2643
-
2644
- var rootEntry = this.tryEntries[0];
2645
- var rootRecord = rootEntry.completion;
2646
- if (rootRecord.type === "throw") {
2647
- throw rootRecord.arg;
2648
- }
2649
-
2650
- return this.rval;
2651
- },
2652
-
2653
- dispatchException: function(exception) {
2654
- if (this.done) {
2655
- throw exception;
2656
- }
2657
-
2658
- var context = this;
2659
- function handle(loc, caught) {
2660
- record.type = "throw";
2661
- record.arg = exception;
2662
- context.next = loc;
2663
-
2664
- if (caught) {
2665
- // If the dispatched exception was caught by a catch block,
2666
- // then let that catch block handle the exception normally.
2667
- context.method = "next";
2668
- context.arg = undefined$1;
2669
- }
2670
-
2671
- return !! caught;
2672
- }
2673
-
2674
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2675
- var entry = this.tryEntries[i];
2676
- var record = entry.completion;
2677
-
2678
- if (entry.tryLoc === "root") {
2679
- // Exception thrown outside of any try block that could handle
2680
- // it, so set the completion value of the entire function to
2681
- // throw the exception.
2682
- return handle("end");
2683
- }
2684
-
2685
- if (entry.tryLoc <= this.prev) {
2686
- var hasCatch = hasOwn.call(entry, "catchLoc");
2687
- var hasFinally = hasOwn.call(entry, "finallyLoc");
2688
-
2689
- if (hasCatch && hasFinally) {
2690
- if (this.prev < entry.catchLoc) {
2691
- return handle(entry.catchLoc, true);
2692
- } else if (this.prev < entry.finallyLoc) {
2693
- return handle(entry.finallyLoc);
2694
- }
2695
-
2696
- } else if (hasCatch) {
2697
- if (this.prev < entry.catchLoc) {
2698
- return handle(entry.catchLoc, true);
2699
- }
2700
-
2701
- } else if (hasFinally) {
2702
- if (this.prev < entry.finallyLoc) {
2703
- return handle(entry.finallyLoc);
2704
- }
2705
-
2706
- } else {
2707
- throw new Error("try statement without catch or finally");
2708
- }
2709
- }
2710
- }
2711
- },
2712
-
2713
- abrupt: function(type, arg) {
2714
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2715
- var entry = this.tryEntries[i];
2716
- if (entry.tryLoc <= this.prev &&
2717
- hasOwn.call(entry, "finallyLoc") &&
2718
- this.prev < entry.finallyLoc) {
2719
- var finallyEntry = entry;
2720
- break;
2721
- }
2722
- }
2723
-
2724
- if (finallyEntry &&
2725
- (type === "break" ||
2726
- type === "continue") &&
2727
- finallyEntry.tryLoc <= arg &&
2728
- arg <= finallyEntry.finallyLoc) {
2729
- // Ignore the finally entry if control is not jumping to a
2730
- // location outside the try/catch block.
2731
- finallyEntry = null;
2732
- }
2733
-
2734
- var record = finallyEntry ? finallyEntry.completion : {};
2735
- record.type = type;
2736
- record.arg = arg;
2737
-
2738
- if (finallyEntry) {
2739
- this.method = "next";
2740
- this.next = finallyEntry.finallyLoc;
2741
- return ContinueSentinel;
2742
- }
2743
-
2744
- return this.complete(record);
2745
- },
2746
-
2747
- complete: function(record, afterLoc) {
2748
- if (record.type === "throw") {
2749
- throw record.arg;
2750
- }
2751
-
2752
- if (record.type === "break" ||
2753
- record.type === "continue") {
2754
- this.next = record.arg;
2755
- } else if (record.type === "return") {
2756
- this.rval = this.arg = record.arg;
2757
- this.method = "return";
2758
- this.next = "end";
2759
- } else if (record.type === "normal" && afterLoc) {
2760
- this.next = afterLoc;
2761
- }
2762
-
2763
- return ContinueSentinel;
2764
- },
2765
-
2766
- finish: function(finallyLoc) {
2767
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2768
- var entry = this.tryEntries[i];
2769
- if (entry.finallyLoc === finallyLoc) {
2770
- this.complete(entry.completion, entry.afterLoc);
2771
- resetTryEntry(entry);
2772
- return ContinueSentinel;
2773
- }
2774
- }
2775
- },
2776
-
2777
- "catch": function(tryLoc) {
2778
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2779
- var entry = this.tryEntries[i];
2780
- if (entry.tryLoc === tryLoc) {
2781
- var record = entry.completion;
2782
- if (record.type === "throw") {
2783
- var thrown = record.arg;
2784
- resetTryEntry(entry);
2785
- }
2786
- return thrown;
2787
- }
2788
- }
2789
-
2790
- // The context.catch method must only be called with a location
2791
- // argument that corresponds to a known catch block.
2792
- throw new Error("illegal catch attempt");
2793
- },
2794
-
2795
- delegateYield: function(iterable, resultName, nextLoc) {
2796
- this.delegate = {
2797
- iterator: values(iterable),
2798
- resultName: resultName,
2799
- nextLoc: nextLoc
2800
- };
2801
-
2802
- if (this.method === "next") {
2803
- // Deliberately forget the last sent value so that we don't
2804
- // accidentally pass it on to the delegate.
2805
- this.arg = undefined$1;
2806
- }
2807
-
2808
- return ContinueSentinel;
2809
- }
2810
- };
2811
- })(
2812
- // In sloppy mode, unbound `this` refers to the global object, fallback to
2813
- // Function constructor if we're in global strict mode. That is sadly a form
2814
- // of indirect eval which violates Content Security Policy.
2815
- (function() { return this })() || Function("return this")()
2816
- );
2817
- });
2818
-
2819
- /**
2820
- * Copyright (c) 2014-present, Facebook, Inc.
2821
- *
2822
- * This source code is licensed under the MIT license found in the
2823
- * LICENSE file in the root directory of this source tree.
2824
- */
2825
-
2826
- // This method of obtaining a reference to the global object needs to be
2827
- // kept identical to the way it is obtained in runtime.js
2828
- var g = (function() { return this })() || Function("return this")();
2829
-
2830
- // Use `getOwnPropertyNames` because not all browsers support calling
2831
- // `hasOwnProperty` on the global `self` object in a worker. See #183.
2832
- var hadRuntime = g.regeneratorRuntime &&
2833
- Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
2834
-
2835
- // Save the old regeneratorRuntime in case it needs to be restored later.
2836
- var oldRuntime = hadRuntime && g.regeneratorRuntime;
2837
-
2838
- // Force reevalutation of runtime.js.
2839
- g.regeneratorRuntime = undefined;
2840
-
2841
- var runtimeModule = runtime;
2842
-
2843
- if (hadRuntime) {
2844
- // Restore the original runtime.
2845
- g.regeneratorRuntime = oldRuntime;
2846
- } else {
2847
- // Remove the global property added by runtime.js.
2848
- try {
2849
- delete g.regeneratorRuntime;
2850
- } catch(e) {
2851
- g.regeneratorRuntime = undefined;
2852
- }
2853
- }
2854
-
2855
- var regenerator = runtimeModule;
2856
-
2857
- var asyncToGenerator = _commonjsHelpers.createCommonjsModule(function (module, exports) {
2858
-
2859
- exports.__esModule = true;
2860
-
2861
-
2862
-
2863
- var _promise2 = _interopRequireDefault(MasterDeck.promise);
2864
-
2865
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2866
-
2867
- exports.default = function (fn) {
2868
- return function () {
2869
- var gen = fn.apply(this, arguments);
2870
- return new _promise2.default(function (resolve, reject) {
2871
- function step(key, arg) {
2872
- try {
2873
- var info = gen[key](arg);
2874
- var value = info.value;
2875
- } catch (error) {
2876
- reject(error);
2877
- return;
2878
- }
2879
-
2880
- if (info.done) {
2881
- resolve(value);
2882
- } else {
2883
- return _promise2.default.resolve(value).then(function (value) {
2884
- step("next", value);
2885
- }, function (err) {
2886
- step("throw", err);
2887
- });
2888
- }
2889
- }
2890
-
2891
- return step("next");
2892
- });
2893
- };
2139
+ if (data.length > 0) {
2140
+ return React__default.createElement(
2141
+ 'div',
2142
+ { className: 'contentDeck' },
2143
+ autoScroll ? React__default.createElement(
2144
+ React__default.Fragment,
2145
+ null,
2146
+ React__default.createElement(
2147
+ visibilitySensor.InfiniteScroll,
2148
+ { dataLength: data.length, next: loadMore, hasMore: scrolling, scrollThreshold: 0.9 },
2149
+ React__default.createElement(
2150
+ Container,
2151
+ null,
2152
+ cardLoader()
2153
+ )
2154
+ ),
2155
+ React__default.createElement(
2156
+ 'noscript',
2157
+ null,
2158
+ renderManualPagination()
2159
+ )
2160
+ ) : React__default.createElement(
2161
+ React__default.Fragment,
2162
+ null,
2163
+ React__default.createElement(
2164
+ Container,
2165
+ null,
2166
+ cardLoader()
2167
+ ),
2168
+ React__default.createElement(
2169
+ 'div',
2170
+ { style: { padding: '0px 10px' } },
2171
+ scrolling ? React__default.createElement(
2172
+ 'button',
2173
+ {
2174
+ style: { margin: 'auto', width: '100%' },
2175
+ onClick: function onClick(e) {
2176
+ loadMore();
2177
+ } },
2178
+ 'Load More'
2179
+ ) : React__default.createElement(
2180
+ 'p',
2181
+ { style: { textAlign: 'center' } },
2182
+ React__default.createElement(
2183
+ 'b',
2184
+ null,
2185
+ 'End of data'
2186
+ )
2187
+ )
2188
+ ),
2189
+ React__default.createElement(
2190
+ 'noscript',
2191
+ null,
2192
+ renderManualPagination()
2193
+ )
2194
+ )
2195
+ );
2196
+ } else {
2197
+ return React__default.createElement(
2198
+ 'div',
2199
+ null,
2200
+ React__default.createElement(
2201
+ 'div',
2202
+ null,
2203
+ 'No events found '
2204
+ )
2205
+ );
2206
+ }
2894
2207
  };
2895
- });
2896
-
2897
- var _asyncToGenerator = _commonjsHelpers.unwrapExports(asyncToGenerator);
2898
2208
 
2899
2209
  var corsProxy$1 = 'https://cors-anywhere.herokuapp.com/';
2900
- var itemsPerPage = 10;
2210
+ var itemsPerPage$1 = 10;
2901
2211
 
2902
2212
  var CMEDeck = function CMEDeck(_ref) {
2903
2213
  var getData = function () {
2904
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(params) {
2214
+ var _ref2 = AdSlot._asyncToGenerator( /*#__PURE__*/AdSlot.regenerator.mark(function _callee(params) {
2905
2215
  var form, response, result, regex, newData;
2906
- return regenerator.wrap(function _callee$(_context) {
2216
+ return AdSlot.regenerator.wrap(function _callee$(_context) {
2907
2217
  while (1) {
2908
2218
  switch (_context.prev = _context.next) {
2909
2219
  case 0:
@@ -2949,7 +2259,7 @@ var CMEDeck = function CMEDeck(_ref) {
2949
2259
  });
2950
2260
 
2951
2261
  setIsLoading(false);
2952
- newData.length === itemsPerPage ? setScrolling(true) : setScrolling(false);
2262
+ newData.length === itemsPerPage$1 ? setScrolling(true) : setScrolling(false);
2953
2263
  setData(function (prevData) {
2954
2264
  return [].concat(toConsumableArray._toConsumableArray(prevData), toConsumableArray._toConsumableArray(newData));
2955
2265
  });
@@ -3009,7 +2319,7 @@ var CMEDeck = function CMEDeck(_ref) {
3009
2319
  data = _useState8[0],
3010
2320
  setData = _useState8[1];
3011
2321
 
3012
- var _useState9 = React.useState(router && router.query && router.query.page ? (parseInt(router.query.page) - 1) * itemsPerPage : 0),
2322
+ var _useState9 = React.useState(router && router.query && router.query.page ? (parseInt(router.query.page) - 1) * itemsPerPage$1 : 0),
3013
2323
  _useState10 = slicedToArray._slicedToArray(_useState9, 2),
3014
2324
  from = _useState10[0],
3015
2325
  setFrom = _useState10[1];
@@ -3019,7 +2329,7 @@ var CMEDeck = function CMEDeck(_ref) {
3019
2329
 
3020
2330
  React.useEffect(function () {
3021
2331
  // load initial data
3022
- getData({ from: from, limit: itemsPerPage });
2332
+ getData({ from: from, limit: itemsPerPage$1 });
3023
2333
  }, []);
3024
2334
 
3025
2335
  var changePageNumber = function changePageNumber(pageNumber) {
@@ -3074,7 +2384,7 @@ var CMEDeck = function CMEDeck(_ref) {
3074
2384
 
3075
2385
  var loadMore = debounce.debounce_1(function () {
3076
2386
  setFrom(function (prevFrom) {
3077
- return prevFrom + itemsPerPage;
2387
+ return prevFrom + itemsPerPage$1;
3078
2388
  });
3079
2389
  setCurrentPage(function (prevCurrentPage) {
3080
2390
  return prevCurrentPage + 1;
@@ -3084,7 +2394,7 @@ var CMEDeck = function CMEDeck(_ref) {
3084
2394
  React.useEffect(function () {
3085
2395
  if (currentPageRef.current !== currentPage && fromeRef.current !== from) {
3086
2396
  fromeRef.current = from;
3087
- getData({ from: from, limit: itemsPerPage });
2397
+ getData({ from: from, limit: itemsPerPage$1 });
3088
2398
  }
3089
2399
  }, [currentPage]);
3090
2400
 
@@ -6133,6 +5443,28 @@ var YouTubePlayer = function YouTubePlayer(_ref) {
6133
5443
 
6134
5444
  var id = YoutubeGroup.getYoutubeId(url);
6135
5445
 
5446
+ var _useState = React.useState(false),
5447
+ _useState2 = slicedToArray._slicedToArray(_useState, 2),
5448
+ playReported = _useState2[0],
5449
+ setPlayReported = _useState2[1];
5450
+
5451
+ var _useState3 = React.useState(false),
5452
+ _useState4 = slicedToArray._slicedToArray(_useState3, 2),
5453
+ endReported = _useState4[0],
5454
+ setEndReported = _useState4[1];
5455
+
5456
+ var _useState5 = React.useState(null),
5457
+ _useState6 = slicedToArray._slicedToArray(_useState5, 2),
5458
+ intervalID = _useState6[0],
5459
+ setIntervalID = _useState6[1];
5460
+
5461
+ var _useState7 = React.useState(null),
5462
+ _useState8 = slicedToArray._slicedToArray(_useState7, 2),
5463
+ segmentData = _useState8[0],
5464
+ setSegemntData = _useState8[1];
5465
+
5466
+ var queueProgress = [];
5467
+
6136
5468
  var opts = {
6137
5469
  width: '100%',
6138
5470
  playerVars: {
@@ -6140,7 +5472,77 @@ var YouTubePlayer = function YouTubePlayer(_ref) {
6140
5472
  }
6141
5473
  };
6142
5474
 
6143
- return React__default.createElement(YouTube, { videoId: id, opts: opts });
5475
+ React.useEffect(function () {
5476
+ if (segmentData) {
5477
+ console.log('Video Segment', segmentData);
5478
+ AdSlot.Beam.report_beam_video('Segment', main.main_16, segmentData.duration, segmentData.current, segmentData.segment);
5479
+ }
5480
+ }, [segmentData]);
5481
+
5482
+ var handlePlayPercent = function handlePlayPercent(player) {
5483
+ var current = player.getCurrentTime();
5484
+ var duration = player.getDuration();
5485
+ var queue = Math.floor(duration / 10);
5486
+ var segment = Math.floor(current / queue);
5487
+
5488
+ if (!queueProgress.includes(segment)) {
5489
+ setSegemntData({
5490
+ current: current,
5491
+ duration: duration,
5492
+ queue: queue,
5493
+ segment: segment
5494
+ });
5495
+ queueProgress.push(segment);
5496
+ }
5497
+ };
5498
+
5499
+ var handleOnPlay = function handleOnPlay(event) {
5500
+ // report play
5501
+ if (!playReported) {
5502
+ console.log('Video Play', event);
5503
+
5504
+ var player = event.target;
5505
+ var current = player.getCurrentTime();
5506
+ var duration = player.getDuration();
5507
+ var queue = Math.floor(duration / 10);
5508
+ var segment = Math.floor(current / queue);
5509
+
5510
+ AdSlot.Beam.report_beam_video('Play', main.main_16, duration, current, segment);
5511
+ setPlayReported(true);
5512
+ var _intervalID = setInterval(function () {
5513
+ handlePlayPercent(event.target);
5514
+ }, 1000);
5515
+ setIntervalID(_intervalID);
5516
+ }
5517
+ };
5518
+
5519
+ var handleOnEnd = function handleOnEnd(event) {
5520
+ if (!endReported) {
5521
+ console.log('Video End', event);
5522
+ var player = event.target;
5523
+ var current = player.getCurrentTime();
5524
+ var duration = player.getDuration();
5525
+ var queue = Math.floor(duration / 10);
5526
+ var segment = Math.floor(current / queue);
5527
+
5528
+ AdSlot.Beam.report_beam_video('End', main.main_16, duration, current, segment);
5529
+ setEndReported(true);
5530
+ clearInterval(intervalID);
5531
+ }
5532
+ };
5533
+
5534
+ var handleOnPause = function handleOnPause(event) {
5535
+ console.log('Video Pause');
5536
+ var player = event.target;
5537
+ var current = player.getCurrentTime();
5538
+ var duration = player.getDuration();
5539
+ var queue = Math.floor(duration / 10);
5540
+ var segment = Math.floor(current / queue);
5541
+
5542
+ AdSlot.Beam.report_beam_video('Pause', main.main_16, duration, current, segment);
5543
+ };
5544
+
5545
+ return React__default.createElement(YouTube, { videoId: id, opts: opts, onPlay: handleOnPlay, onPause: handleOnPause, onEnd: handleOnEnd });
6144
5546
  };
6145
5547
 
6146
5548
  var Sidebar = function Sidebar(_ref) {
@@ -6665,10 +6067,10 @@ function datasetify(elem) {
6665
6067
  props.push({ name: "data-" + key, value: ds[key] });
6666
6068
  }
6667
6069
 
6668
- return props.length ? stringify$2(props) : ""
6070
+ return props.length ? stringify(props) : ""
6669
6071
  }
6670
6072
 
6671
- function stringify$2(list) {
6073
+ function stringify(list) {
6672
6074
  var attributes = [];
6673
6075
  list.forEach(function (tuple) {
6674
6076
  var name = tuple.name;
@@ -6704,7 +6106,7 @@ function properties(elem) {
6704
6106
  props.push({ name: "class", value: elem.className });
6705
6107
  }
6706
6108
 
6707
- return props.length ? stringify$2(props) : ""
6109
+ return props.length ? stringify(props) : ""
6708
6110
  }
6709
6111
 
6710
6112
  function escapeText(s) {
@@ -14089,161 +13491,6 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
14089
13491
 
14090
13492
  var Breadcrumbs$1 = React__default.memo(Breadcrumbs);
14091
13493
 
14092
- var js_cookie = _commonjsHelpers.createCommonjsModule(function (module, exports) {
14093
- (function (factory) {
14094
- var registeredInModuleLoader;
14095
- {
14096
- module.exports = factory();
14097
- registeredInModuleLoader = true;
14098
- }
14099
- if (!registeredInModuleLoader) {
14100
- var OldCookies = window.Cookies;
14101
- var api = window.Cookies = factory();
14102
- api.noConflict = function () {
14103
- window.Cookies = OldCookies;
14104
- return api;
14105
- };
14106
- }
14107
- }(function () {
14108
- function extend () {
14109
- var i = 0;
14110
- var result = {};
14111
- for (; i < arguments.length; i++) {
14112
- var attributes = arguments[ i ];
14113
- for (var key in attributes) {
14114
- result[key] = attributes[key];
14115
- }
14116
- }
14117
- return result;
14118
- }
14119
-
14120
- function decode (s) {
14121
- return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
14122
- }
14123
-
14124
- function init (converter) {
14125
- function api() {}
14126
-
14127
- function set (key, value, attributes) {
14128
- if (typeof document === 'undefined') {
14129
- return;
14130
- }
14131
-
14132
- attributes = extend({
14133
- path: '/'
14134
- }, api.defaults, attributes);
14135
-
14136
- if (typeof attributes.expires === 'number') {
14137
- attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);
14138
- }
14139
-
14140
- // We're using "expires" because "max-age" is not supported by IE
14141
- attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
14142
-
14143
- try {
14144
- var result = JSON.stringify(value);
14145
- if (/^[\{\[]/.test(result)) {
14146
- value = result;
14147
- }
14148
- } catch (e) {}
14149
-
14150
- value = converter.write ?
14151
- converter.write(value, key) :
14152
- encodeURIComponent(String(value))
14153
- .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
14154
-
14155
- key = encodeURIComponent(String(key))
14156
- .replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)
14157
- .replace(/[\(\)]/g, escape);
14158
-
14159
- var stringifiedAttributes = '';
14160
- for (var attributeName in attributes) {
14161
- if (!attributes[attributeName]) {
14162
- continue;
14163
- }
14164
- stringifiedAttributes += '; ' + attributeName;
14165
- if (attributes[attributeName] === true) {
14166
- continue;
14167
- }
14168
-
14169
- // Considers RFC 6265 section 5.2:
14170
- // ...
14171
- // 3. If the remaining unparsed-attributes contains a %x3B (";")
14172
- // character:
14173
- // Consume the characters of the unparsed-attributes up to,
14174
- // not including, the first %x3B (";") character.
14175
- // ...
14176
- stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
14177
- }
14178
-
14179
- return (document.cookie = key + '=' + value + stringifiedAttributes);
14180
- }
14181
-
14182
- function get (key, json) {
14183
- if (typeof document === 'undefined') {
14184
- return;
14185
- }
14186
-
14187
- var jar = {};
14188
- // To prevent the for loop in the first place assign an empty array
14189
- // in case there are no cookies at all.
14190
- var cookies = document.cookie ? document.cookie.split('; ') : [];
14191
- var i = 0;
14192
-
14193
- for (; i < cookies.length; i++) {
14194
- var parts = cookies[i].split('=');
14195
- var cookie = parts.slice(1).join('=');
14196
-
14197
- if (!json && cookie.charAt(0) === '"') {
14198
- cookie = cookie.slice(1, -1);
14199
- }
14200
-
14201
- try {
14202
- var name = decode(parts[0]);
14203
- cookie = (converter.read || converter)(cookie, name) ||
14204
- decode(cookie);
14205
-
14206
- if (json) {
14207
- try {
14208
- cookie = JSON.parse(cookie);
14209
- } catch (e) {}
14210
- }
14211
-
14212
- jar[name] = cookie;
14213
-
14214
- if (key === name) {
14215
- break;
14216
- }
14217
- } catch (e) {}
14218
- }
14219
-
14220
- return key ? jar[key] : jar;
14221
- }
14222
-
14223
- api.set = set;
14224
- api.get = function (key) {
14225
- return get(key, false /* read as raw */);
14226
- };
14227
- api.getJSON = function (key) {
14228
- return get(key, true /* read as json */);
14229
- };
14230
- api.remove = function (key, attributes) {
14231
- set(key, '', extend(attributes, {
14232
- expires: -1
14233
- }));
14234
- };
14235
-
14236
- api.defaults = {};
14237
-
14238
- api.withConverter = init;
14239
-
14240
- return api;
14241
- }
14242
-
14243
- return init(function () {});
14244
- }));
14245
- });
14246
-
14247
13494
  var SetCookie = function SetCookie(key, value) {
14248
13495
  js_cookie.set(key, value, { expires: 1, sameSite: 'none', secure: true });
14249
13496
  };
@@ -15928,6 +15175,7 @@ var _initialiseProps = function _initialiseProps() {
15928
15175
  };
15929
15176
 
15930
15177
  exports.AdSlot = AdSlot.DFPAdSlot;
15178
+ exports.Beam = AdSlot.Beam;
15931
15179
  exports.DeckContent = DeckContent;
15932
15180
  exports.AD = GridContent.AD;
15933
15181
  exports.GridContent = GridContent.GridContent;
@@ -15938,7 +15186,7 @@ exports.GroupDeck = GroupDeck;
15938
15186
  exports.YoutubeGroup = YoutubeGroup.YoutubeGroup;
15939
15187
  exports.QueueDeckExpanded = QueueDeckExpanded;
15940
15188
  exports.VideoSeriesListing = VideoSeriesListing;
15941
- exports.MasterDeck = MasterDeck.MasterDeck;
15189
+ exports.MasterDeck = MasterDeck;
15942
15190
  exports.PublicationDeck = PublicationDeck;
15943
15191
  exports.IssueDeck = IssueDeck;
15944
15192
  exports.IssueContentDeck = IssueContentDeck;