@mjhls/mjh-framework 1.0.700 → 1.0.702-beta-v1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/AD.js +1 -1
  3. package/dist/cjs/AD300x250.js +5 -3
  4. package/dist/cjs/AD300x250x600.js +5 -3
  5. package/dist/cjs/AD728x90.js +6 -4
  6. package/dist/cjs/ADFloatingFooter.js +4 -2
  7. package/dist/cjs/ADGutter.js +4 -2
  8. package/dist/cjs/ADSkyscraper.js +4 -2
  9. package/dist/cjs/ADSponsoredResources.js +4 -2
  10. package/dist/cjs/ADWebcast.js +4 -2
  11. package/dist/cjs/ADWelcome.js +4 -2
  12. package/dist/cjs/AdSlot.js +14 -3
  13. package/dist/cjs/AdSlotsProvider.js +2 -2
  14. package/dist/cjs/ArticleCarousel.js +1 -1
  15. package/dist/cjs/ArticleSeriesListing.js +4 -4
  16. package/dist/cjs/Auth.js +455 -306
  17. package/dist/cjs/{BlockContent-88f69acd.js → BlockContent-80b15fac.js} +1 -1
  18. package/dist/cjs/BrowseVideosListing.js +1 -1
  19. package/dist/cjs/CMEDeck.js +5 -5
  20. package/dist/cjs/Column3.js +6 -4
  21. package/dist/cjs/ConferenceArticleCard.js +2 -2
  22. package/dist/cjs/DeckContent.js +7 -7
  23. package/dist/cjs/DeckQueue.js +6 -6
  24. package/dist/cjs/{Dfp-b2bc3b97.js → Dfp-390337bf.js} +1 -1
  25. package/dist/cjs/EventsDeck.js +4 -4
  26. package/dist/cjs/ExternalResources.js +7 -7
  27. package/dist/cjs/Feature.js +3 -3
  28. package/dist/cjs/ForbesHero.js +2 -2
  29. package/dist/cjs/GridContent.js +11 -11
  30. package/dist/cjs/GridHero.js +2 -2
  31. package/dist/cjs/GroupDeck.js +1 -1
  32. package/dist/cjs/HamMagazine.js +4 -4
  33. package/dist/cjs/Hero.js +1 -1
  34. package/dist/cjs/HorizontalHero.js +2 -2
  35. package/dist/cjs/IssueContentDeck.js +2 -2
  36. package/dist/cjs/IssueDeck.js +2 -2
  37. package/dist/cjs/IssueLanding.js +8 -8
  38. package/dist/cjs/LeftNav.js +4 -2
  39. package/dist/cjs/MasterDeck.js +8 -8
  40. package/dist/cjs/NavMagazine.js +4 -4
  41. package/dist/cjs/NavNative.js +3 -3
  42. package/dist/cjs/OncliveHero.js +2 -2
  43. package/dist/cjs/OncliveLargeHero.js +2 -2
  44. package/dist/cjs/PartnerDetailListing.js +10 -10
  45. package/dist/cjs/PublicationDeck.js +2 -2
  46. package/dist/cjs/QueueDeckExpanded.js +10 -10
  47. package/dist/cjs/RecentNews.js +2 -2
  48. package/dist/cjs/RelatedContent.js +2 -2
  49. package/dist/cjs/{SocialSearchComponent-75c51b47.js → SocialSearchComponent-56d49a1a.js} +5 -5
  50. package/dist/cjs/TaxonomyCard.js +2 -2
  51. package/dist/cjs/TemplateNormal.js +5 -3
  52. package/dist/cjs/ThumbnailCard.js +1 -1
  53. package/dist/cjs/Ustream.js +2 -2
  54. package/dist/cjs/VerticalHero.js +2 -2
  55. package/dist/cjs/VideoSeriesCard.js +2 -2
  56. package/dist/cjs/VideoSeriesListing.js +4 -4
  57. package/dist/cjs/View.js +155 -190
  58. package/dist/cjs/YahooHero.js +2 -2
  59. package/dist/cjs/YoutubeGroup.js +1 -1
  60. package/dist/cjs/getQuery.js +2 -2
  61. package/dist/cjs/getRelatedArticle.js +65 -447
  62. package/dist/cjs/getSerializers.js +6 -6
  63. package/dist/cjs/{index-2d0a4911.js → index-099d45ae.js} +6 -4
  64. package/dist/cjs/{index-5be2866f.js → index-3294d3bc.js} +1 -1
  65. package/dist/cjs/{index-b5eb3ff8.js → index-39beccb3.js} +18 -18
  66. package/dist/cjs/{index-ec02006c.js → index-58dae365.js} +12 -12
  67. package/dist/cjs/{index.es-ab3f2690.js → index.es-9110add6.js} +1 -3
  68. package/dist/cjs/index.js +15 -15
  69. package/dist/cjs/{lodash-fc2922d0.js → lodash-7fd85bcf.js} +71 -22
  70. package/dist/cjs/{main-99536bdc.js → main-03ffa84c.js} +36 -67
  71. package/dist/cjs/{moment-66a6a284.js → moment-575fe24c.js} +1 -1
  72. package/dist/cjs/timeDifferenceCalc.js +1 -1
  73. package/dist/cjs/urlFor.js +1 -1
  74. package/dist/esm/AD.js +1 -1
  75. package/dist/esm/AD300x250.js +5 -3
  76. package/dist/esm/AD300x250x600.js +5 -3
  77. package/dist/esm/AD728x90.js +6 -4
  78. package/dist/esm/ADFloatingFooter.js +4 -2
  79. package/dist/esm/ADGutter.js +4 -2
  80. package/dist/esm/ADSkyscraper.js +4 -2
  81. package/dist/esm/ADSponsoredResources.js +4 -2
  82. package/dist/esm/ADWebcast.js +4 -2
  83. package/dist/esm/ADWelcome.js +4 -2
  84. package/dist/esm/AdSlot.js +15 -4
  85. package/dist/esm/AdSlotsProvider.js +2 -2
  86. package/dist/esm/ArticleCarousel.js +1 -1
  87. package/dist/esm/ArticleSeriesListing.js +4 -4
  88. package/dist/esm/Auth.js +450 -301
  89. package/dist/esm/{BlockContent-a614acdf.js → BlockContent-c409aca5.js} +1 -1
  90. package/dist/esm/BrowseVideosListing.js +1 -1
  91. package/dist/esm/CMEDeck.js +5 -5
  92. package/dist/esm/Column3.js +6 -4
  93. package/dist/esm/ConferenceArticleCard.js +2 -2
  94. package/dist/esm/DeckContent.js +7 -7
  95. package/dist/esm/DeckQueue.js +6 -6
  96. package/dist/esm/{Dfp-8a8fca18.js → Dfp-741c01be.js} +1 -1
  97. package/dist/esm/EventsDeck.js +4 -4
  98. package/dist/esm/ExternalResources.js +7 -7
  99. package/dist/esm/Feature.js +3 -3
  100. package/dist/esm/ForbesHero.js +2 -2
  101. package/dist/esm/GridContent.js +11 -11
  102. package/dist/esm/GridHero.js +2 -2
  103. package/dist/esm/GroupDeck.js +1 -1
  104. package/dist/esm/HamMagazine.js +4 -4
  105. package/dist/esm/Hero.js +1 -1
  106. package/dist/esm/HorizontalHero.js +2 -2
  107. package/dist/esm/IssueContentDeck.js +2 -2
  108. package/dist/esm/IssueDeck.js +2 -2
  109. package/dist/esm/IssueLanding.js +8 -8
  110. package/dist/esm/LeftNav.js +4 -2
  111. package/dist/esm/MasterDeck.js +8 -8
  112. package/dist/esm/NavMagazine.js +4 -4
  113. package/dist/esm/NavNative.js +3 -3
  114. package/dist/esm/OncliveHero.js +2 -2
  115. package/dist/esm/OncliveLargeHero.js +2 -2
  116. package/dist/esm/PartnerDetailListing.js +10 -10
  117. package/dist/esm/PublicationDeck.js +2 -2
  118. package/dist/esm/QueueDeckExpanded.js +10 -10
  119. package/dist/esm/RecentNews.js +2 -2
  120. package/dist/esm/RelatedContent.js +2 -2
  121. package/dist/esm/{SocialSearchComponent-5a9c4628.js → SocialSearchComponent-677ed3bd.js} +5 -5
  122. package/dist/esm/TaxonomyCard.js +2 -2
  123. package/dist/esm/TemplateNormal.js +5 -3
  124. package/dist/esm/ThumbnailCard.js +1 -1
  125. package/dist/esm/Ustream.js +2 -2
  126. package/dist/esm/VerticalHero.js +2 -2
  127. package/dist/esm/VideoSeriesCard.js +2 -2
  128. package/dist/esm/VideoSeriesListing.js +4 -4
  129. package/dist/esm/View.js +155 -190
  130. package/dist/esm/YahooHero.js +2 -2
  131. package/dist/esm/YoutubeGroup.js +1 -1
  132. package/dist/esm/getQuery.js +2 -2
  133. package/dist/esm/getRelatedArticle.js +65 -447
  134. package/dist/esm/getSerializers.js +6 -6
  135. package/dist/esm/{index-51a80699.js → index-3849e3fe.js} +18 -18
  136. package/dist/esm/{index-93ec3c59.js → index-3f4dd6f2.js} +6 -4
  137. package/dist/esm/{index-50d0fbc7.js → index-7779a6df.js} +12 -12
  138. package/dist/esm/{index-d2f90501.js → index-ef6d5dcf.js} +1 -1
  139. package/dist/esm/{index.es-938a3a58.js → index.es-29c1cef5.js} +1 -3
  140. package/dist/esm/index.js +14 -14
  141. package/dist/esm/{lodash-17fdfebb.js → lodash-ec8c6b48.js} +71 -22
  142. package/dist/esm/{main-e2627831.js → main-35ff7b4f.js} +34 -65
  143. package/dist/esm/{moment-12415288.js → moment-e2f9b20c.js} +1 -1
  144. package/dist/esm/timeDifferenceCalc.js +1 -1
  145. package/dist/esm/urlFor.js +1 -1
  146. package/package.json +3 -3
  147. package/dist/cjs/index-bd6c9f56.js +0 -211
  148. package/dist/esm/index-db3bb315.js +0 -207
  149. /package/dist/cjs/{ADInfeed-f60d8625.js → ADInfeed-38066a36.js} +0 -0
  150. /package/dist/cjs/{ADlgInfeed-a08f8a4b.js → ADlgInfeed-d95c9027.js} +0 -0
  151. /package/dist/esm/{ADInfeed-c7e745f1.js → ADInfeed-7b1b2fcb.js} +0 -0
  152. /package/dist/esm/{ADlgInfeed-6fedd79b.js → ADlgInfeed-2afe92e6.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { c as createCommonjsModule, u as unwrapExports, a as commonjsGlobal } from './_commonjsHelpers-0c4b6f40.js';
1
+ import './_commonjsHelpers-0c4b6f40.js';
2
2
  import './_to-object-ded78eb9.js';
3
3
  import './es6.string.iterator-9b2af4a5.js';
4
4
  import './_library-528f1934.js';
@@ -7,445 +7,39 @@ import './core.get-iterator-method-54d2e411.js';
7
7
  import './web.dom.iterable-8956f9a5.js';
8
8
  import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-7c654f36.js';
9
9
  import './_set-species-cede29f8.js';
10
- import { c as cookie } from './index-db3bb315.js';
10
+ import { parseCookies, setCookie } from 'nookies';
11
11
  import getQuery from './getQuery.js';
12
12
 
13
- var defaultParseOptions = {
14
- decodeValues: true,
15
- map: false,
16
- silent: false,
17
- };
18
-
19
- function isNonEmptyString(str) {
20
- return typeof str === "string" && !!str.trim();
21
- }
22
-
23
- function parseString(setCookieValue, options) {
24
- var parts = setCookieValue.split(";").filter(isNonEmptyString);
25
- var nameValue = parts.shift().split("=");
26
- var name = nameValue.shift();
27
- var value = nameValue.join("="); // everything after the first =, joined by a "=" if there was more than one part
28
-
29
- options = options
30
- ? Object.assign({}, defaultParseOptions, options)
31
- : defaultParseOptions;
32
-
33
- try {
34
- value = options.decodeValues ? decodeURIComponent(value) : value; // decode cookie value
35
- } catch (e) {
36
- console.error(
37
- `set-cookie-parser encountered an error while decoding a cookie with value '${value}'. Set options.decodeValues to false to disable this feature.`,
38
- e
39
- );
40
- }
41
-
42
- var cookie = {
43
- name: name, // grab everything before the first =
44
- value: value,
45
- };
46
-
47
- parts.forEach(function (part) {
48
- var sides = part.split("=");
49
- var key = sides.shift().trimLeft().toLowerCase();
50
- var value = sides.join("=");
51
- if (key === "expires") {
52
- cookie.expires = new Date(value);
53
- } else if (key === "max-age") {
54
- cookie.maxAge = parseInt(value, 10);
55
- } else if (key === "secure") {
56
- cookie.secure = true;
57
- } else if (key === "httponly") {
58
- cookie.httpOnly = true;
59
- } else if (key === "samesite") {
60
- cookie.sameSite = value;
61
- } else {
62
- cookie[key] = value;
63
- }
64
- });
65
-
66
- return cookie;
67
- }
68
-
69
- function parse(input, options) {
70
- options = options
71
- ? Object.assign({}, defaultParseOptions, options)
72
- : defaultParseOptions;
73
-
74
- if (!input) {
75
- if (!options.map) {
76
- return [];
77
- } else {
78
- return {};
79
- }
80
- }
81
-
82
- if (input.headers && input.headers["set-cookie"]) {
83
- // fast-path for node.js (which automatically normalizes header names to lower-case
84
- input = input.headers["set-cookie"];
85
- } else if (input.headers) {
86
- // slow-path for other environments - see #25
87
- var sch =
88
- input.headers[
89
- Object.keys(input.headers).find(function (key) {
90
- return key.toLowerCase() === "set-cookie";
91
- })
92
- ];
93
- // warn if called on a request-like object with a cookie header rather than a set-cookie header - see #34, 36
94
- if (!sch && input.headers.cookie && !options.silent) {
95
- console.warn(
96
- "Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."
97
- );
98
- }
99
- input = sch;
100
- }
101
- if (!Array.isArray(input)) {
102
- input = [input];
103
- }
104
-
105
- options = options
106
- ? Object.assign({}, defaultParseOptions, options)
107
- : defaultParseOptions;
108
-
109
- if (!options.map) {
110
- return input.filter(isNonEmptyString).map(function (str) {
111
- return parseString(str, options);
112
- });
113
- } else {
114
- var cookies = {};
115
- return input.filter(isNonEmptyString).reduce(function (cookies, str) {
116
- var cookie = parseString(str, options);
117
- cookies[cookie.name] = cookie;
118
- return cookies;
119
- }, cookies);
120
- }
121
- }
122
-
123
- /*
124
- Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas
125
- that are within a single set-cookie field-value, such as in the Expires portion.
126
-
127
- This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2
128
- Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128
129
- React Native's fetch does this for *every* header, including set-cookie.
130
-
131
- Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25
132
- Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation
133
- */
134
- function splitCookiesString(cookiesString) {
135
- if (Array.isArray(cookiesString)) {
136
- return cookiesString;
137
- }
138
- if (typeof cookiesString !== "string") {
139
- return [];
140
- }
141
-
142
- var cookiesStrings = [];
143
- var pos = 0;
144
- var start;
145
- var ch;
146
- var lastComma;
147
- var nextStart;
148
- var cookiesSeparatorFound;
149
-
150
- function skipWhitespace() {
151
- while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
152
- pos += 1;
153
- }
154
- return pos < cookiesString.length;
155
- }
156
-
157
- function notSpecialChar() {
158
- ch = cookiesString.charAt(pos);
159
-
160
- return ch !== "=" && ch !== ";" && ch !== ",";
161
- }
162
-
163
- while (pos < cookiesString.length) {
164
- start = pos;
165
- cookiesSeparatorFound = false;
166
-
167
- while (skipWhitespace()) {
168
- ch = cookiesString.charAt(pos);
169
- if (ch === ",") {
170
- // ',' is a cookie separator if we have later first '=', not ';' or ','
171
- lastComma = pos;
172
- pos += 1;
173
-
174
- skipWhitespace();
175
- nextStart = pos;
176
-
177
- while (pos < cookiesString.length && notSpecialChar()) {
178
- pos += 1;
179
- }
180
-
181
- // currently special character
182
- if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
183
- // we found cookies separator
184
- cookiesSeparatorFound = true;
185
- // pos is inside the next cookie, so back up and return it.
186
- pos = nextStart;
187
- cookiesStrings.push(cookiesString.substring(start, lastComma));
188
- start = pos;
189
- } else {
190
- // in param ',' or param separator ';',
191
- // we continue from that comma
192
- pos = lastComma + 1;
193
- }
194
- } else {
195
- pos += 1;
196
- }
197
- }
198
-
199
- if (!cookiesSeparatorFound || pos >= cookiesString.length) {
200
- cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
201
- }
202
- }
203
-
204
- return cookiesStrings;
205
- }
206
-
207
- var setCookie = parse;
208
- var parse_1 = parse;
209
- var parseString_1 = parseString;
210
- var splitCookiesString_1 = splitCookiesString;
211
- setCookie.parse = parse_1;
212
- setCookie.parseString = parseString_1;
213
- setCookie.splitCookiesString = splitCookiesString_1;
214
-
215
- var utils = createCommonjsModule(function (module, exports) {
216
- var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
217
- __assign = Object.assign || function(t) {
218
- for (var s, i = 1, n = arguments.length; i < n; i++) {
219
- s = arguments[i];
220
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
221
- t[p] = s[p];
222
- }
223
- return t;
224
- };
225
- return __assign.apply(this, arguments);
226
- };
227
- Object.defineProperty(exports, "__esModule", { value: true });
228
- exports.areCookiesEqual = exports.hasSameProperties = exports.createCookie = exports.isBrowser = void 0;
229
- /**
230
- * Tells whether we are in a browser or server.
231
- */
232
- function isBrowser() {
233
- return typeof window !== 'undefined';
234
- }
235
- exports.isBrowser = isBrowser;
236
- /**
237
- * Create an instance of the Cookie interface
238
- */
239
- function createCookie(name, value, options) {
240
- var sameSite = options.sameSite;
241
- if (sameSite === true) {
242
- sameSite = 'strict';
243
- }
244
- if (sameSite === undefined || sameSite === false) {
245
- sameSite = 'lax';
246
- }
247
- var cookieToSet = __assign(__assign({}, options), { sameSite: sameSite });
248
- delete cookieToSet.encode;
249
- return __assign({ name: name, value: value }, cookieToSet);
250
- }
251
- exports.createCookie = createCookie;
252
- /**
253
- * Tells whether given objects have the same properties.
254
- */
255
- function hasSameProperties(a, b) {
256
- var aProps = Object.getOwnPropertyNames(a);
257
- var bProps = Object.getOwnPropertyNames(b);
258
- if (aProps.length !== bProps.length) {
259
- return false;
260
- }
261
- for (var i = 0; i < aProps.length; i++) {
262
- var propName = aProps[i];
263
- if (a[propName] !== b[propName]) {
264
- return false;
265
- }
266
- }
267
- return true;
268
- }
269
- exports.hasSameProperties = hasSameProperties;
270
- /**
271
- * Compare the cookie and return true if the cookies have equivalent
272
- * options and the cookies would be overwritten in the browser storage.
273
- *
274
- * @param a first Cookie for comparison
275
- * @param b second Cookie for comparison
276
- */
277
- function areCookiesEqual(a, b) {
278
- var sameSiteSame = a.sameSite === b.sameSite;
279
- if (typeof a.sameSite === 'string' && typeof b.sameSite === 'string') {
280
- sameSiteSame = a.sameSite.toLowerCase() === b.sameSite.toLowerCase();
281
- }
282
- return (hasSameProperties(__assign(__assign({}, a), { sameSite: undefined }), __assign(__assign({}, b), { sameSite: undefined })) && sameSiteSame);
283
- }
284
- exports.areCookiesEqual = areCookiesEqual;
285
- /* Functions */
286
-
287
- });
288
-
289
- unwrapExports(utils);
290
- var utils_1 = utils.areCookiesEqual;
291
- var utils_2 = utils.hasSameProperties;
292
- var utils_3 = utils.createCookie;
293
- var utils_4 = utils.isBrowser;
294
-
295
- var dist = createCommonjsModule(function (module, exports) {
296
- var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
297
- __assign = Object.assign || function(t) {
298
- for (var s, i = 1, n = arguments.length; i < n; i++) {
299
- s = arguments[i];
300
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
301
- t[p] = s[p];
302
- }
303
- return t;
304
- };
305
- return __assign.apply(this, arguments);
306
- };
307
- Object.defineProperty(exports, "__esModule", { value: true });
308
- exports.destroyCookie = exports.setCookie = exports.parseCookies = void 0;
309
-
310
-
311
-
312
- /**
313
- * Parses cookies.
314
- *
315
- * @param ctx NextJS page or API context, express context, null or undefined.
316
- * @param options Options that we pass down to `cookie` library.
317
- */
318
- function parseCookies(ctx, options) {
319
- var _a, _b;
320
- if ((_b = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.req) === null || _a === void 0 ? void 0 : _a.headers) === null || _b === void 0 ? void 0 : _b.cookie) {
321
- return cookie.parse(ctx.req.headers.cookie, options);
322
- }
323
- if (utils.isBrowser()) {
324
- return cookie.parse(document.cookie, options);
325
- }
326
- return {};
327
- }
328
- exports.parseCookies = parseCookies;
329
- /**
330
- * Sets a cookie.
331
- *
332
- * @param ctx NextJS page or API context, express context, null or undefined.
333
- * @param name The name of your cookie.
334
- * @param value The value of your cookie.
335
- * @param options Options that we pass down to `cookie` library.
336
- */
337
- function setCookie$1(ctx, name, value, options) {
338
- var _a, _b;
339
- if (options === void 0) { options = {}; }
340
- // SSR
341
- if (((_a = ctx === null || ctx === void 0 ? void 0 : ctx.res) === null || _a === void 0 ? void 0 : _a.getHeader) && ctx.res.setHeader) {
342
- // Check if response has finished and warn about it.
343
- if ((_b = ctx === null || ctx === void 0 ? void 0 : ctx.res) === null || _b === void 0 ? void 0 : _b.finished) {
344
- console.warn("Not setting \"" + name + "\" cookie. Response has finished.");
345
- console.warn("You should set cookie before res.send()");
346
- return {};
347
- }
348
- /**
349
- * Load existing cookies from the header and parse them.
350
- */
351
- var cookies = ctx.res.getHeader('Set-Cookie') || [];
352
- if (typeof cookies === 'string')
353
- cookies = [cookies];
354
- if (typeof cookies === 'number')
355
- cookies = [];
356
- /**
357
- * Parse cookies but ignore values - we've already encoded
358
- * them in the previous call.
359
- */
360
- var parsedCookies = setCookie.parse(cookies, {
361
- decodeValues: false,
362
- });
363
- /**
364
- * We create the new cookie and make sure that none of
365
- * the existing cookies match it.
366
- */
367
- var newCookie_1 = utils.createCookie(name, value, options);
368
- var cookiesToSet_1 = [];
369
- parsedCookies.forEach(function (parsedCookie) {
370
- if (!utils.areCookiesEqual(parsedCookie, newCookie_1)) {
371
- /**
372
- * We serialize the cookie back to the original format
373
- * if it isn't the same as the new one.
374
- */
375
- var serializedCookie = cookie.serialize(parsedCookie.name, parsedCookie.value, __assign({
376
- // we prevent reencoding by default, but you might override it
377
- encode: function (val) { return val; } }, parsedCookie));
378
- cookiesToSet_1.push(serializedCookie);
379
- }
380
- });
381
- cookiesToSet_1.push(cookie.serialize(name, value, options));
382
- // Update the header.
383
- ctx.res.setHeader('Set-Cookie', cookiesToSet_1);
384
- }
385
- // Browser
386
- if (utils.isBrowser()) {
387
- if (options && options.httpOnly) {
388
- throw new Error('Can not set a httpOnly cookie in the browser.');
389
- }
390
- document.cookie = cookie.serialize(name, value, options);
391
- }
392
- return {};
393
- }
394
- exports.setCookie = setCookie$1;
395
- /**
396
- * Destroys a cookie with a particular name.
397
- *
398
- * @param ctx NextJS page or API context, express context, null or undefined.
399
- * @param name Cookie name.
400
- * @param options Options that we pass down to `cookie` library.
401
- */
402
- function destroyCookie(ctx, name, options) {
403
- /**
404
- * We forward the request destroy to setCookie function
405
- * as it is the same function with modified maxAge value.
406
- */
407
- return setCookie$1(ctx, name, '', __assign(__assign({}, (options || {})), { maxAge: -1 }));
408
- }
409
- exports.destroyCookie = destroyCookie;
410
- /* Utility Exports */
411
- exports.default = {
412
- set: setCookie$1,
413
- get: parseCookies,
414
- destroy: destroyCookie,
415
- };
416
-
417
- });
418
-
419
- unwrapExports(dist);
420
- var dist_1 = dist.destroyCookie;
421
- var dist_2 = dist.setCookie;
422
- var dist_3 = dist.parseCookies;
423
-
424
13
  var _this = undefined;
