@mjhls/mjh-framework 1.0.795-beta.0 → 1.0.795-beta.1
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/README.md +1 -1
- package/dist/cjs/ArticleProgramLandingPage.js +1 -1
- package/dist/cjs/Auth.js +7 -7
- package/dist/cjs/ExternalResources.js +1 -1
- package/dist/cjs/HorizontalArticleListing.js +1 -1
- package/dist/cjs/MediaSeriesLanding.js +1 -1
- package/dist/cjs/PartnerDetailListing.js +1 -1
- package/dist/cjs/TaxonomyDescription.js +1 -1
- package/dist/cjs/VideoProgramLandingPage.js +1 -1
- package/dist/cjs/View.js +3 -3
- package/dist/cjs/getRelatedArticle.js +354 -5
- package/dist/cjs/getSerializers.js +1 -1
- package/dist/cjs/index-bd6c9f56.js +211 -0
- package/dist/cjs/{index-cfd1f8c2.js → index-f05824b5.js} +1 -1
- package/dist/cjs/index.js +4 -5
- package/dist/esm/ArticleProgramLandingPage.js +1 -1
- package/dist/esm/Auth.js +6 -6
- package/dist/esm/ExternalResources.js +1 -1
- package/dist/esm/HorizontalArticleListing.js +1 -1
- package/dist/esm/MediaSeriesLanding.js +1 -1
- package/dist/esm/PartnerDetailListing.js +1 -1
- package/dist/esm/TaxonomyDescription.js +1 -1
- package/dist/esm/VideoProgramLandingPage.js +1 -1
- package/dist/esm/View.js +3 -3
- package/dist/esm/getRelatedArticle.js +354 -5
- package/dist/esm/getSerializers.js +1 -1
- package/dist/esm/{index-85f89e4d.js → index-41b5c632.js} +1 -1
- package/dist/esm/index-db3bb315.js +207 -0
- package/dist/esm/index.js +3 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
# mjh-framework v. 1.0.795
|
|
2
|
+
# mjh-framework v. 1.0.795-srcset
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/mjh-framework) [](https://standardjs.com)
|
|
@@ -51,7 +51,7 @@ require('react-bootstrap');
|
|
|
51
51
|
require('./iconBase-68959171.js');
|
|
52
52
|
require('./index.esm-90433435.js');
|
|
53
53
|
var ArticleSeriesListing = require('./ArticleSeriesListing.js');
|
|
54
|
-
var getSerializers = require('./index-
|
|
54
|
+
var getSerializers = require('./index-f05824b5.js');
|
|
55
55
|
require('./util-f2c1b65b.js');
|
|
56
56
|
require('./brightcove-react-player-loader.es-156bd4d6.js');
|
|
57
57
|
require('next/head');
|
package/dist/cjs/Auth.js
CHANGED
|
@@ -22,8 +22,8 @@ var stringify = require('./stringify-7c5aff47.js');
|
|
|
22
22
|
var asyncToGenerator = require('./asyncToGenerator-140e5f89.js');
|
|
23
23
|
var reactBootstrap = require('react-bootstrap');
|
|
24
24
|
var util = require('./util-f2c1b65b.js');
|
|
25
|
+
var index$5 = require('./index-bd6c9f56.js');
|
|
25
26
|
var useSWR = _interopDefault(require('swr'));
|
|
26
|
-
var cookie = require('cookie');
|
|
27
27
|
var Local = _interopDefault(require('passport-local'));
|
|
28
28
|
var mysql = _interopDefault(require('mysql'));
|
|
29
29
|
|
|
@@ -1215,7 +1215,7 @@ var MAX_AGE = 60 * 60 * 8; // 8 hours
|
|
|
1215
1215
|
|
|
1216
1216
|
function setTokenCookie(res, token, eKey) {
|
|
1217
1217
|
var cookies_serailized = [];
|
|
1218
|
-
cookies_serailized.push(
|
|
1218
|
+
cookies_serailized.push(index$5.serialize_1(TOKEN_NAME, token, {
|
|
1219
1219
|
//maxAge: MAX_AGE, // we want login cookie to expire when browser
|
|
1220
1220
|
//expires: new Date(Date.now() + MAX_AGE * 1000),
|
|
1221
1221
|
//httpOnly: true,
|
|
@@ -1224,7 +1224,7 @@ function setTokenCookie(res, token, eKey) {
|
|
|
1224
1224
|
//sameSite: 'lax',
|
|
1225
1225
|
}));
|
|
1226
1226
|
|
|
1227
|
-
cookies_serailized.push(
|
|
1227
|
+
cookies_serailized.push(index$5.serialize_1('eKey', eKey, {
|
|
1228
1228
|
//maxAge: MAX_AGE, // we want login cookie to expire when browser
|
|
1229
1229
|
//expires: new Date(Date.now() + MAX_AGE * 1000),
|
|
1230
1230
|
//httpOnly: true,
|
|
@@ -1238,12 +1238,12 @@ function setTokenCookie(res, token, eKey) {
|
|
|
1238
1238
|
|
|
1239
1239
|
function removeTokenCookie(res) {
|
|
1240
1240
|
var cookies_serailized = [];
|
|
1241
|
-
cookies_serailized.push(
|
|
1241
|
+
cookies_serailized.push(index$5.serialize_1(TOKEN_NAME, '', {
|
|
1242
1242
|
maxAge: -1,
|
|
1243
1243
|
expires: new Date(Date.now() - MAX_AGE * 1000),
|
|
1244
1244
|
path: '/'
|
|
1245
1245
|
}));
|
|
1246
|
-
cookies_serailized.push(
|
|
1246
|
+
cookies_serailized.push(index$5.serialize_1('eKey', '', {
|
|
1247
1247
|
maxAge: -1,
|
|
1248
1248
|
expires: new Date(Date.now() - MAX_AGE * 1000),
|
|
1249
1249
|
path: '/'
|
|
@@ -1257,8 +1257,8 @@ function parseCookies(req) {
|
|
|
1257
1257
|
if (req.cookies) return req.cookies;
|
|
1258
1258
|
|
|
1259
1259
|
// For pages we do need to parse the cookies.
|
|
1260
|
-
var cookie
|
|
1261
|
-
return
|
|
1260
|
+
var cookie = req.headers ? req.headers.cookie : null;
|
|
1261
|
+
return index$5.parse_1(cookie || '');
|
|
1262
1262
|
}
|
|
1263
1263
|
|
|
1264
1264
|
function getTokenCookie(req) {
|
|
@@ -47,7 +47,7 @@ require('./GroupDeck.js');
|
|
|
47
47
|
require('react-bootstrap');
|
|
48
48
|
require('./iconBase-68959171.js');
|
|
49
49
|
require('./index.esm-90433435.js');
|
|
50
|
-
var getSerializers = require('./index-
|
|
50
|
+
var getSerializers = require('./index-f05824b5.js');
|
|
51
51
|
require('./util-f2c1b65b.js');
|
|
52
52
|
require('./brightcove-react-player-loader.es-156bd4d6.js');
|
|
53
53
|
require('next/head');
|
|
@@ -48,7 +48,7 @@ require('react-bootstrap');
|
|
|
48
48
|
require('./iconBase-68959171.js');
|
|
49
49
|
var index_esm = require('./index.esm-90433435.js');
|
|
50
50
|
var ArticleCarousel = require('./ArticleCarousel.js');
|
|
51
|
-
var getSerializers = require('./index-
|
|
51
|
+
var getSerializers = require('./index-f05824b5.js');
|
|
52
52
|
require('./util-f2c1b65b.js');
|
|
53
53
|
require('./brightcove-react-player-loader.es-156bd4d6.js');
|
|
54
54
|
require('next/head');
|
|
@@ -54,7 +54,7 @@ require('./GroupDeck.js');
|
|
|
54
54
|
require('react-bootstrap');
|
|
55
55
|
require('./iconBase-68959171.js');
|
|
56
56
|
require('./index.esm-90433435.js');
|
|
57
|
-
var getSerializers = require('./index-
|
|
57
|
+
var getSerializers = require('./index-f05824b5.js');
|
|
58
58
|
require('./util-f2c1b65b.js');
|
|
59
59
|
require('./brightcove-react-player-loader.es-156bd4d6.js');
|
|
60
60
|
require('next/head');
|
|
@@ -56,7 +56,7 @@ require('./timeDifferenceCalc.js');
|
|
|
56
56
|
var QueueDeckExpanded = require('./QueueDeckExpanded.js');
|
|
57
57
|
require('./iconBase-68959171.js');
|
|
58
58
|
require('./index.esm-90433435.js');
|
|
59
|
-
var getSerializers = require('./index-
|
|
59
|
+
var getSerializers = require('./index-f05824b5.js');
|
|
60
60
|
require('./util-f2c1b65b.js');
|
|
61
61
|
require('./brightcove-react-player-loader.es-156bd4d6.js');
|
|
62
62
|
require('next/head');
|
|
@@ -47,7 +47,7 @@ require('./GroupDeck.js');
|
|
|
47
47
|
require('react-bootstrap');
|
|
48
48
|
require('./iconBase-68959171.js');
|
|
49
49
|
require('./index.esm-90433435.js');
|
|
50
|
-
var getSerializers = require('./index-
|
|
50
|
+
var getSerializers = require('./index-f05824b5.js');
|
|
51
51
|
require('./util-f2c1b65b.js');
|
|
52
52
|
require('./brightcove-react-player-loader.es-156bd4d6.js');
|
|
53
53
|
var Head = _interopDefault(require('next/head'));
|
|
@@ -51,7 +51,7 @@ require('react-bootstrap');
|
|
|
51
51
|
require('./iconBase-68959171.js');
|
|
52
52
|
require('./index.esm-90433435.js');
|
|
53
53
|
var VideoSeriesListing = require('./VideoSeriesListing.js');
|
|
54
|
-
var getSerializers = require('./index-
|
|
54
|
+
var getSerializers = require('./index-f05824b5.js');
|
|
55
55
|
require('./util-f2c1b65b.js');
|
|
56
56
|
require('./brightcove-react-player-loader.es-156bd4d6.js');
|
|
57
57
|
require('next/head');
|
package/dist/cjs/View.js
CHANGED
|
@@ -49,7 +49,7 @@ require('./GroupDeck.js');
|
|
|
49
49
|
require('react-bootstrap');
|
|
50
50
|
require('./iconBase-68959171.js');
|
|
51
51
|
require('./index.esm-90433435.js');
|
|
52
|
-
var getSerializers = require('./index-
|
|
52
|
+
var getSerializers = require('./index-f05824b5.js');
|
|
53
53
|
require('./util-f2c1b65b.js');
|
|
54
54
|
require('./brightcove-react-player-loader.es-156bd4d6.js');
|
|
55
55
|
var Head = _interopDefault(require('next/head'));
|
|
@@ -65,9 +65,9 @@ var keys = require('./keys-a586b7a0.js');
|
|
|
65
65
|
require('react-bootstrap/Dropdown');
|
|
66
66
|
var index_esm$3 = require('./index.esm-ff47db6f.js');
|
|
67
67
|
var getSeriesDetail = require('./getSeriesDetail.js');
|
|
68
|
-
require('
|
|
69
|
-
var getQuery = require('./getQuery.js');
|
|
68
|
+
require('./index-bd6c9f56.js');
|
|
70
69
|
var getRelatedArticle = require('./getRelatedArticle.js');
|
|
70
|
+
var getQuery = require('./getQuery.js');
|
|
71
71
|
var SeriesSlider = require('./SeriesSlider-4abb21b4.js');
|
|
72
72
|
var getTargeting = require('./getTargeting-021d644c.js');
|
|
73
73
|
var getKeywords = require('./getKeywords.js');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
require('./_commonjsHelpers-06173234.js');
|
|
3
|
+
var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
|
|
4
4
|
require('./_to-object-329a650b.js');
|
|
5
5
|
require('./es6.string.iterator-cc0bbaa4.js');
|
|
6
6
|
require('./_library-dd23b178.js');
|
|
@@ -8,9 +8,358 @@ require('./_iter-detect-60b2f026.js');
|
|
|
8
8
|
require('./core.get-iterator-method-f62321d4.js');
|
|
9
9
|
require('./web.dom.iterable-a0e279c1.js');
|
|
10
10
|
var asyncToGenerator = require('./asyncToGenerator-140e5f89.js');
|
|
11
|
-
var
|
|
11
|
+
var index$5 = require('./index-bd6c9f56.js');
|
|
12
12
|
var getQuery = require('./getQuery.js');
|
|
13
13
|
|
|
14
|
+
var defaultParseOptions = {
|
|
15
|
+
decodeValues: true,
|
|
16
|
+
map: false,
|
|
17
|
+
silent: false,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
function isNonEmptyString(str) {
|
|
21
|
+
return typeof str === "string" && !!str.trim();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function parseString(setCookieValue, options) {
|
|
25
|
+
var parts = setCookieValue.split(";").filter(isNonEmptyString);
|
|
26
|
+
var nameValue = parts.shift().split("=");
|
|
27
|
+
var name = nameValue.shift();
|
|
28
|
+
var value = nameValue.join("="); // everything after the first =, joined by a "=" if there was more than one part
|
|
29
|
+
|
|
30
|
+
options = options
|
|
31
|
+
? Object.assign({}, defaultParseOptions, options)
|
|
32
|
+
: defaultParseOptions;
|
|
33
|
+
|
|
34
|
+
var cookie = {
|
|
35
|
+
name: name, // grab everything before the first =
|
|
36
|
+
value: options.decodeValues ? decodeURIComponent(value) : value, // decode cookie value
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
parts.forEach(function (part) {
|
|
40
|
+
var sides = part.split("=");
|
|
41
|
+
var key = sides.shift().trimLeft().toLowerCase();
|
|
42
|
+
var value = sides.join("=");
|
|
43
|
+
if (key === "expires") {
|
|
44
|
+
cookie.expires = new Date(value);
|
|
45
|
+
} else if (key === "max-age") {
|
|
46
|
+
cookie.maxAge = parseInt(value, 10);
|
|
47
|
+
} else if (key === "secure") {
|
|
48
|
+
cookie.secure = true;
|
|
49
|
+
} else if (key === "httponly") {
|
|
50
|
+
cookie.httpOnly = true;
|
|
51
|
+
} else if (key === "samesite") {
|
|
52
|
+
cookie.sameSite = value;
|
|
53
|
+
} else {
|
|
54
|
+
cookie[key] = value;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
return cookie;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function parse(input, options) {
|
|
62
|
+
options = options
|
|
63
|
+
? Object.assign({}, defaultParseOptions, options)
|
|
64
|
+
: defaultParseOptions;
|
|
65
|
+
|
|
66
|
+
if (!input) {
|
|
67
|
+
if (!options.map) {
|
|
68
|
+
return [];
|
|
69
|
+
} else {
|
|
70
|
+
return {};
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (input.headers && input.headers["set-cookie"]) {
|
|
75
|
+
// fast-path for node.js (which automatically normalizes header names to lower-case
|
|
76
|
+
input = input.headers["set-cookie"];
|
|
77
|
+
} else if (input.headers) {
|
|
78
|
+
// slow-path for other environments - see #25
|
|
79
|
+
var sch =
|
|
80
|
+
input.headers[
|
|
81
|
+
Object.keys(input.headers).find(function (key) {
|
|
82
|
+
return key.toLowerCase() === "set-cookie";
|
|
83
|
+
})
|
|
84
|
+
];
|
|
85
|
+
// warn if called on a request-like object with a cookie header rather than a set-cookie header - see #34, 36
|
|
86
|
+
if (!sch && input.headers.cookie && !options.silent) {
|
|
87
|
+
console.warn(
|
|
88
|
+
"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."
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
input = sch;
|
|
92
|
+
}
|
|
93
|
+
if (!Array.isArray(input)) {
|
|
94
|
+
input = [input];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
options = options
|
|
98
|
+
? Object.assign({}, defaultParseOptions, options)
|
|
99
|
+
: defaultParseOptions;
|
|
100
|
+
|
|
101
|
+
if (!options.map) {
|
|
102
|
+
return input.filter(isNonEmptyString).map(function (str) {
|
|
103
|
+
return parseString(str, options);
|
|
104
|
+
});
|
|
105
|
+
} else {
|
|
106
|
+
var cookies = {};
|
|
107
|
+
return input.filter(isNonEmptyString).reduce(function (cookies, str) {
|
|
108
|
+
var cookie = parseString(str, options);
|
|
109
|
+
cookies[cookie.name] = cookie;
|
|
110
|
+
return cookies;
|
|
111
|
+
}, cookies);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/*
|
|
116
|
+
Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas
|
|
117
|
+
that are within a single set-cookie field-value, such as in the Expires portion.
|
|
118
|
+
|
|
119
|
+
This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2
|
|
120
|
+
Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128
|
|
121
|
+
React Native's fetch does this for *every* header, including set-cookie.
|
|
122
|
+
|
|
123
|
+
Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25
|
|
124
|
+
Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation
|
|
125
|
+
*/
|
|
126
|
+
function splitCookiesString(cookiesString) {
|
|
127
|
+
if (Array.isArray(cookiesString)) {
|
|
128
|
+
return cookiesString;
|
|
129
|
+
}
|
|
130
|
+
if (typeof cookiesString !== "string") {
|
|
131
|
+
return [];
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
var cookiesStrings = [];
|
|
135
|
+
var pos = 0;
|
|
136
|
+
var start;
|
|
137
|
+
var ch;
|
|
138
|
+
var lastComma;
|
|
139
|
+
var nextStart;
|
|
140
|
+
var cookiesSeparatorFound;
|
|
141
|
+
|
|
142
|
+
function skipWhitespace() {
|
|
143
|
+
while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
|
|
144
|
+
pos += 1;
|
|
145
|
+
}
|
|
146
|
+
return pos < cookiesString.length;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function notSpecialChar() {
|
|
150
|
+
ch = cookiesString.charAt(pos);
|
|
151
|
+
|
|
152
|
+
return ch !== "=" && ch !== ";" && ch !== ",";
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
while (pos < cookiesString.length) {
|
|
156
|
+
start = pos;
|
|
157
|
+
cookiesSeparatorFound = false;
|
|
158
|
+
|
|
159
|
+
while (skipWhitespace()) {
|
|
160
|
+
ch = cookiesString.charAt(pos);
|
|
161
|
+
if (ch === ",") {
|
|
162
|
+
// ',' is a cookie separator if we have later first '=', not ';' or ','
|
|
163
|
+
lastComma = pos;
|
|
164
|
+
pos += 1;
|
|
165
|
+
|
|
166
|
+
skipWhitespace();
|
|
167
|
+
nextStart = pos;
|
|
168
|
+
|
|
169
|
+
while (pos < cookiesString.length && notSpecialChar()) {
|
|
170
|
+
pos += 1;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// currently special character
|
|
174
|
+
if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
|
|
175
|
+
// we found cookies separator
|
|
176
|
+
cookiesSeparatorFound = true;
|
|
177
|
+
// pos is inside the next cookie, so back up and return it.
|
|
178
|
+
pos = nextStart;
|
|
179
|
+
cookiesStrings.push(cookiesString.substring(start, lastComma));
|
|
180
|
+
start = pos;
|
|
181
|
+
} else {
|
|
182
|
+
// in param ',' or param separator ';',
|
|
183
|
+
// we continue from that comma
|
|
184
|
+
pos = lastComma + 1;
|
|
185
|
+
}
|
|
186
|
+
} else {
|
|
187
|
+
pos += 1;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (!cookiesSeparatorFound || pos >= cookiesString.length) {
|
|
192
|
+
cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return cookiesStrings;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
var setCookie = parse;
|
|
200
|
+
var parse_1 = parse;
|
|
201
|
+
var parseString_1 = parseString;
|
|
202
|
+
var splitCookiesString_1 = splitCookiesString;
|
|
203
|
+
setCookie.parse = parse_1;
|
|
204
|
+
setCookie.parseString = parseString_1;
|
|
205
|
+
setCookie.splitCookiesString = splitCookiesString_1;
|
|
206
|
+
|
|
207
|
+
var dist = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
208
|
+
var __assign = (_commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.__assign) || function () {
|
|
209
|
+
__assign = Object.assign || function(t) {
|
|
210
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
211
|
+
s = arguments[i];
|
|
212
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
213
|
+
t[p] = s[p];
|
|
214
|
+
}
|
|
215
|
+
return t;
|
|
216
|
+
};
|
|
217
|
+
return __assign.apply(this, arguments);
|
|
218
|
+
};
|
|
219
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
220
|
+
exports.destroyCookie = exports.setCookie = exports.parseCookies = void 0;
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
var isBrowser = function () { return typeof window !== 'undefined'; };
|
|
224
|
+
function hasSameProperties(a, b) {
|
|
225
|
+
var aProps = Object.getOwnPropertyNames(a);
|
|
226
|
+
var bProps = Object.getOwnPropertyNames(b);
|
|
227
|
+
if (aProps.length !== bProps.length) {
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
for (var i = 0; i < aProps.length; i++) {
|
|
231
|
+
var propName = aProps[i];
|
|
232
|
+
if (a[propName] !== b[propName]) {
|
|
233
|
+
return false;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Compare the cookie and return true if the cookies has equivalent
|
|
240
|
+
* options and the cookies would be overwritten in the browser storage.
|
|
241
|
+
*
|
|
242
|
+
* @param a first Cookie for comparison
|
|
243
|
+
* @param b second Cookie for comparison
|
|
244
|
+
*/
|
|
245
|
+
function areCookiesEqual(a, b) {
|
|
246
|
+
var sameSiteSame = a.sameSite === b.sameSite;
|
|
247
|
+
if (typeof a.sameSite === 'string' && typeof b.sameSite === 'string') {
|
|
248
|
+
sameSiteSame = a.sameSite.toLowerCase() === b.sameSite.toLowerCase();
|
|
249
|
+
}
|
|
250
|
+
return (hasSameProperties(__assign(__assign({}, a), { sameSite: undefined }), __assign(__assign({}, b), { sameSite: undefined })) && sameSiteSame);
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Create an instance of the Cookie interface
|
|
254
|
+
*
|
|
255
|
+
* @param name name of the Cookie
|
|
256
|
+
* @param value value of the Cookie
|
|
257
|
+
* @param options Cookie options
|
|
258
|
+
*/
|
|
259
|
+
function createCookie(name, value, options) {
|
|
260
|
+
var sameSite = options.sameSite;
|
|
261
|
+
if (sameSite === true) {
|
|
262
|
+
sameSite = 'strict';
|
|
263
|
+
}
|
|
264
|
+
if (sameSite === undefined || sameSite === false) {
|
|
265
|
+
sameSite = 'lax';
|
|
266
|
+
}
|
|
267
|
+
var cookieToSet = __assign(__assign({}, options), { sameSite: sameSite });
|
|
268
|
+
delete cookieToSet.encode;
|
|
269
|
+
return __assign({ name: name, value: value }, cookieToSet);
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
*
|
|
273
|
+
* Parses cookies.
|
|
274
|
+
*
|
|
275
|
+
* @param ctx
|
|
276
|
+
* @param options
|
|
277
|
+
*/
|
|
278
|
+
function parseCookies(ctx, options) {
|
|
279
|
+
if (ctx && ctx.req && ctx.req.headers && ctx.req.headers.cookie) {
|
|
280
|
+
return index$5.cookie.parse(ctx.req.headers.cookie, options);
|
|
281
|
+
}
|
|
282
|
+
if (isBrowser()) {
|
|
283
|
+
return index$5.cookie.parse(document.cookie, options);
|
|
284
|
+
}
|
|
285
|
+
return {};
|
|
286
|
+
}
|
|
287
|
+
exports.parseCookies = parseCookies;
|
|
288
|
+
/**
|
|
289
|
+
*
|
|
290
|
+
* Sets a cookie.
|
|
291
|
+
*
|
|
292
|
+
* @param ctx
|
|
293
|
+
* @param name
|
|
294
|
+
* @param value
|
|
295
|
+
* @param options
|
|
296
|
+
*/
|
|
297
|
+
function setCookie$1(ctx, name, value, options) {
|
|
298
|
+
if (ctx && ctx.res && ctx.res.getHeader && ctx.res.setHeader) {
|
|
299
|
+
var cookies = ctx.res.getHeader('Set-Cookie') || [];
|
|
300
|
+
if (typeof cookies === 'string')
|
|
301
|
+
cookies = [cookies];
|
|
302
|
+
if (typeof cookies === 'number')
|
|
303
|
+
cookies = [];
|
|
304
|
+
var parsedCookies = setCookie.parse(cookies);
|
|
305
|
+
var cookiesToSet_1 = [];
|
|
306
|
+
parsedCookies.forEach(function (parsedCookie) {
|
|
307
|
+
if (!areCookiesEqual(parsedCookie, createCookie(name, value, options))) {
|
|
308
|
+
cookiesToSet_1.push(index$5.cookie.serialize(parsedCookie.name, parsedCookie.value, __assign({}, parsedCookie)));
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
cookiesToSet_1.push(index$5.cookie.serialize(name, value, options));
|
|
312
|
+
if (!ctx.res.finished) {
|
|
313
|
+
ctx.res.setHeader('Set-Cookie', cookiesToSet_1);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
if (isBrowser()) {
|
|
317
|
+
if (options && options.httpOnly) {
|
|
318
|
+
throw new Error('Can not set a httpOnly cookie in the browser.');
|
|
319
|
+
}
|
|
320
|
+
document.cookie = index$5.cookie.serialize(name, value, options);
|
|
321
|
+
}
|
|
322
|
+
return {};
|
|
323
|
+
}
|
|
324
|
+
exports.setCookie = setCookie$1;
|
|
325
|
+
/**
|
|
326
|
+
*
|
|
327
|
+
* Destroys a cookie with a particular name.
|
|
328
|
+
*
|
|
329
|
+
* @param ctx
|
|
330
|
+
* @param name
|
|
331
|
+
* @param options
|
|
332
|
+
*/
|
|
333
|
+
function destroyCookie(ctx, name, options) {
|
|
334
|
+
var opts = __assign(__assign({}, (options || {})), { maxAge: -1 });
|
|
335
|
+
if (ctx && ctx.res && ctx.res.setHeader && ctx.res.getHeader) {
|
|
336
|
+
var cookies = ctx.res.getHeader('Set-Cookie') || [];
|
|
337
|
+
if (typeof cookies === 'string')
|
|
338
|
+
cookies = [cookies];
|
|
339
|
+
if (typeof cookies === 'number')
|
|
340
|
+
cookies = [];
|
|
341
|
+
cookies.push(index$5.cookie.serialize(name, '', opts));
|
|
342
|
+
ctx.res.setHeader('Set-Cookie', cookies);
|
|
343
|
+
}
|
|
344
|
+
if (isBrowser()) {
|
|
345
|
+
document.cookie = index$5.cookie.serialize(name, '', opts);
|
|
346
|
+
}
|
|
347
|
+
return {};
|
|
348
|
+
}
|
|
349
|
+
exports.destroyCookie = destroyCookie;
|
|
350
|
+
exports.default = {
|
|
351
|
+
set: setCookie$1,
|
|
352
|
+
get: parseCookies,
|
|
353
|
+
destroy: destroyCookie,
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
_commonjsHelpers.unwrapExports(dist);
|
|
359
|
+
var dist_1 = dist.destroyCookie;
|
|
360
|
+
var dist_2 = dist.setCookie;
|
|
361
|
+
var dist_3 = dist.parseCookies;
|
|
362
|
+
|
|
14
363
|
var _this = undefined;
|
|
15
364
|
|
|
16
365
|
var getRelatedArticle = function () {
|
|
@@ -87,13 +436,13 @@ var getRelatedArticle = function () {
|
|
|
87
436
|
|
|
88
437
|
|
|
89
438
|
if (ctx && url) {
|
|
90
|
-
cookies =
|
|
439
|
+
cookies = dist_3(ctx);
|
|
91
440
|
prevSlugs = cookies['prevSlugs'];
|
|
92
441
|
|
|
93
442
|
if (!!prevSlugs) {
|
|
94
|
-
if (!prevSlugs.includes(url))
|
|
443
|
+
if (!prevSlugs.includes(url)) dist_2(ctx, 'prevSlugs', prevSlugs + ',"' + url + '"', {});
|
|
95
444
|
filters = filters + ' && !(url.current in [' + prevSlugs + '])';
|
|
96
|
-
} else
|
|
445
|
+
} else dist_2(ctx, 'prevSlugs', '"' + url + '"', {});
|
|
97
446
|
}
|
|
98
447
|
|
|
99
448
|
query = getQuery('related', filters, '', articleCount).replace('&& taxonomyMapping[]._ref in $taxonomy', '');
|
|
@@ -43,7 +43,7 @@ require('./GroupDeck.js');
|
|
|
43
43
|
require('react-bootstrap');
|
|
44
44
|
require('./iconBase-68959171.js');
|
|
45
45
|
require('./index.esm-90433435.js');
|
|
46
|
-
var getSerializers = require('./index-
|
|
46
|
+
var getSerializers = require('./index-f05824b5.js');
|
|
47
47
|
require('./util-f2c1b65b.js');
|
|
48
48
|
require('./brightcove-react-player-loader.es-156bd4d6.js');
|
|
49
49
|
require('next/head');
|