@mjhls/mjh-framework 1.0.664-beta.0 → 1.0.664

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 (149) hide show
  1. package/dist/cjs/AD.js +1 -1
  2. package/dist/cjs/AD300x250.js +3 -3
  3. package/dist/cjs/AD300x250x600.js +3 -3
  4. package/dist/cjs/AD728x90.js +4 -4
  5. package/dist/cjs/ADFloatingFooter.js +2 -2
  6. package/dist/cjs/ADGutter.js +2 -2
  7. package/dist/cjs/ADSkyscraper.js +2 -2
  8. package/dist/cjs/ADSponsoredResources.js +2 -2
  9. package/dist/cjs/ADWebcast.js +2 -2
  10. package/dist/cjs/ADWelcome.js +2 -2
  11. package/dist/cjs/AdSlot.js +2 -2
  12. package/dist/cjs/AdSlotsProvider.js +1 -1
  13. package/dist/cjs/ArticleCarousel.js +3 -3
  14. package/dist/cjs/ArticleSeriesListing.js +4 -4
  15. package/dist/cjs/Auth.js +507 -256
  16. package/dist/cjs/{BlockContent-091a991f.js → BlockContent-88f69acd.js} +1 -1
  17. package/dist/cjs/CMEDeck.js +5 -5
  18. package/dist/cjs/Column3.js +4 -4
  19. package/dist/cjs/ConferenceArticleCard.js +2 -2
  20. package/dist/cjs/DeckContent.js +7 -7
  21. package/dist/cjs/DeckQueue.js +6 -6
  22. package/dist/cjs/{Dfp-f6a18ed2.js → Dfp-b2bc3b97.js} +1 -1
  23. package/dist/cjs/EventsDeck.js +5 -5
  24. package/dist/cjs/ExternalResources.js +7 -7
  25. package/dist/cjs/Feature.js +3 -3
  26. package/dist/cjs/ForbesHero.js +2 -2
  27. package/dist/cjs/GridContent.js +10 -10
  28. package/dist/cjs/GridHero.js +2 -2
  29. package/dist/cjs/GroupDeck.js +1 -1
  30. package/dist/cjs/HamMagazine.js +4 -4
  31. package/dist/cjs/Hero.js +1 -1
  32. package/dist/cjs/HorizontalHero.js +2 -2
  33. package/dist/cjs/IssueContentDeck.js +2 -2
  34. package/dist/cjs/IssueDeck.js +2 -2
  35. package/dist/cjs/IssueLanding.js +7 -7
  36. package/dist/cjs/LeftNav.js +2 -2
  37. package/dist/cjs/MasterDeck.js +8 -8
  38. package/dist/cjs/NavMagazine.js +4 -4
  39. package/dist/cjs/NavNative.js +3 -3
  40. package/dist/cjs/OncliveHero.js +2 -2
  41. package/dist/cjs/OncliveLargeHero.js +2 -2
  42. package/dist/cjs/PartnerDetailListing.js +15 -1212
  43. package/dist/cjs/PublicationDeck.js +1 -1
  44. package/dist/cjs/QueueDeckExpanded.js +9 -9
  45. package/dist/cjs/RecentNews.js +2 -2
  46. package/dist/cjs/RelatedContent.js +2 -2
  47. package/dist/cjs/{SocialSearchComponent-81a50f81.js → SocialSearchComponent-962b1344.js} +5 -5
  48. package/dist/cjs/TaxonomyCard.js +2 -2
  49. package/dist/cjs/TemplateNormal.js +3 -3
  50. package/dist/cjs/ThumbnailCard.js +1 -1
  51. package/dist/cjs/Ustream.js +2 -2
  52. package/dist/cjs/VerticalHero.js +2 -2
  53. package/dist/cjs/VideoSeriesCard.js +2 -2
  54. package/dist/cjs/VideoSeriesListing.js +3 -3
  55. package/dist/cjs/View.js +70 -227
  56. package/dist/cjs/YahooHero.js +2 -2
  57. package/dist/cjs/YoutubeGroup.js +1 -1
  58. package/dist/cjs/getQuery.js +2 -2
  59. package/dist/cjs/getRelatedArticle.js +90 -5
  60. package/dist/cjs/getSerializers.js +6 -6
  61. package/dist/cjs/{getTargeting-9af0ef69.js → getTargeting-fee8c429.js} +2 -2
  62. package/dist/cjs/getTargeting.js +1 -1
  63. package/dist/cjs/{index-fa8ed292.js → index-2d0a4911.js} +34 -27
  64. package/dist/cjs/{index-3294d3bc.js → index-5be2866f.js} +1 -1
  65. package/dist/cjs/{index-bc3e2d5c.js → index-6f1ee5f0.js} +462 -450
  66. package/dist/cjs/{index-be0c82be.js → index-b5eb3ff8.js} +20 -19
  67. package/dist/cjs/{index.es-9110add6.js → index.es-ab3f2690.js} +3 -1
  68. package/dist/cjs/index.js +16 -15
  69. package/dist/cjs/{main-a4cb15bb.js → main-b6c96c8d.js} +67 -36
  70. package/dist/cjs/{moment-575fe24c.js → moment-66a6a284.js} +1 -1
  71. package/dist/cjs/urlFor.js +1 -1
  72. package/dist/esm/AD.js +1 -1
  73. package/dist/esm/AD300x250.js +3 -3
  74. package/dist/esm/AD300x250x600.js +3 -3
  75. package/dist/esm/AD728x90.js +4 -4
  76. package/dist/esm/ADFloatingFooter.js +2 -2
  77. package/dist/esm/ADGutter.js +2 -2
  78. package/dist/esm/ADSkyscraper.js +2 -2
  79. package/dist/esm/ADSponsoredResources.js +2 -2
  80. package/dist/esm/ADWebcast.js +2 -2
  81. package/dist/esm/ADWelcome.js +2 -2
  82. package/dist/esm/AdSlot.js +2 -2
  83. package/dist/esm/AdSlotsProvider.js +1 -1
  84. package/dist/esm/ArticleCarousel.js +1 -1
  85. package/dist/esm/ArticleSeriesListing.js +4 -4
  86. package/dist/esm/Auth.js +499 -248
  87. package/dist/esm/{BlockContent-e9b4ddcf.js → BlockContent-a614acdf.js} +1 -1
  88. package/dist/esm/CMEDeck.js +5 -5
  89. package/dist/esm/Column3.js +4 -4
  90. package/dist/esm/ConferenceArticleCard.js +2 -2
  91. package/dist/esm/DeckContent.js +7 -7
  92. package/dist/esm/DeckQueue.js +6 -6
  93. package/dist/esm/{Dfp-96b49def.js → Dfp-8a8fca18.js} +1 -1
  94. package/dist/esm/EventsDeck.js +5 -5
  95. package/dist/esm/ExternalResources.js +7 -7
  96. package/dist/esm/Feature.js +3 -3
  97. package/dist/esm/ForbesHero.js +2 -2
  98. package/dist/esm/GridContent.js +10 -10
  99. package/dist/esm/GridHero.js +2 -2
  100. package/dist/esm/GroupDeck.js +1 -1
  101. package/dist/esm/HamMagazine.js +4 -4
  102. package/dist/esm/Hero.js +1 -1
  103. package/dist/esm/HorizontalHero.js +2 -2
  104. package/dist/esm/IssueContentDeck.js +2 -2
  105. package/dist/esm/IssueDeck.js +2 -2
  106. package/dist/esm/IssueLanding.js +7 -7
  107. package/dist/esm/LeftNav.js +2 -2
  108. package/dist/esm/MasterDeck.js +8 -8
  109. package/dist/esm/NavMagazine.js +4 -4
  110. package/dist/esm/NavNative.js +3 -3
  111. package/dist/esm/OncliveHero.js +2 -2
  112. package/dist/esm/OncliveLargeHero.js +2 -2
  113. package/dist/esm/PartnerDetailListing.js +13 -1209
  114. package/dist/esm/PublicationDeck.js +1 -1
  115. package/dist/esm/QueueDeckExpanded.js +9 -9
  116. package/dist/esm/RecentNews.js +2 -2
  117. package/dist/esm/RelatedContent.js +2 -2
  118. package/dist/esm/{SocialSearchComponent-55960ec4.js → SocialSearchComponent-75527dfe.js} +5 -5
  119. package/dist/esm/TaxonomyCard.js +2 -2
  120. package/dist/esm/TemplateNormal.js +3 -3
  121. package/dist/esm/ThumbnailCard.js +1 -1
  122. package/dist/esm/Ustream.js +2 -2
  123. package/dist/esm/VerticalHero.js +2 -2
  124. package/dist/esm/VideoSeriesCard.js +2 -2
  125. package/dist/esm/VideoSeriesListing.js +3 -3
  126. package/dist/esm/View.js +41 -198
  127. package/dist/esm/YahooHero.js +2 -2
  128. package/dist/esm/YoutubeGroup.js +1 -1
  129. package/dist/esm/getQuery.js +2 -2
  130. package/dist/esm/getRelatedArticle.js +93 -4
  131. package/dist/esm/getSerializers.js +6 -6
  132. package/dist/esm/{index-6d49c905.js → index-3a33f7d6.js} +462 -450
  133. package/dist/esm/{index-73819142.js → index-51a80699.js} +20 -19
  134. package/dist/esm/{index-0e45a0b2.js → index-93ec3c59.js} +34 -27
  135. package/dist/esm/{index-ef6d5dcf.js → index-d2f90501.js} +1 -1
  136. package/dist/esm/{index.es-29c1cef5.js → index.es-938a3a58.js} +3 -1
  137. package/dist/esm/index.js +14 -13
  138. package/dist/esm/{main-5d1e4bd3.js → main-0465b2a0.js} +65 -34
  139. package/dist/esm/{moment-e2f9b20c.js → moment-12415288.js} +1 -1
  140. package/dist/esm/urlFor.js +1 -1
  141. package/package.json +1 -1
  142. package/dist/cjs/getRelatedArticle-606b1d0b.js +0 -447
  143. package/dist/cjs/index-bd6c9f56.js +0 -211
  144. package/dist/esm/getRelatedArticle-80e67416.js +0 -443
  145. package/dist/esm/index-db3bb315.js +0 -207
  146. /package/dist/cjs/{ADInfeed-388ec28a.js → ADInfeed-9735aff2.js} +0 -0
  147. /package/dist/cjs/{ADlgInfeed-5548ff47.js → ADlgInfeed-6bd11848.js} +0 -0
  148. /package/dist/esm/{ADInfeed-eae0af19.js → ADInfeed-9140aa7d.js} +0 -0
  149. /package/dist/esm/{ADlgInfeed-2f4c7a7c.js → ADlgInfeed-7656ecd1.js} +0 -0