425
14
 
426
15
  var getRelatedArticle = function () {
427
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
16
+ var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
428
17
  var ctx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
429
18
  var client = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
430
19
  var article = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
431
20
  var prevUrl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '/';
432
21
  var articleCount = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
433
22
 
434
- var taxonomyMapping, _article$url, url, content_placement, taxonomy, params, conditions, cookies, prevSlugs, relatedArticleQuery, relatedArticle;
23
+ var _article$url, url, documentGroupMapping, issueGroup, content_placement, references, params, articles, filters, cookies, prevSlugs, query;
435
24
 
436
25
  return regenerator.wrap(function _callee$(_context) {
437
26
  while (1) {
438
27
  switch (_context.prev = _context.next) {
439
28
  case 0:
440
- taxonomyMapping = article.taxonomyMapping, _article$url = article.url;
29
+ _article$url = article.url;
441
30
  _article$url = _article$url === undefined ? {
442
31
  current: null
443
32
  } : _article$url;
444
- url = _article$url.current, content_placement = article.content_placement;
445
- taxonomy = [];
446
- //404 articles were throwing server error
33
+ url = _article$url.current, documentGroupMapping = article.documentGroupMapping, issueGroup = article.issueGroup;
34
+ content_placement = article.content_placement;
35
+ references = [];
447
36
 
448
- if (content_placement) {
37
+
38
+ content_placement = content_placement && content_placement.length > 0 && content_placement.filter(function (_ref2) {
39
+ var identifier = _ref2.identifier;
40
+ return identifier !== 'news';
41
+ });
42
+ if (content_placement && content_placement.length > 0) {
449
43
  content_placement.forEach(function (_ref3) {
450
44
  var path = _ref3.path,
451
45
  _id = _ref3._id;
@@ -457,55 +51,79 @@ var getRelatedArticle = function () {
457
51
  if (prev_url_to_check.includes('?')) {
458
52
  prev_url_to_check = prev_url_to_check.split('?')[0];
459
53
  }
460
- if (prev_url_to_check.endsWith(path) && _id) taxonomy.push(_id);
54
+ if (prev_url_to_check.endsWith(path) && _id) references.push(_id);
461
55
  });
56
+ if (references.length === 0) {
57
+ content_placement.forEach(function (_ref4) {
58
+ var _id = _ref4._id;
59
+
60
+ if (_id) references.push(_id);
61
+ });
62
+ }
462
63
  }
463
64
 
464
- //404 articles were throwing server error
465
- if (taxonomy.length === 0 && taxonomyMapping) {
466
- taxonomyMapping.forEach(function (_ref4) {
467
- var _ref = _ref4._ref;
65
+ if (documentGroupMapping && documentGroupMapping.length > 0) {
66
+ documentGroupMapping.forEach(function (_ref5) {
67
+ var _id = _ref5._id;
468
68
 
469
- if (_ref) {
470
- taxonomy.push(_ref);
471
- }
69
+ if (_id) references.push(_id);
472
70
  });
473
71
  }
474
72
 
475
- params = {
476
- url: url,
477
- taxonomy: taxonomy,
478
- index: articleCount
479
- };
480
- conditions = '';
73
+ if (issueGroup && issueGroup._id) {
74
+ references.push(issueGroup._id);
75
+ }
76
+
77
+ params = { url: url, index: articleCount };
78
+ articles = null;
79
+
80
+ if (!(references && references.length > 0)) {
81
+ _context.next = 24;
82
+ break;
83
+ }
84
+
85
+ filters = '&& references("' + references.join('","') + '") ';
86
+
481
87
 
482
88
  if (ctx && url) {
483
- cookies = dist_3(ctx);
89
+ cookies = parseCookies(ctx);
484
90
  prevSlugs = cookies['prevSlugs'];
485
91
 
486
92
  if (!!prevSlugs) {
487
- dist_2(ctx, 'prevSlugs', prevSlugs + ',"' + url + '"', {});
488
- conditions = '&& !(url.current in [' + prevSlugs + '])';
489
- } else dist_2(ctx, 'prevSlugs', '"' + url + '"', {});
93
+ setCookie(ctx, 'prevSlugs', prevSlugs + ',"' + url + '"', {});
94
+ filters = '&& !(url.current in [' + prevSlugs + '])';
95
+ } else setCookie(ctx, 'prevSlugs', '"' + url + '"', {});
490
96
  }
491
- relatedArticleQuery = getQuery('related', conditions, '', articleCount);
492
- _context.next = 12;
493
- return client.fetch(relatedArticleQuery, params);
494
97
 
495
- case 12:
496
- relatedArticle = _context.sent;
497
- return _context.abrupt('return', relatedArticle);
98
+ query = getQuery('related', filters, '', articleCount).replace('&& taxonomyMapping[]._ref in $taxonomy', '');
99
+ _context.prev = 15;
100
+ _context.next = 18;
101
+ return client.fetch(query, params);
102
+
103
+ case 18:
104
+ articles = _context.sent;
105
+ _context.next = 24;
106
+ break;
107
+
108
+ case 21:
109
+ _context.prev = 21;
110
+ _context.t0 = _context['catch'](15);
111
+
112
+ console.error(_context.t0);
113
+
114
+ case 24:
115
+ return _context.abrupt('return', articles);
498
116
 
499
- case 14:
117
+ case 25:
500
118
  case 'end':
501
119
  return _context.stop();
502
120
  }
503
121
  }
504
- }, _callee, _this);
122
+ }, _callee, _this, [[15, 21]]);
505
123
  }));
