@mjhls/mjh-framework 1.0.119 → 1.0.120

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -16,6 +16,8 @@ var Link = _interopDefault(require('next/link'));
16
16
  var router = require('next/router');
17
17
  var Media = _interopDefault(require('react-bootstrap/Media'));
18
18
  var reactBootstrap = require('react-bootstrap');
19
+ var Button = _interopDefault(require('react-bootstrap/Button'));
20
+ var Badge = _interopDefault(require('react-bootstrap/Badge'));
19
21
  var ListGroup = _interopDefault(require('react-bootstrap/ListGroup'));
20
22
  var Head = _interopDefault(require('next/head'));
21
23
  var Accordion = _interopDefault(require('react-bootstrap/Accordion'));
@@ -23,7 +25,6 @@ var AccordionToggle = require('react-bootstrap/AccordionToggle');
23
25
  var reactShare = require('react-share');
24
26
  var Form = _interopDefault(require('react-bootstrap/Form'));
25
27
  var FormControl = _interopDefault(require('react-bootstrap/FormControl'));
26
- var Button = _interopDefault(require('react-bootstrap/Button'));
27
28
  var Nav = _interopDefault(require('react-bootstrap/Nav'));
28
29
  var Navbar = _interopDefault(require('react-bootstrap/Navbar'));
29
30
  var NavDropdown = _interopDefault(require('react-bootstrap/NavDropdown'));
@@ -12648,6 +12649,221 @@ var VideoSeriesListing = function (_React$Component) {
12648
12649
  }(React__default.Component);
12649
12650
  var VideoSeriesListing$1 = router.withRouter(VideoSeriesListing);
12650
12651
 