@@ -1,443 +0,0 @@
1
- import { c as createCommonjsModule, u as unwrapExports, a as commonjsGlobal } from './_commonjsHelpers-0c4b6f40.js';
2
- import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-7c654f36.js';
3
- import { c as cookie } from './index-db3bb315.js';
4
- import getQuery from './getQuery.js';
5
-
6
- var defaultParseOptions = {
7
- decodeValues: true,
8
- map: false,
9
- silent: false,
10
- };
11
-
12
- function isNonEmptyString(str) {
13
- return typeof str === "string" && !!str.trim();
14
- }
15
-
16
- function parseString(setCookieValue, options) {
17
- var parts = setCookieValue.split(";").filter(isNonEmptyString);
18
- var nameValue = parts.shift().split("=");
19
- var name = nameValue.shift();
20
- var value = nameValue.join("="); // everything after the first =, joined by a "=" if there was more than one part
21
-
22
- options = options
23
- ? Object.assign({}, defaultParseOptions, options)
24
- : defaultParseOptions;
25
-
26
- var cookie = {
27
- name: name, // grab everything before the first =
28
- value: options.decodeValues ? decodeURIComponent(value) : value, // decode cookie value
29
- };
30
-
31
- parts.forEach(function (part) {
32
- var sides = part.split("=");
33
- var key = sides.shift().trimLeft().toLowerCase();
34
- var value = sides.join("=");
35
- if (key === "expires") {
36
- cookie.expires = new Date(value);
37
- } else if (key === "max-age") {
38
- cookie.maxAge = parseInt(value, 10);
39
- } else if (key === "secure") {
40
- cookie.secure = true;
41
- } else if (key === "httponly") {
42
- cookie.httpOnly = true;
43
- } else if (key === "samesite") {
44
- cookie.sameSite = value;
45
- } else {
46
- cookie[key] = value;
47
- }
48
- });
49
-
50
- return cookie;
51
- }
52
-
53
- function parse(input, options) {
54
- options = options
55
- ? Object.assign({}, defaultParseOptions, options)
56
- : defaultParseOptions;
57
-
58
- if (!input) {
59
- if (!options.map) {
60
- return [];
61
- } else {
62
- return {};
63
- }
64
- }
65
-
66
- if (input.headers && input.headers["set-cookie"]) {
67
- // fast-path for node.js (which automatically normalizes header names to lower-case
68
- input = input.headers["set-cookie"];
69
- } else if (input.headers) {
70
- // slow-path for other environments - see #25
71
- var sch =
72
- input.headers[
73
- Object.keys(input.headers).find(function (key) {
74
- return key.toLowerCase() === "set-cookie";
75
- })
76
- ];
77
- // warn if called on a request-like object with a cookie header rather than a set-cookie header - see #34, 36
78
- if (!sch && input.headers.cookie && !options.silent) {
79
- console.warn(
80
- "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."
81
- );
82
- }
83
- input = sch;
84
- }
85
- if (!Array.isArray(input)) {
86
- input = [input];
87
- }
88
-
89
- options = options
90
- ? Object.assign({}, defaultParseOptions, options)
91
- : defaultParseOptions;
92
-
93
- if (!options.map) {
94
- return input.filter(isNonEmptyString).map(function (str) {
95
- return parseString(str, options);
96
- });
97
- } else {
98
- var cookies = {};
99
- return input.filter(isNonEmptyString).reduce(function (cookies, str) {
100
- var cookie = parseString(str, options);
101
- cookies[cookie.name] = cookie;
102
- return cookies;
103
- }, cookies);
104
- }
105
- }
106
-
107
- /*
108
- Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas
109
- that are within a single set-cookie field-value, such as in the Expires portion.
110
-
111
- This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2
112
- Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128
113
- React Native's fetch does this for *every* header, including set-cookie.
114
-
115
- Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25
116
- Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation
117
- */
118
- function splitCookiesString(cookiesString) {
119
- if (Array.isArray(cookiesString)) {
120
- return cookiesString;
121
- }
122
- if (typeof cookiesString !== "string") {
123
- return [];
124
- }
125
-
126
- var cookiesStrings = [];
127
- var pos = 0;
128
- var start;
129
- var ch;
130
- var lastComma;
131
- var nextStart;
132
- var cookiesSeparatorFound;
133
-
134
- function skipWhitespace() {
135
- while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
136
- pos += 1;
137
- }
138
- return pos < cookiesString.length;
139
- }
140
-
141
- function notSpecialChar() {
142
- ch = cookiesString.charAt(pos);
143
-
144
- return ch !== "=" && ch !== ";" && ch !== ",";
145
- }
146
-
147
- while (pos < cookiesString.length) {
148
- start = pos;
149
- cookiesSeparatorFound = false;
150
-
151
- while (skipWhitespace()) {
152
- ch = cookiesString.charAt(pos);
153
- if (ch === ",") {
154
- // ',' is a cookie separator if we have later first '=', not ';' or ','
155
- lastComma = pos;
156
- pos += 1;
157
-
158
- skipWhitespace();
159
- nextStart = pos;
160
-
161
- while (pos < cookiesString.length && notSpecialChar()) {
162
- pos += 1;
163
- }
164
-
165
- // currently special character
166
- if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
167
- // we found cookies separator
168
- cookiesSeparatorFound = true;
169
- // pos is inside the next cookie, so back up and return it.
170
- pos = nextStart;
171
- cookiesStrings.push(cookiesString.substring(start, lastComma));
172
- start = pos;
173
- } else {
174
- // in param ',' or param separator ';',
175
- // we continue from that comma
176
- pos = lastComma + 1;
177
- }
178
- } else {
179
- pos += 1;
180
- }
181
- }
182
-
183
- if (!cookiesSeparatorFound || pos >= cookiesString.length) {
184
- cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
185
- }
186
- }
187
-
188
- return cookiesStrings;
189
- }
190
-
191
- var setCookie = parse;
192
- var parse_1 = parse;
193
- var parseString_1 = parseString;
194
- var splitCookiesString_1 = splitCookiesString;
195
- setCookie.parse = parse_1;
196
- setCookie.parseString = parseString_1;
197
- setCookie.splitCookiesString = splitCookiesString_1;
198
-
199
- var dist = createCommonjsModule(function (module, exports) {
200
- var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
201
- __assign = Object.assign || function(t) {
202
- for (var s, i = 1, n = arguments.length; i < n; i++) {
203
- s = arguments[i];
204
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
205
- t[p] = s[p];
206
- }
207
- return t;
208
- };
209
- return __assign.apply(this, arguments);
210
- };
211
- Object.defineProperty(exports, "__esModule", { value: true });
212
- exports.destroyCookie = exports.setCookie = exports.parseCookies = void 0;
213
-
214
-
215
- var isBrowser = function () { return typeof window !== 'undefined'; };
216
- function hasSameProperties(a, b) {
217
- var aProps = Object.getOwnPropertyNames(a);
218
- var bProps = Object.getOwnPropertyNames(b);
219
- if (aProps.length !== bProps.length) {
220
- return false;
221
- }
222
- for (var i = 0; i < aProps.length; i++) {
223
- var propName = aProps[i];
224
- if (a[propName] !== b[propName]) {
225
- return false;
226
- }
227
- }
228
- return true;
229
- }
230
- /**
231
- * Compare the cookie and return true if the cookies has equivalent
232
- * options and the cookies would be overwritten in the browser storage.
233
- *
234
- * @param a first Cookie for comparison
235
- * @param b second Cookie for comparison
236
- */
237
- function areCookiesEqual(a, b) {
238
- var sameSiteSame = a.sameSite === b.sameSite;
239
- if (typeof a.sameSite === 'string' && typeof b.sameSite === 'string') {
240
- sameSiteSame = a.sameSite.toLowerCase() === b.sameSite.toLowerCase();
241
- }
242
- return (hasSameProperties(__assign(__assign({}, a), { sameSite: undefined }), __assign(__assign({}, b), { sameSite: undefined })) && sameSiteSame);
243
- }
244
- /**
245
- * Create an instance of the Cookie interface
246
- *
247
- * @param name name of the Cookie
248
- * @param value value of the Cookie
249
- * @param options Cookie options
250
- */
251
- function createCookie(name, value, options) {
252
- var sameSite = options.sameSite;
253
- if (sameSite === true) {
254
- sameSite = 'strict';
255
- }
256
- if (sameSite === undefined || sameSite === false) {
257
- sameSite = 'lax';
258
- }
259
- var cookieToSet = __assign(__assign({}, options), { sameSite: sameSite });
260
- delete cookieToSet.encode;
261
- return __assign({ name: name, value: value }, cookieToSet);
262
- }
263
- /**
264
- *
265
- * Parses cookies.
266
- *
267
- * @param ctx
268
- * @param options
269
- */
270
- function parseCookies(ctx, options) {
271
- if (ctx && ctx.req && ctx.req.headers && ctx.req.headers.cookie) {
272
- return cookie.parse(ctx.req.headers.cookie, options);
273
- }
274
- if (isBrowser()) {
275
- return cookie.parse(document.cookie, options);
276
- }
277
- return {};
278
- }
279
- exports.parseCookies = parseCookies;
280
- /**
281
- *
282
- * Sets a cookie.
283
- *
284
- * @param ctx
285
- * @param name
286
- * @param value
287
- * @param options
288
- */
289
- function setCookie$1(ctx, name, value, options) {
290
- if (ctx && ctx.res && ctx.res.getHeader && ctx.res.setHeader) {
291
- var cookies = ctx.res.getHeader('Set-Cookie') || [];
292
- if (typeof cookies === 'string')
293
- cookies = [cookies];
294
- if (typeof cookies === 'number')
295
- cookies = [];
296
- var parsedCookies = setCookie.parse(cookies);
297
- var cookiesToSet_1 = [];
298
- parsedCookies.forEach(function (parsedCookie) {
299
- if (!areCookiesEqual(parsedCookie, createCookie(name, value, options))) {
300
- cookiesToSet_1.push(cookie.serialize(parsedCookie.name, parsedCookie.value, __assign({}, parsedCookie)));
301
- }
302
- });
303
- cookiesToSet_1.push(cookie.serialize(name, value, options));
304
- if (!ctx.res.finished) {
305
- ctx.res.setHeader('Set-Cookie', cookiesToSet_1);
306
- }
307
- }
308
- if (isBrowser()) {
309
- if (options && options.httpOnly) {
310
- throw new Error('Can not set a httpOnly cookie in the browser.');
311
- }
312
- document.cookie = cookie.serialize(name, value, options);
313
- }
314
- return {};
315
- }
316
- exports.setCookie = setCookie$1;
317
- /**
318
- *
319
- * Destroys a cookie with a particular name.
320
- *
321
- * @param ctx
322
- * @param name
323
- * @param options
324
- */
325
- function destroyCookie(ctx, name, options) {
326
- var opts = __assign(__assign({}, (options || {})), { maxAge: -1 });
327
- if (ctx && ctx.res && ctx.res.setHeader && ctx.res.getHeader) {
328
- var cookies = ctx.res.getHeader('Set-Cookie') || [];
329
- if (typeof cookies === 'string')
330
- cookies = [cookies];
331
- if (typeof cookies === 'number')
332
- cookies = [];
333
- cookies.push(cookie.serialize(name, '', opts));
334
- ctx.res.setHeader('Set-Cookie', cookies);
335
- }
336
- if (isBrowser()) {
337
- document.cookie = cookie.serialize(name, '', opts);
338
- }
339
- return {};
340
- }
341
- exports.destroyCookie = destroyCookie;
342
- exports.default = {
343
- set: setCookie$1,
344
- get: parseCookies,
345
- destroy: destroyCookie,
346
- };
347
-
348
- });
349
-
350
- unwrapExports(dist);
351
- var dist_1 = dist.destroyCookie;
352
- var dist_2 = dist.setCookie;
353
- var dist_3 = dist.parseCookies;
354
-
355
- var _this = undefined;
356
-
357
- var getRelatedArticle = function () {
358
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
359
- var ctx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
360
- var client = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
361
- var article = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
362
- var prevUrl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '/';
363
- var articleCount = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
364
-
365
- var taxonomyMapping, _article$url, url, content_placement, taxonomy, params, conditions, cookies, prevSlugs, relatedArticleQuery, relatedArticle;
366
-
367
- return regenerator.wrap(function _callee$(_context) {
368
- while (1) {
369
- switch (_context.prev = _context.next) {
370
- case 0:
371
- taxonomyMapping = article.taxonomyMapping, _article$url = article.url;
372
- _article$url = _article$url === undefined ? {
373
- current: null
374
- } : _article$url;
375
- url = _article$url.current, content_placement = article.content_placement;
376
- taxonomy = [];
377
- //404 articles were throwing server error
378
-
379
- if (content_placement) {
380
- content_placement.forEach(function (_ref3) {
381
- var path = _ref3.path,
382
- _id = _ref3._id;
383
-
384
- if (!_id || typeof _id == 'undefined') {
385
- return null;
386
- }
387
- var prev_url_to_check = prevUrl;
388
- if (prev_url_to_check.includes('?')) {
389
- prev_url_to_check = prev_url_to_check.split('?')[0];
390
- }
391
- if (prev_url_to_check.endsWith(path) && _id) taxonomy.push(_id);
392
- });
393
- }
394
-
395
- //404 articles were throwing server error
396
- if (taxonomy.length === 0 && taxonomyMapping) {
397
- taxonomyMapping.forEach(function (_ref4) {
398
- var _ref = _ref4._ref;
399
-
400
- if (_ref) {
401
- taxonomy.push(_ref);
402
- }
403
- });
404
- }
405
-
406
- params = {
407
- url: url,
408
- taxonomy: taxonomy,
409
- index: articleCount
410
- };
411
- conditions = '';
412
-
413
- if (ctx && url) {
414
- cookies = dist_3(ctx);
415
- prevSlugs = cookies['prevSlugs'];
416
-
417
- if (!!prevSlugs) {
418
- dist_2(ctx, 'prevSlugs', prevSlugs + ',"' + url + '"', {});
419
- conditions = '&& !(url.current in [' + prevSlugs + '])';
420
- } else dist_2(ctx, 'prevSlugs', '"' + url + '"', {});
421
- }
422
- relatedArticleQuery = getQuery('related', conditions, '', articleCount);
423
- _context.next = 12;
424
- return client.fetch(relatedArticleQuery, params);
425
-
426
- case 12:
427
- relatedArticle = _context.sent;
428
- return _context.abrupt('return', relatedArticle);
429
-
430
- case 14:
431
- case 'end':
432
- return _context.stop();
433
- }
434
- }
435
- }, _callee, _this);
436
- }));
437
-
438
- return function getRelatedArticle() {
439
- return _ref2.apply(this, arguments);
440
- };
441
- }();
442
-
443
- export { dist_2 as a, dist_3 as d, getRelatedArticle as g };
@@ -1,207 +0,0 @@
1
- /*!
2
- * cookie
3
- * Copyright(c) 2012-2014 Roman Shtylman
4
- * Copyright(c) 2015 Douglas Christopher Wilson
5
- * MIT Licensed
6
- */
7
-
8
- /**
9
- * Module exports.
10
- * @public
11
- */
12
-
13
- var parse_1 = parse;
14
- var serialize_1 = serialize;
15
-
16
- /**
17
- * Module variables.
18
- * @private
19
- */
20
-
21
- var decode = decodeURIComponent;
22
- var encode = encodeURIComponent;
23
- var pairSplitRegExp = /; */;
24
-
25
- /**
26
- * RegExp to match field-content in RFC 7230 sec 3.2
27
- *
28
- * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
29
- * field-vchar = VCHAR / obs-text
30
- * obs-text = %x80-FF
31
- */
32
-
33
- var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
34
-
35
- /**
36
- * Parse a cookie header.
37
- *
38
- * Parse the given cookie header string into an object
39
- * The object has the various cookies as keys(names) => values
40
- *
41
- * @param {string} str
42
- * @param {object} [options]
43
- * @return {object}
44
- * @public
45
- */
46
-
47
- function parse(str, options) {
48
- if (typeof str !== 'string') {
49
- throw new TypeError('argument str must be a string');
50
- }
51
-
52
- var obj = {};
53
- var opt = options || {};
54
- var pairs = str.split(pairSplitRegExp);
55
- var dec = opt.decode || decode;
56
-
57
- for (var i = 0; i < pairs.length; i++) {
58
- var pair = pairs[i];
59
- var eq_idx = pair.indexOf('=');
60
-
61
- // skip things that don't look like key=value
62
- if (eq_idx < 0) {
63
- continue;
64
- }
65
-
66
- var key = pair.substr(0, eq_idx).trim();
67
- var val = pair.substr(++eq_idx, pair.length).trim();
68
-
69
- // quoted values
70
- if ('"' == val[0]) {
71
- val = val.slice(1, -1);
72
- }
73
-
74
- // only assign once
75
- if (undefined == obj[key]) {
76
- obj[key] = tryDecode(val, dec);
77
- }
78
- }
79
-
80
- return obj;
81
- }
82
-
83
- /**
84
- * Serialize data into a cookie header.
85
- *
86
- * Serialize the a name value pair into a cookie string suitable for
87
- * http headers. An optional options object specified cookie parameters.
88
- *
89
- * serialize('foo', 'bar', { httpOnly: true })
90
- * => "foo=bar; httpOnly"
91
- *
92
- * @param {string} name
93
- * @param {string} val
94
- * @param {object} [options]
95
- * @return {string}
96
- * @public
97
- */
98
-
99
- function serialize(name, val, options) {
100
- var opt = options || {};
101
- var enc = opt.encode || encode;
102
-
103
- if (typeof enc !== 'function') {
104
- throw new TypeError('option encode is invalid');
105
- }
106
-
107
- if (!fieldContentRegExp.test(name)) {
108
- throw new TypeError('argument name is invalid');
109
- }
110
-
111
- var value = enc(val);
112
-
113
- if (value && !fieldContentRegExp.test(value)) {
114
- throw new TypeError('argument val is invalid');
115
- }
116
-
117
- var str = name + '=' + value;
118
-
119
- if (null != opt.maxAge) {
120
- var maxAge = opt.maxAge - 0;
121
-
122
- if (isNaN(maxAge) || !isFinite(maxAge)) {
123
- throw new TypeError('option maxAge is invalid')
124
- }
125
-
126
- str += '; Max-Age=' + Math.floor(maxAge);
127
- }
128
-
129
- if (opt.domain) {
130
- if (!fieldContentRegExp.test(opt.domain)) {
131
- throw new TypeError('option domain is invalid');
132
- }
133
-
134
- str += '; Domain=' + opt.domain;
135
- }
136
-
137
- if (opt.path) {
138
- if (!fieldContentRegExp.test(opt.path)) {
139
- throw new TypeError('option path is invalid');
140
- }
141
-
142
- str += '; Path=' + opt.path;
143
- }
144
-
145
- if (opt.expires) {
146
- if (typeof opt.expires.toUTCString !== 'function') {
147
- throw new TypeError('option expires is invalid');
148
- }
149
-
150
- str += '; Expires=' + opt.expires.toUTCString();
151
- }
152
-
153
- if (opt.httpOnly) {
154
- str += '; HttpOnly';
155
- }
156
-
157
- if (opt.secure) {
158
- str += '; Secure';
159
- }
160
-
161
- if (opt.sameSite) {
162
- var sameSite = typeof opt.sameSite === 'string'
163
- ? opt.sameSite.toLowerCase() : opt.sameSite;
164
-
165
- switch (sameSite) {
166
- case true:
167
- str += '; SameSite=Strict';
168
- break;
169
- case 'lax':
170
- str += '; SameSite=Lax';
171
- break;
172
- case 'strict':
173
- str += '; SameSite=Strict';
174
- break;
175
- case 'none':
176
- str += '; SameSite=None';
177
- break;
178
- default:
179
- throw new TypeError('option sameSite is invalid');
180
- }
181
- }
182
-
183
- return str;
184
- }
185
-
186
- /**
187
- * Try decoding a string using a decoding function.
188
- *
189
- * @param {string} str
190
- * @param {function} decode
191
- * @private
192
- */
193
-
194
- function tryDecode(str, decode) {
195
- try {
196
- return decode(str);
197
- } catch (e) {
198
- return str;
199
- }
200
- }
201
-
202
- var cookie = {
203
- parse: parse_1,
204
- serialize: serialize_1
205
- };
206
-
207
- export { cookie as c, parse_1 as p, serialize_1 as s };