506
124
 
507
125
  return function getRelatedArticle() {
508
- return _ref2.apply(this, arguments);
126
+ return _ref.apply(this, arguments);
509
127
  };
510
128
  }();
511
129
 
@@ -14,18 +14,18 @@ import './web.dom.iterable-8956f9a5.js';
14
14
  import './typeof-08f2c380.js';
15
15
  import './_is-array-49698029.js';
16
16
  import 'react';
17
- import './index-93ec3c59.js';
17
+ import './index-3f4dd6f2.js';
18
18
  import 'prop-types';
19
19
  import 'react-bootstrap/Row';
20
20
  import 'react-bootstrap/Col';
21
- import './moment-12415288.js';
21
+ import './moment-e2f9b20c.js';
22
22
  import 'next/router';
23
23
  import './isSymbol-807e927e.js';
24
24
  import './debounce-1a993acf.js';
25
25
  import 'react-dom';
26
- import './index-51a80699.js';
26
+ import './index-3849e3fe.js';
27
27
  import './index-5f9f807a.js';
28
- import './main-e2627831.js';
28
+ import './main-35ff7b4f.js';
29
29
  import './entities-7cc3bf45.js';
30
30
  import './stringify-008c8802.js';
31
31
  import './slicedToArray-7021e5df.js';
@@ -34,14 +34,14 @@ import './_set-species-cede29f8.js';
34
34
  import './Segment.js';
35
35
  import './Beam.js';
36
36
  import './AdSlot.js';
37
- import './BlockContent-a614acdf.js';
37
+ import './BlockContent-c409aca5.js';
38
38
  import './smoothscroll-4b699764.js';
39
39
  import './GroupDeck.js';
40
40
  import 'react-bootstrap';
41
41
  import './iconBase-602d52fe.js';
42
42
  import './index.esm-29e48d38.js';
43
43
  import 'react-bootstrap/Button';
44
- export { g as default } from './index-50d0fbc7.js';
44
+ export { g as default } from './index-7779a6df.js';
45
45
  import './util-7700fc59.js';
46
46
  import './brightcove-react-player-loader.es-83f53e4e.js';
47
47
  import 'react-bootstrap/Pagination';