12652
+ var PublicationDeck = function PublicationDeck(props) {
12653
+ var data = props.data,
12654
+ imageHeight = props.imageHeight,
12655
+ imageWidth = props.imageWidth,
12656
+ href = props.href,
12657
+ Website = props.Website,
12658
+ client = props.client;
12659
+
12660
+ var urlFor = function urlFor(source) {
12661
+ var builder = imageUrlBuilder(client);
12662
+ return builder.image(source);
12663
+ };
12664
+
12665
+ var renderCardImage = function renderCardImage(thumbnail) {
12666
+ if (thumbnail && thumbnail.asset) {
12667
+ var url = urlFor(thumbnail);
12668
+ if (imageHeight) url = url.height(imageHeight);
12669
+ if (imageWidth) url = url.width(imageWidth);
12670
+ return url.url();
12671
+ } else {
12672
+ return Website.logo;
12673
+ }
12674
+ };
12675
+
12676
+ return React__default.createElement(
12677
+ Row,
12678
+ null,
12679
+ data && data.map(function (row, index) {
12680
+ return row.identifier && row.identifier.current && React__default.createElement(
12681
+ Col,
12682
+ { md: 12, lg: '4', style: { display: 'flex', flex: '1 0 auto' }, key: index },
12683
+ React__default.createElement(
12684
+ Card,
12685
+ { className: 'block-card', style: { width: '200px' } },
12686
+ React__default.createElement(
12687
+ Link,
12688
+ { href: href + '/' + row.identifier.current },
12689
+ React__default.createElement(
12690
+ 'a',
12691
+ null,
12692
+ row.childIssue && row.childIssue.thumbnail && React__default.createElement(Card.Img, { variant: 'top', src: renderCardImage(row.childIssue.thumbnail), alt: row.name }),
12693
+ React__default.createElement(
12694
+ Card.Body,
12695
+ null,
12696
+ React__default.createElement(
12697
+ Card.Title,
12698
+ null,
12699
+ row.name
12700
+ ),
12701
+ React__default.createElement(
12702
+ Button,
12703
+ { variant: 'secondary' },
12704
+ 'Browse Issues'
12705
+ )
12706
+ )
12707
+ )
12708
+ )
12709
+ )
12710
+ );
12711
+ })
12712
+ );
12713
+ };
12714
+
12715
+ var IssueDeck = function IssueDeck(props) {
12716
+ var data = props.data,
12717
+ href = props.href,
12718
+ imageHeight = props.imageHeight,
12719
+ imageWidth = props.imageWidth,
12720
+ Website = props.Website,
12721
+ client = props.client,
12722
+ publication = props.publication;
12723
+
12724
+
12725
+ var urlFor = function urlFor(source) {
12726
+ var builder = imageUrlBuilder(client);
12727
+ return builder.image(source);
12728
+ };
12729
+
12730
+ var renderCardImage = function renderCardImage(thumbnail) {
12731
+ if (thumbnail && thumbnail.asset) {
12732
+ var url = urlFor(thumbnail);
12733
+ if (imageHeight) url = url.height(imageHeight);
12734
+ if (imageWidth) url = url.width(imageWidth);
12735
+ return url.url();
12736
+ } else {
12737
+ return Website.logo;
12738
+ }
12739
+ };
12740
+
12741
+ return React__default.createElement(
12742
+ Row,
12743
+ null,
12744
+ data && data.map(function (row, index) {
12745
+ return publication && row.identifier && row.identifier.current && React__default.createElement(
12746
+ Col,
12747
+ { md: 12, lg: 12, key: index },
12748
+ React__default.createElement(
12749
+ Link,
12750
+ { href: href + '/' + publication + '/' + row.identifier.current },
12751
+ React__default.createElement(
12752
+ 'a',
12753
+ null,
12754
+ React__default.createElement(
12755
+ Card,
12756
+ { className: 'queue-card journal-queue', style: { borderTop: '1px solid #EEE' } },
12757
+ React__default.createElement(
12758
+ Row,
12759
+ { style: { flexDirection: 'left' } },
12760
+ React__default.createElement(
12761
+ Col,
12762
+ { md: 12, lg: 4 },
12763
+ row.thumbnail && React__default.createElement(Card.Img, { variant: 'top', src: renderCardImage(row.thumbnail), alt: row.name })
12764
+ ),
12765
+ React__default.createElement(
12766
+ Col,
12767
+ null,
12768
+ React__default.createElement(
12769
+ Card.Body,
12770
+ { style: { padding: '20px' } },
12771
+ React__default.createElement(
12772
+ Card.Title,
12773
+ null,
12774
+ row.name
12775
+ ),
12776
+ React__default.createElement(
12777
+ 'div',
12778
+ null,
12779
+ 'Volume: ',
12780
+ row.volume
12781
+ ),
12782
+ React__default.createElement(
12783
+ 'div',
12784
+ null,
12785
+ 'Number: ',
12786
+ row.number
12787
+ ),
12788
+ React__default.createElement(
12789
+ Button,
12790
+ { style: { marginTop: '20px' }, variant: 'secondary' },
12791
+ 'View Issue'
12792
+ )
12793
+ )
12794
+ )
12795
+ )
12796
+ )
12797
+ )
12798
+ )
12799
+ );
12800
+ })
12801
+ );
12802
+ };
12803
+
12804
+ var IssueContentDeck = function IssueContentDeck(props) {
12805
+ var data = props.data,
12806
+ imageHeight = props.imageHeight,
12807
+ imageWidth = props.imageWidth,
12808
+ Website = props.Website,
12809
+ client = props.client;
12810
+
12811
+
12812
+ var urlFor = function urlFor(source) {
12813
+ var builder = imageUrlBuilder(client);
12814
+ return builder.image(source);
12815
+ };
12816
+
12817
+ var renderCardImage = function renderCardImage(thumbnail) {
12818
+ if (thumbnail && thumbnail.asset) {
12819
+ var url = urlFor(thumbnail);
12820
+ if (imageHeight) url = url.height(imageHeight);
12821
+ if (imageWidth) url = url.width(imageWidth);
12822
+ return url.url();
12823
+ } else {
12824
+ return Website.logo;
12825
+ }
12826
+ };
12827
+
12828
+ return React__default.createElement(
12829
+ Row,
12830
+ null,
12831
+ data && data.map(function (row, index) {
12832
+ return row.url && row.url.current && React__default.createElement(
12833
+ Col,
12834
+ { md: 12, lg: 6, style: { display: 'flex', flex: '1 0 auto' }, key: index },
12835
+ React__default.createElement(
12836
+ Card,
12837
+ null,
12838
+ React__default.createElement(
12839
+ Link,
12840
+ { href: '/view/[url]', as: '/view/' + row.url.current },
12841
+ React__default.createElement(
12842
+ 'a',
12843
+ null,
12844
+ row.thumbnail && React__default.createElement(Card.Img, { variant: 'top', src: renderCardImage(row.thumbnail), alt: row.title }),
12845
+ React__default.createElement(
12846
+ Card.Body,
12847
+ null,
12848
+ row.issueSection && row.issueSection.name ? React__default.createElement(
12849
+ Badge,
12850
+ { variant: 'success' },
12851
+ row.issueSection && row.issueSection.name.name
12852
+ ) : '',
12853
+ React__default.createElement(
12854
+ Card.Title,
12855
+ null,
12856
+ row.title
12857
+ )
12858
+ )
12859
+ )
12860
+ )
12861
+ )
12862
+ );
12863
+ })
12864
+ );
12865
+ };
12866
+
12651
12867
  var Column1 = function Column1(props) {
12652
12868
  var title = props.title;
12653
12869
 
@@ -13239,6 +13455,336 @@ var NavFooter = function NavFooter(props) {
13239
13455
  );
13240
13456
  };
13241
13457
 
13458
+ /*!
13459
+ * cookie
13460
+ * Copyright(c) 2012-2014 Roman Shtylman
13461
+ * Copyright(c) 2015 Douglas Christopher Wilson
13462
+ * MIT Licensed
13463
+ */
13464
+
13465
+ /**
13466
+ * Module exports.
13467
+ * @public
13468
+ */
13469
+
13470
+ var parse_1 = parse;
13471
+ var serialize_1 = serialize;
13472
+
13473
+ /**
13474
+ * Module variables.
13475
+ * @private
13476
+ */
13477
+
13478
+ var decode = decodeURIComponent;
13479
+ var encode = encodeURIComponent;
13480
+ var pairSplitRegExp = /; */;
13481
+
13482
+ /**
13483
+ * RegExp to match field-content in RFC 7230 sec 3.2
13484
+ *
13485
+ * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
13486
+ * field-vchar = VCHAR / obs-text
13487
+ * obs-text = %x80-FF
13488
+ */
13489
+
13490
+ var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
13491
+
13492
+ /**
13493
+ * Parse a cookie header.
13494
+ *
13495
+ * Parse the given cookie header string into an object
13496
+ * The object has the various cookies as keys(names) => values
13497
+ *
13498
+ * @param {string} str
13499
+ * @param {object} [options]
13500
+ * @return {object}
13501
+ * @public
13502
+ */
13503
+
13504
+ function parse(str, options) {
13505
+ if (typeof str !== 'string') {
13506
+ throw new TypeError('argument str must be a string');
13507
+ }
13508
+
13509
+ var obj = {};
13510
+ var opt = options || {};
13511
+ var pairs = str.split(pairSplitRegExp);
13512
+ var dec = opt.decode || decode;
13513
+
13514
+ for (var i = 0; i < pairs.length; i++) {
13515
+ var pair = pairs[i];
13516
+ var eq_idx = pair.indexOf('=');
13517
+
13518
+ // skip things that don't look like key=value
13519
+ if (eq_idx < 0) {
13520
+ continue;
13521
+ }
13522
+
13523
+ var key = pair.substr(0, eq_idx).trim();
13524
+ var val = pair.substr(++eq_idx, pair.length).trim();
13525
+
13526
+ // quoted values
13527
+ if ('"' == val[0]) {
13528
+ val = val.slice(1, -1);
13529
+ }
13530
+
13531
+ // only assign once
13532
+ if (undefined == obj[key]) {
13533
+ obj[key] = tryDecode(val, dec);
13534
+ }
13535
+ }
13536
+
13537
+ return obj;
13538
+ }
13539
+
13540
+ /**
13541
+ * Serialize data into a cookie header.
13542
+ *
13543
+ * Serialize the a name value pair into a cookie string suitable for
13544
+ * http headers. An optional options object specified cookie parameters.
13545
+ *
13546
+ * serialize('foo', 'bar', { httpOnly: true })
13547
+ * => "foo=bar; httpOnly"
13548
+ *
13549
+ * @param {string} name
13550
+ * @param {string} val
13551
+ * @param {object} [options]
13552
+ * @return {string}
13553
+ * @public
13554
+ */
13555
+
13556
+ function serialize(name, val, options) {
13557
+ var opt = options || {};
13558
+ var enc = opt.encode || encode;
13559
+
13560
+ if (typeof enc !== 'function') {
13561
+ throw new TypeError('option encode is invalid');
13562
+ }
13563
+
13564
+ if (!fieldContentRegExp.test(name)) {
13565
+ throw new TypeError('argument name is invalid');
13566
+ }
13567
+
13568
+ var value = enc(val);
13569
+
13570
+ if (value && !fieldContentRegExp.test(value)) {
13571
+ throw new TypeError('argument val is invalid');
13572
+ }
13573
+
13574
+ var str = name + '=' + value;
13575
+
13576
+ if (null != opt.maxAge) {
13577
+ var maxAge = opt.maxAge - 0;
13578
+ if (isNaN(maxAge)) throw new Error('maxAge should be a Number');
13579
+ str += '; Max-Age=' + Math.floor(maxAge);
13580
+ }
13581
+
13582
+ if (opt.domain) {
13583
+ if (!fieldContentRegExp.test(opt.domain)) {
13584
+ throw new TypeError('option domain is invalid');
13585
+ }
13586
+
13587
+ str += '; Domain=' + opt.domain;
13588
+ }
13589
+
13590
+ if (opt.path) {
13591
+ if (!fieldContentRegExp.test(opt.path)) {
13592
+ throw new TypeError('option path is invalid');
13593
+ }
13594
+
13595
+ str += '; Path=' + opt.path;
13596
+ }
13597
+
13598
+ if (opt.expires) {
13599
+ if (typeof opt.expires.toUTCString !== 'function') {
13600
+ throw new TypeError('option expires is invalid');
13601
+ }
13602
+
13603
+ str += '; Expires=' + opt.expires.toUTCString();
13604
+ }
13605
+
13606
+ if (opt.httpOnly) {
13607
+ str += '; HttpOnly';
13608
+ }
13609
+
13610
+ if (opt.secure) {
13611
+ str += '; Secure';
13612
+ }
13613
+
13614
+ if (opt.sameSite) {
13615
+ var sameSite = typeof opt.sameSite === 'string'
13616
+ ? opt.sameSite.toLowerCase() : opt.sameSite;
13617
+
13618
+ switch (sameSite) {
13619
+ case true:
13620
+ str += '; SameSite=Strict';
13621
+ break;
13622
+ case 'lax':
13623
+ str += '; SameSite=Lax';
13624
+ break;
13625
+ case 'strict':
13626
+ str += '; SameSite=Strict';
13627
+ break;
13628
+ case 'none':
13629
+ str += '; SameSite=None';
13630
+ break;
13631
+ default:
13632
+ throw new TypeError('option sameSite is invalid');
13633
+ }
13634
+ }
13635
+
13636
+ return str;
13637
+ }
13638
+
13639
+ /**
13640
+ * Try decoding a string using a decoding function.
13641
+ *
13642
+ * @param {string} str
13643
+ * @param {function} decode
13644
+ * @private
13645
+ */
13646
+
13647
+ function tryDecode(str, decode) {
13648
+ try {
13649
+ return decode(str);
13650
+ } catch (e) {
13651
+ return str;
13652
+ }
13653
+ }
13654
+
13655
+ function hasDocumentCookie() {
13656
+ // Can we get/set cookies on document.cookie?
13657
+ return typeof document === 'object' && typeof document.cookie === 'string';
13658
+ }
13659
+ function parseCookies(cookies, options) {
13660
+ if (typeof cookies === 'string') {
13661
+ return parse_1(cookies, options);
13662
+ }
13663
+ else if (typeof cookies === 'object' && cookies !== null) {
13664
+ return cookies;
13665
+ }
13666
+ else {
13667
+ return {};
13668
+ }
13669
+ }
13670
+ function isParsingCookie(value, doNotParse) {
13671
+ if (typeof doNotParse === 'undefined') {
13672
+ // We guess if the cookie start with { or [, it has been serialized
13673
+ doNotParse =
13674
+ !value || (value[0] !== '{' && value[0] !== '[' && value[0] !== '"');
13675
+ }
13676
+ return !doNotParse;
13677
+ }
13678
+ function readCookie(value, options) {
13679
+ if (options === void 0) { options = {}; }
13680
+ var cleanValue = cleanupCookieValue(value);
13681
+ if (isParsingCookie(cleanValue, options.doNotParse)) {
13682
+ try {
13683
+ return JSON.parse(cleanValue);
13684
+ }
13685
+ catch (e) {
13686
+ // At least we tried
13687
+ }
13688
+ }
13689
+ // Ignore clean value if we failed the deserialization
13690
+ // It is not relevant anymore to trim those values
13691
+ return value;
13692
+ }
13693
+ function cleanupCookieValue(value) {
13694
+ // express prepend j: before serializing a cookie
13695
+ if (value && value[0] === 'j' && value[1] === ':') {
13696
+ return value.substr(2);
13697
+ }
13698
+ return value;
13699
+ }
13700
+
13701
+ // We can't please Rollup and TypeScript at the same time
13702
+ // Only way to make both of them work
13703
+ var objectAssign = require('object-assign');
13704
+ var Cookies = /** @class */ (function () {
13705
+ function Cookies(cookies, options) {
13706
+ var _this = this;
13707
+ this.changeListeners = [];
13708
+ this.HAS_DOCUMENT_COOKIE = false;
13709
+ this.cookies = parseCookies(cookies, options);
13710
+ new Promise(function () {
13711
+ _this.HAS_DOCUMENT_COOKIE = hasDocumentCookie();
13712
+ }).catch(function () { });
13713
+ }
13714
+ Cookies.prototype._updateBrowserValues = function (parseOptions) {
13715
+ if (!this.HAS_DOCUMENT_COOKIE) {
13716
+ return;
13717
+ }
13718
+ this.cookies = parse_1(document.cookie, parseOptions);
13719
+ };
13720
+ Cookies.prototype._emitChange = function (params) {
13721
+ for (var i = 0; i < this.changeListeners.length; ++i) {
13722
+ this.changeListeners[i](params);
13723
+ }
13724
+ };
13725
+ Cookies.prototype.get = function (name, options, parseOptions) {
13726
+ if (options === void 0) { options = {}; }
13727
+ this._updateBrowserValues(parseOptions);
13728
+ return readCookie(this.cookies[name], options);
13729
+ };
13730
+ Cookies.prototype.getAll = function (options, parseOptions) {
13731
+ if (options === void 0) { options = {}; }
13732
+ this._updateBrowserValues(parseOptions);
13733
+ var result = {};
13734
+ for (var name_1 in this.cookies) {
13735
+ result[name_1] = readCookie(this.cookies[name_1], options);
13736
+ }
13737
+ return result;
13738
+ };
13739
+ Cookies.prototype.set = function (name, value, options) {
13740
+ var _a;
13741
+ if (typeof value === 'object') {
13742
+ value = JSON.stringify(value);
13743
+ }
13744
+ this.cookies = objectAssign({}, this.cookies, (_a = {}, _a[name] = value, _a));
13745
+ if (this.HAS_DOCUMENT_COOKIE) {
13746
+ document.cookie = serialize_1(name, value, options);
13747
+ }
13748
+ this._emitChange({ name: name, value: value, options: options });
13749
+ };
13750
+ Cookies.prototype.remove = function (name, options) {
13751
+ var finalOptions = (options = objectAssign({}, options, {
13752
+ expires: new Date(1970, 1, 1, 0, 0, 1),
13753
+ maxAge: 0
13754
+ }));
13755
+ this.cookies = objectAssign({}, this.cookies);
13756
+ delete this.cookies[name];
13757
+ if (this.HAS_DOCUMENT_COOKIE) {
13758
+ document.cookie = serialize_1(name, '', finalOptions);
13759
+ }
13760
+ this._emitChange({ name: name, value: undefined, options: options });
13761
+ };
13762
+ Cookies.prototype.addChangeListener = function (callback) {
13763
+ this.changeListeners.push(callback);
13764
+ };
13765
+ Cookies.prototype.removeChangeListener = function (callback) {
13766
+ var idx = this.changeListeners.indexOf(callback);
13767
+ if (idx >= 0) {
13768
+ this.changeListeners.splice(idx, 1);
13769
+ }
13770
+ };
13771
+ return Cookies;
13772
+ }());
13773
+
13774
+ var Cookies$1 = Cookies;
13775
+ // we seem to sometimes get the ES6 version despite requesting cjs here, not sure why
13776
+ // this isn't the ideal fix, but it'll do for now
13777
+ Cookies$1 = Cookies$1.default || Cookies$1;
13778
+
13779
+ function nextCookies(ctx, options) {
13780
+ // Note: Next.js Static export sets ctx.req to a fake request with no headers
13781
+ var header = ctx.req && ctx.req.headers && ctx.req.headers.cookie;
13782
+ var uc = new Cookies$1(header);
13783
+ return uc.getAll(options);
13784
+ }
13785
+
13786
+ var nextCookies_1 = nextCookies;
13787
+
13242
13788
  var NavMagazine = function NavMagazine(props) {
13243
13789
  /*
13244
13790
  Example Nav with acceptable props
@@ -13259,8 +13805,7 @@ var NavMagazine = function NavMagazine(props) {
13259
13805
  website = props.website,
13260
13806
  _props$showLogin = props.showLogin,
13261
13807
  showLogin = _props$showLogin === undefined ? false : _props$showLogin,
13262
- _props$initialLoginSt = props.initialLoginState,
13263
- initialLoginState = _props$initialLoginSt === undefined ? false : _props$initialLoginSt;
13808
+ allCookies = props.allCookies;
13264
13809
 
13265
13810
  var navRef = React.useRef(null);
13266
13811
 
@@ -13274,6 +13819,8 @@ var NavMagazine = function NavMagazine(props) {
13274
13819
  screenWidth = _useState4[0],
13275
13820
  setScreenWidth = _useState4[1];
13276
13821
 
13822
+ var initialLoginState = allCookies.loggedIn;
13823
+
13277
13824
  var _useState5 = React.useState(initialLoginState),
13278
13825
  _useState6 = slicedToArray(_useState5, 2),
13279
13826
  loginState = _useState6[0],
@@ -13289,13 +13836,52 @@ var NavMagazine = function NavMagazine(props) {
13289
13836
 
13290
13837
  React.useEffect(function () {
13291
13838
  setScreenWidth(parseInt(window.innerWidth));
13292
- if (typeof GCN !== 'undefined' && GCN && GCN.onecount) {
13293
- setLoginState(GCN.onecount.isLoggedIn());
13839
+ }, []);
13840
+
13841
+ React.useLayoutEffect(function () {
13842
+ if (typeof GCN !== 'undefined') {
13843
+ GCN.on('init').then(function (data) {
13844
+ console.log('GCN init...');
13845
+ setLoginState(data.loggedin);
13846
+ if (data.loggedIn) {
13847
+ console.log(' - logged in status');
13848
+ document.cookie = 'loggedIn=' + data.loggedIn + '; path=/';
13849
+ } else {
13850
+ console.log(' - logged out status');
13851
+ document.cookie = 'loggedIn=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT';
13852
+ }
13853
+ });
13854
+
13855
+ GCN.on('login').then(function (data) {
13856
+ setLoginState(data.loggedin);
13857
+ console.log('GCN login...');
13858
+ document.cookie = 'loggedIn=' + data.loggedIn + '; path=/';
13859
+ });
13860
+
13861
+ GCN.on('logout').then(function (data) {
13862
+ setLoginState(data.loggedin);
13863
+ console.log('GCN logout...');
13864
+ document.cookie = 'loggedIn=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT';
13865
+ });
13294
13866
  } else {
13295
- console.error('GCN not defined');
13867
+ console.error('GCN not defined for GCN events');
13296
13868
  }
13297
13869
  }, []);
13298
13870
 
13871
+ React.useEffect(function () {
13872
+ toggleLogin();
13873
+ }, [loginState]);
13874
+
13875
+ var toggleLogin = function toggleLogin() {
13876
+ if (loginState) {
13877
+ document.getElementsByClassName('logged-in').style.display = '';
13878
+ document.getElementsByClassName('logged-out').style.display = 'none';
13879
+ } else {
13880
+ document.getElementsByClassName('logged-in').style.display = 'none';
13881
+ document.getElementsByClassName('logged-out').style.display = '';
13882
+ }
13883
+ };
13884
+
13299
13885
  var trackScrolling = function trackScrolling() {
13300
13886
  var offsetTop = navRef.current.getBoundingClientRect().top;
13301
13887
 
@@ -13308,8 +13894,13 @@ var NavMagazine = function NavMagazine(props) {
13308
13894
 
13309
13895
  var handleLogin = function handleLogin(e) {
13310
13896
  if (typeof GCN !== 'undefined' && GCN && GCN.onecount) {
13311
- GCN.onecount.login();
13312
- setLoginState(GCN.onecount.isLoggedIn());
13897
+ GCN.onecount.login().then(function (result) {
13898
+ console.log('login result: ', result);
13899
+ setLoginState(GCN.onecount.isLoggedIn());
13900
+ }).catch(function (error) {
13901
+ console.log('login error:', error);
13902
+ setLoginState(GCN.onecount.isLoggedIn());
13903
+ });
13313
13904
  } else {
13314
13905
  console.error('GCN not defined');
13315
13906
  }
@@ -13317,8 +13908,13 @@ var NavMagazine = function NavMagazine(props) {
13317
13908
 
13318
13909
  var handleLogout = function handleLogout(e) {
13319
13910
  if (typeof GCN !== 'undefined' && GCN && GCN.onecount) {
13320
- GCN.onecount.logout();
13321
- setLoginState(GCN.onecount.isLoggedIn());
13911
+ GCN.onecount.logout().then(function (result) {
13912
+ console.log('logout result:', result);
13913
+ setLoginState(GCN.onecount.isLoggedIn());
13914
+ }).catch(function (error) {
13915
+ console.log('logout error:', error);
13916
+ setLoginState(GCN.onecount.isLoggedIn());
13917
+ });
13322
13918
  } else {
13323
13919
  console.error('GCN not defined');
13324
13920
  }
@@ -13336,9 +13932,9 @@ var NavMagazine = function NavMagazine(props) {
13336
13932
  React__default.createElement(
13337
13933
  Nav,
13338
13934
  { id: 'navbar-top', className: 'justify-content-center navbar-top', style: { margin: '0 auto' } },
13339
- showLogin && !loginState && React__default.createElement(
13935
+ showLogin && React__default.createElement(
13340
13936
  Nav.Item,
13341
- { id: 'nav-mobile-register' },
13937
+ { id: 'nav-mobile-register', className: 'logged-out', style: { display: loginState ? 'none' : '' } },
13342
13938
  React__default.createElement(
13343
13939
  'div',
13344
13940
  { className: 'px-2 py-2', onClick: function onClick(e) {
@@ -13361,9 +13957,9 @@ var NavMagazine = function NavMagazine(props) {
13361
13957
  )
13362
13958
  )
13363
13959
  ),
13364
- showLogin && !loginState && React__default.createElement(
13960
+ showLogin && React__default.createElement(
13365
13961
  Nav.Item,
13366
- { id: 'nav-mobile-login' },
13962
+ { id: 'nav-mobile-login', className: 'logged-out', style: { display: loginState ? 'none' : '' } },
13367
13963
  React__default.createElement(
13368
13964
  'div',
13369
13965
  { className: 'px-2 py-2 ', onClick: function onClick(e) {
@@ -13373,9 +13969,9 @@ var NavMagazine = function NavMagazine(props) {
13373
13969
  ' Login'
13374
13970
  )
13375
13971
  ),
13376
- showLogin && loginState && React__default.createElement(
13972
+ showLogin && React__default.createElement(
13377
13973
  React__default.Fragment,
13378
- null,
13974
+ { className: 'logged-in', style: { display: !loginState ? 'none' : '' } },
13379
13975
  React__default.createElement(
13380
13976
  Nav.Item,
13381
13977
  { id: 'nav-mobile-logout' },
@@ -13393,9 +13989,9 @@ var NavMagazine = function NavMagazine(props) {
13393
13989
  React__default.createElement(
13394
13990
  Nav,
13395
13991
  { style: { position: 'absolute', right: '15px' }, className: 'justify-content-end rightHeader' },
13396
- showLogin && !loginState && React__default.createElement(
13992
+ showLogin && React__default.createElement(
13397
13993
  React__default.Fragment,
13398
- null,
13994
+ { className: 'logged-out', style: { display: loginState ? 'none' : '' } },
13399
13995
  React__default.createElement(
13400
13996
  Nav.Item,
13401
13997
  null,
@@ -13421,9 +14017,9 @@ var NavMagazine = function NavMagazine(props) {
13421
14017
  )
13422
14018
  )
13423
14019
  ),
13424
- showLogin && loginState && React__default.createElement(
14020
+ showLogin && React__default.createElement(
13425
14021
  React__default.Fragment,
13426
- null,
14022
+ { className: 'logged-in', style: { display: !loginState ? 'none' : '' } },
13427
14023
  React__default.createElement(
13428
14024
  Nav.Item,
13429
14025
  null,
@@ -13565,6 +14161,12 @@ var NavMagazine = function NavMagazine(props) {
13565
14161
  );
13566
14162
  };
13567
14163
 
14164
+ NavMagazine.getInitialProps = function (ctx) {
14165
+ return {
14166
+ allCookies: nextCookies_1(ctx)
14167
+ };
14168
+ };
14169
+
13568
14170
  var NavNative = function NavNative(props) {
13569
14171
  var logo = props.logo,
13570
14172
  dataObject = props.dataObject,
@@ -14058,19 +14660,17 @@ var AD = function AD(_ref) {
14058
14660
  _ref$targeting = _ref.targeting,
14059
14661
  targeting = _ref$targeting === undefined ? {} : _ref$targeting;
14060
14662
 
14061
-
14062
14663
  return React__default.createElement(
14063
14664
  lib_1,
14064
- { dfpNetworkId: networkID, targetingArguments: targeting, sizeMapping: sizeMapping, lazyLoad: { fetchMarginPercent: 500, renderMarginPercent: 200, mobileScaling: 2.0 } },
14665
+ {
14666
+ dfpNetworkId: networkID,
14667
+ targetingArguments: targeting,
14668
+ sizeMapping: sizeMapping,
14669
+ lazyLoad: { fetchMarginPercent: 500, renderMarginPercent: 200, mobileScaling: 2.0 } },
14065
14670
  React__default.createElement(
14066
14671
  'div',
14067
14672
  { className: className },
14068
- React__default.createElement(lib_2, {
14069
- slotId: slotId,
14070
- sizes: sizes,
14071
- adUnit: adUnit,
14072
- sizeMapping: sizeMapping
14073
- })
14673
+ React__default.createElement(lib_2, { slotId: slotId, sizes: sizes, adUnit: adUnit, sizeMapping: sizeMapping })
14074
14674
  )
14075
14675
  );
14076
14676
  };
@@ -14107,6 +14707,37 @@ var AD300x250x600 = function AD300x250x600(_ref) {
14107
14707
  });
14108
14708
  };
14109
14709
 
14710
+ var ADFooter = function ADFooter(_ref) {
14711
+ var children = _ref.children;
14712
+
14713
+ var _useState = React.useState(true),
14714
+ _useState2 = slicedToArray(_useState, 2),
14715
+ showAd = _useState2[0],
14716
+ setShowAd = _useState2[1];
14717
+
14718
+ return React__default.createElement(
14719
+ React__default.Fragment,
14720
+ null,
14721
+ showAd && React__default.createElement(
14722
+ 'div',
14723
+ { className: 'ADFooter' },
14724
+ children,
14725
+ React__default.createElement(
14726
+ 'div',
14727
+ { className: 'closeButton', onClick: function onClick() {
14728
+ return setShowAd(false);
14729
+ } },
14730
+ 'x'
14731
+ )
14732
+ ),
14733
+ React__default.createElement(
14734
+ 'style',
14735
+ { jsx: true },
14736
+ '\n .ADFooter {\n width: auto;\n margin: 0;\n background-color: #f5f5f5;\n position: fixed;\n bottom: 0;\n left: 50%;\n transform: translateX(-50%);\n z-index: 9000;\n }\n .closeButton {\n position: absolute;\n top: -10px;\n right: -10px;\n background: grey;\n color: white;\n font-weight: 500;\n border: 2px solid white;\n border-radius: 50%;\n width: 30px;\n height: 30px;\n text-align: center;\n font-size: 17px;\n cursor: pointer;\n }\n '
14737
+ )
14738
+ );
14739
+ };
14740
+
14110
14741
  var urlFor$1 = function urlFor(source, client) {
14111
14742
  var builder = imageUrlBuilder(client);
14112
14743
  return builder.image(source);
@@ -14509,7 +15140,7 @@ var ms = function(val, options) {
14509
15140
  options = options || {};
14510
15141
  var type = typeof val;
14511
15142
  if (type === 'string' && val.length > 0) {
14512
- return parse(val);
15143
+ return parse$1(val);
14513
15144
  } else if (type === 'number' && isNaN(val) === false) {
14514
15145
  return options.long ? fmtLong(val) : fmtShort(val);
14515
15146
  }
@@ -14527,7 +15158,7 @@ var ms = function(val, options) {
14527
15158
  * @api private
14528
15159
  */
14529
15160
 
14530
- function parse(str) {
15161
+ function parse$1(str) {
14531
15162
  str = String(str);
14532
15163
  if (str.length > 100) {
14533
15164
  return;
@@ -16942,7 +17573,7 @@ function shouldUseNative() {
16942
17573
  }
16943
17574
  }
16944
17575
 
16945
- var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
17576
+ var objectAssign$1 = shouldUseNative() ? Object.assign : function (target, source) {
16946
17577
  var from;
16947
17578
  var to = toObject(target);
16948
17579
  var symbols;
@@ -17017,7 +17648,7 @@ var buildUrl = function buildUrl(props) {
17017
17648
  throw new Error('Invalid image reference in block, no `_ref` found on `asset`');
17018
17649
  }
17019
17650
 
17020
- return node(objectAssign({
17651
+ return node(objectAssign$1({
17021
17652
  projectId: projectId,
17022
17653
  dataset: dataset
17023
17654
  }, options.imageOptions || {})).image(node$$1).toString();
@@ -17157,7 +17788,7 @@ var serializers = function (h, serializerOpts) {
17157
17788
  };
17158
17789
  }
17159
17790
 
17160
- var serializedNode = objectAssign({}, span, children);
17791
+ var serializedNode = objectAssign$1({}, span, children);
17161
17792
  return h(serializers.span, {
17162
17793
  key: span._key || "span-".concat(index),
17163
17794
  node: serializedNode,
@@ -17395,7 +18026,7 @@ function nestLists(blocks) {
17395
18026
  // will mutate the input, and we don't want to blindly clone the entire tree.
17396
18027
  // Clone the last child while adding our new list as the last child of it
17397
18028
  var lastListItem = lastChild(currentList);
17398
- var newLastChild = objectAssign({}, lastListItem, {
18029
+ var newLastChild = objectAssign$1({}, lastListItem, {
17399
18030
  children: lastListItem.children.concat(newList)
17400
18031
  }); // Swap the last child
17401
18032
 
@@ -17497,7 +18128,7 @@ var generateKeys = function (blocks) {
17497
18128
  return block;
17498
18129
  }
17499
18130
 
17500
- return objectAssign({
18131
+ return objectAssign$1({
17501
18132
  _key: getStaticKey(block)
17502
18133
  }, block);
17503
18134
  });
@@ -17541,7 +18172,7 @@ var mergeSerializers = function mergeSerializers(defaultSerializers, userSeriali
17541
18172
  if (type === 'function') {
17542
18173
  acc[key] = isDefined(userSerializers[key]) ? userSerializers[key] : defaultSerializers[key];
17543
18174
  } else if (type === 'object') {
17544
- acc[key] = objectAssign({}, defaultSerializers[key], userSerializers[key]);
18175
+ acc[key] = objectAssign$1({}, defaultSerializers[key], userSerializers[key]);
17545
18176
  } else {
17546
18177
  acc[key] = typeof userSerializers[key] === 'undefined' ? defaultSerializers[key] : userSerializers[key];
17547
18178
  }
@@ -17564,7 +18195,7 @@ var defaults$1 = {
17564
18195
  };
17565
18196
 
17566
18197
  function blocksToNodes(h, properties, defaultSerializers, serializeSpan) {
17567
- var props = objectAssign({}, defaults$1, properties);
18198
+ var props = objectAssign$1({}, defaults$1, properties);
17568
18199
  var rawBlocks = Array.isArray(props.blocks) ? props.blocks : [props.blocks];
17569
18200
  var keyedBlocks = generateKeys(rawBlocks);
17570
18201
  var blocks = nestLists_1(keyedBlocks, props.listNestMode);
@@ -17901,7 +18532,7 @@ var IFrame = function IFrame(_ref) {
17901
18532
  return React__default.createElement(
17902
18533
  'div',
17903
18534
  { className: 'd-block text-center mb-3' },
17904
- React__default.createElement('iframe', { className: 'w-100', src: url, frameBorder: '0' })
18535
+ React__default.createElement('iframe', { className: 'w-100 iFrame-block', src: url, frameBorder: '0' })
17905
18536
  );
17906
18537
  };
17907
18538
 
@@ -18048,7 +18679,7 @@ function removeEventListener(type, listener) {
18048
18679
  }
18049
18680
  }
18050
18681
 
18051
- var serialize = serializeNode;
18682
+ var serialize$1 = serializeNode;
18052
18683
 
18053
18684
  var voidElements = ["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];
18054
18685
 
@@ -18350,7 +18981,7 @@ DOMElement.prototype.focus = function _Element_focus() {
18350
18981
  };
18351
18982
 
18352
18983
  DOMElement.prototype.toString = function _Element_toString() {
18353
- return serialize(this)
18984
+ return serialize$1(this)
18354
18985
  };
18355
18986
 
18356
18987
  DOMElement.prototype.getElementsByClassName = function _Element_getElementsByClassName(classNames) {
@@ -20526,7 +21157,17 @@ var Quiz = function Quiz(_ref) {
20526
21157
  );
20527
21158
  };
20528
21159
 
20529
- var getSerializers$1 = function getSerializers(client, pageview, videoAccountIDs, onVote, showVotes) {
21160
+ var Leads = function Leads(_ref) {
21161
+ var url = _ref.url;
21162
+
21163
+ return React__default.createElement(
21164
+ 'div',
21165
+ { className: 'd-block text-center mb-3' },
21166
+ url && React__default.createElement('iframe', { className: 'w-100 h-100 leads-block', src: url, frameBorder: '0', allow: 'fullscreen' })
21167
+ );
21168
+ };
21169
+
21170
+ var getSerializers$1 = function getSerializers(client, pageview, videoAccountIDs, onVote, showVotes, drupalLeadSettings) {
20530
21171
  return {
20531
21172
  types: {
20532
21173
  youtube: function youtube(_ref) {
@@ -20598,6 +21239,13 @@ var getSerializers$1 = function getSerializers(client, pageview, videoAccountIDs
20598
21239
  var quizzes = node.quizzes;
20599
21240
 
20600
21241
  return React__default.createElement(Quiz, { quizzes: quizzes });
21242
+ },
21243
+ leads: function leads(_ref13) {
21244
+ var node = _ref13.node;
21245
+ var leadID = node.leadID;
21246
+
21247
+ var url = '' + drupalLeadSettings.baseUrl + leadID;
21248
+ return React__default.createElement(Leads, { url: url });
20601
21249
  }
20602
21250
  },
20603
21251
  marks: {
@@ -20627,32 +21275,32 @@ var getSerializers$1 = function getSerializers(client, pageview, videoAccountIDs
20627
21275
  children
20628
21276
  );
20629
21277
  },
20630
- alignleft: function alignleft(_ref13) {
20631
- var children = _ref13.children;
21278
+ alignleft: function alignleft(_ref14) {
21279
+ var children = _ref14.children;
20632
21280
  return React__default.createElement(
20633
21281
  'div',
20634
21282
  { style: { textAlign: 'left' } },
20635
21283
  children
20636
21284
  );
20637
21285
  },
20638
- alignright: function alignright(_ref14) {
20639
- var children = _ref14.children;
21286
+ alignright: function alignright(_ref15) {
21287
+ var children = _ref15.children;
20640
21288
  return React__default.createElement(
20641
21289
  'div',
20642
21290
  { style: { textAlign: 'right' } },
20643
21291
  children
20644
21292
  );
20645
21293
  },
20646
- aligncenter: function aligncenter(_ref15) {
20647
- var children = _ref15.children;
21294
+ aligncenter: function aligncenter(_ref16) {
21295
+ var children = _ref16.children;
20648
21296
  return React__default.createElement(
20649
21297
  'div',
20650
21298
  { style: { textAlign: 'center' } },
20651
21299
  children
20652
21300
  );
20653
21301
  },
20654
- alignjustify: function alignjustify(_ref16) {
20655
- var children = _ref16.children;
21302
+ alignjustify: function alignjustify(_ref17) {
21303
+ var children = _ref17.children;
20656
21304
  return React__default.createElement(
20657
21305
  'div',
20658
21306
  { style: { textAlign: 'justify' } },
@@ -21181,6 +21829,9 @@ exports.GroupDeck = GroupDeck;
21181
21829
  exports.YoutubeGroup = YoutubeGroup;
21182
21830
  exports.QueueDeckExpanded = QueueDeckExpanded;
21183
21831
  exports.VideoSeriesListing = VideoSeriesListing$1;
21832
+ exports.PublicationDeck = PublicationDeck;
21833
+ exports.IssueDeck = IssueDeck;
21834
+ exports.IssueContentDeck = IssueContentDeck;
21184
21835
  exports.Column1 = Column1;
21185
21836
  exports.Column2 = Column2;
21186
21837
  exports.Column3 = Column3;
@@ -21194,9 +21845,11 @@ exports.NavNative = NavNative;
21194
21845
  exports.NavNormal = NavNormal;
21195
21846
  exports.NavDvm = NavDvm;
21196
21847
  exports.TemplateNormal = TemplateNormal;
21848
+ exports.AD = AD;
21197
21849
  exports.AD300x250 = AD300x250;
21198
21850
  exports.AD300x250x600 = AD300x250x600;
21199
21851
  exports.AD728x90 = AD728x90;
21852
+ exports.ADFooter = ADFooter;
21200
21853
  exports.getSerializers = getSerializers$1;
21201
21854
  exports.Search = Search;
21202
21855
  exports.Feature = Feature;