@zengenti/contensis-react-base 3.3.2-beta.1 → 4.0.0-beta.10
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/cjs/{App-B2ohFzUt.js → App-vZrUfVgQ.js} +7 -20
- package/cjs/{App-B2ohFzUt.js.map → App-vZrUfVgQ.js.map} +1 -1
- package/cjs/{ChangePassword.container-Dup9_na7.js → ChangePassword.container-ECjEXixF.js} +2 -2
- package/cjs/{ChangePassword.container-Dup9_na7.js.map → ChangePassword.container-ECjEXixF.js.map} +1 -1
- package/cjs/CookieHelper.class-C3Eqoze9.js +471 -0
- package/cjs/CookieHelper.class-C3Eqoze9.js.map +1 -0
- package/cjs/{RouteLoader-De-dhkg-.js → RouteLoader-D5Yg7EB5.js} +143 -44
- package/cjs/RouteLoader-D5Yg7EB5.js.map +1 -0
- package/cjs/{SSRContext-DpnwQ2te.js → SSRContext-DVj_QAC1.js} +23 -9
- package/cjs/SSRContext-DVj_QAC1.js.map +1 -0
- package/cjs/ToJs-C9jwV7YB.js.map +1 -1
- package/cjs/VersionInfo-B_dKCubg.js +204 -0
- package/cjs/VersionInfo-B_dKCubg.js.map +1 -0
- package/cjs/client.js +53 -20
- package/cjs/client.js.map +1 -1
- package/cjs/contensis-react-base.js +409 -134
- package/cjs/contensis-react-base.js.map +1 -1
- package/cjs/fromJSLeaveImmer-Blvlk4t2.js.map +1 -1
- package/cjs/redux.js +3 -3
- package/cjs/routing.js +8 -7
- package/cjs/routing.js.map +1 -1
- package/cjs/{sagas-Ekfrk7xA.js → sagas-BVX4Ps1e.js} +326 -130
- package/cjs/sagas-BVX4Ps1e.js.map +1 -0
- package/cjs/search.js +3 -194
- package/cjs/search.js.map +1 -1
- package/cjs/selectors-wCs5fHD4.js.map +1 -1
- package/cjs/{store-BihH67lI.js → store-D07FOXvM.js} +6 -9
- package/cjs/store-D07FOXvM.js.map +1 -0
- package/cjs/user.js +2 -2
- package/cjs/user.js.map +1 -1
- package/cjs/util.js +17 -182
- package/cjs/util.js.map +1 -1
- package/cjs/{version-Cg79mdPg.js → version-B7XFkBhY.js} +2 -2
- package/{esm/version-BnnERhzW.js.map → cjs/version-B7XFkBhY.js.map} +1 -1
- package/cjs/version-CM-bJ62L.js.map +1 -1
- package/esm/{App-BPsH6nHc.js → App-DLZweVSp.js} +10 -23
- package/esm/{App-BPsH6nHc.js.map → App-DLZweVSp.js.map} +1 -1
- package/esm/{ChangePassword.container-Bcpef423.js → ChangePassword.container-BgzIy8dA.js} +5 -5
- package/esm/{ChangePassword.container-Bcpef423.js.map → ChangePassword.container-BgzIy8dA.js.map} +1 -1
- package/esm/CookieHelper.class-FTURFpz3.js +464 -0
- package/esm/CookieHelper.class-FTURFpz3.js.map +1 -0
- package/esm/{RouteLoader-CipkGOgr.js → RouteLoader-xeQBXywk.js} +143 -49
- package/esm/RouteLoader-xeQBXywk.js.map +1 -0
- package/esm/{SSRContext-3TvaCDn0.js → SSRContext-BE8ElZ3X.js} +26 -12
- package/esm/SSRContext-BE8ElZ3X.js.map +1 -0
- package/esm/{ToJs-B4MH53fx.js → ToJs-CNzfvyxJ.js} +3 -3
- package/esm/{ToJs-B4MH53fx.js.map → ToJs-CNzfvyxJ.js.map} +1 -1
- package/esm/VersionInfo-Cno7K0OA.js +193 -0
- package/esm/VersionInfo-Cno7K0OA.js.map +1 -0
- package/esm/client.js +57 -25
- package/esm/client.js.map +1 -1
- package/esm/contensis-react-base.js +407 -132
- package/esm/contensis-react-base.js.map +1 -1
- package/esm/fromJSLeaveImmer-C_YACmOf.js.map +1 -1
- package/esm/redux.js +8 -8
- package/esm/routing.js +7 -9
- package/esm/routing.js.map +1 -1
- package/esm/{sagas-Cd05ZBBH.js → sagas-JI51CS37.js} +311 -115
- package/esm/sagas-JI51CS37.js.map +1 -0
- package/esm/search.js +21 -212
- package/esm/search.js.map +1 -1
- package/esm/{selectors-BRzliwbK.js → selectors-DO2ocdOp.js} +2 -2
- package/esm/selectors-DO2ocdOp.js.map +1 -0
- package/esm/{store-f0WxNWUu.js → store-3u0RzHZ0.js} +7 -9
- package/esm/store-3u0RzHZ0.js.map +1 -0
- package/esm/user.js +6 -6
- package/esm/user.js.map +1 -1
- package/esm/util.js +14 -177
- package/esm/util.js.map +1 -1
- package/esm/{version-BnnERhzW.js → version-BlsI7hX2.js} +3 -3
- package/{cjs/version-Cg79mdPg.js.map → esm/version-BlsI7hX2.js.map} +1 -1
- package/esm/{version-78jjDnHU.js → version-wnf-TITV.js} +2 -2
- package/esm/{version-78jjDnHU.js.map → version-wnf-TITV.js.map} +1 -1
- package/models/app/App.d.ts +2 -2
- package/models/app/pages/VersionInfo/components/VersionInfo.d.ts +7 -2
- package/models/models/AppState.d.ts +4 -5
- package/models/models/GetRouteActionArgs.d.ts +2 -2
- package/models/models/MatchedRoute.d.ts +4 -0
- package/models/models/SSRContext.d.ts +23 -0
- package/models/models/StaticRoute.d.ts +8 -4
- package/models/models/config/AppConfig.d.ts +1 -0
- package/models/models/config/ServerConfig.d.ts +1 -0
- package/models/models/config/StateType.d.ts +1 -0
- package/models/models/index.d.ts +1 -0
- package/models/redux/store/history.d.ts +2 -2
- package/models/redux/store/injectors.d.ts +4 -4
- package/models/redux/store/store.d.ts +1 -1
- package/models/routing/components/Redirect.d.ts +5 -0
- package/models/routing/components/RouteLoader.d.ts +2 -2
- package/models/routing/components/StaticRouteLoader.d.ts +6 -0
- package/models/routing/httpContext.d.ts +7 -0
- package/models/routing/index.d.ts +3 -0
- package/models/routing/redux/actions.d.ts +2 -3
- package/models/search/containers/withListing.d.ts +4 -1
- package/models/search/containers/withSearch.d.ts +4 -1
- package/models/server/features/response-handler/render-stream.d.ts +26 -0
- package/models/server/util/html.d.ts +23 -0
- package/models/server/util/jsx.d.ts +55 -0
- package/models/user/hocs/withRegistration.d.ts +6 -3
- package/models/util/ContensisDeliveryApi.d.ts +1 -2
- package/models/util/SSRContext.d.ts +17 -6
- package/models/util/mergeStaticRoutes.d.ts +1 -0
- package/package.json +25 -30
- package/cjs/CookieHelper.class-CxeVo9EP.js +0 -489
- package/cjs/CookieHelper.class-CxeVo9EP.js.map +0 -1
- package/cjs/RouteLoader-De-dhkg-.js.map +0 -1
- package/cjs/SSRContext-DpnwQ2te.js.map +0 -1
- package/cjs/forms.js +0 -5673
- package/cjs/forms.js.map +0 -1
- package/cjs/sagas-Ekfrk7xA.js.map +0 -1
- package/cjs/store-BihH67lI.js.map +0 -1
- package/cjs/urls-DVIwGZmd.js +0 -25
- package/cjs/urls-DVIwGZmd.js.map +0 -1
- package/esm/CookieHelper.class-W_NNNJKT.js +0 -482
- package/esm/CookieHelper.class-W_NNNJKT.js.map +0 -1
- package/esm/RouteLoader-CipkGOgr.js.map +0 -1
- package/esm/SSRContext-3TvaCDn0.js.map +0 -1
- package/esm/forms.js +0 -5661
- package/esm/forms.js.map +0 -1
- package/esm/sagas-Cd05ZBBH.js.map +0 -1
- package/esm/selectors-BRzliwbK.js.map +0 -1
- package/esm/store-f0WxNWUu.js.map +0 -1
- package/esm/urls-DfCisos-.js +0 -22
- package/esm/urls-DfCisos-.js.map +0 -1
- package/models/forms/index.d.ts +0 -1
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const BEARER_TOKEN_COOKIE = 'ContensisSecurityBearerToken';
|
|
4
|
+
const LOGIN_COOKIE = 'ContensisCMSUserName';
|
|
5
|
+
const REFRESH_TOKEN_COOKIE = 'RefreshToken';
|
|
6
|
+
const findLoginCookies = cookies => typeof cookies === 'object' ? Object.fromEntries(Object.entries(cookies).filter(([name]) => [LOGIN_COOKIE, REFRESH_TOKEN_COOKIE].includes(name))) : cookies;
|
|
7
|
+
|
|
8
|
+
var dist = {};
|
|
9
|
+
|
|
10
|
+
var hasRequiredDist;
|
|
11
|
+
|
|
12
|
+
function requireDist () {
|
|
13
|
+
if (hasRequiredDist) return dist;
|
|
14
|
+
hasRequiredDist = 1;
|
|
15
|
+
Object.defineProperty(dist, "__esModule", { value: true });
|
|
16
|
+
dist.parse = parse;
|
|
17
|
+
dist.serialize = serialize;
|
|
18
|
+
/**
|
|
19
|
+
* RegExp to match cookie-name in RFC 6265 sec 4.1.1
|
|
20
|
+
* This refers out to the obsoleted definition of token in RFC 2616 sec 2.2
|
|
21
|
+
* which has been replaced by the token definition in RFC 7230 appendix B.
|
|
22
|
+
*
|
|
23
|
+
* cookie-name = token
|
|
24
|
+
* token = 1*tchar
|
|
25
|
+
* tchar = "!" / "#" / "$" / "%" / "&" / "'" /
|
|
26
|
+
* "*" / "+" / "-" / "." / "^" / "_" /
|
|
27
|
+
* "`" / "|" / "~" / DIGIT / ALPHA
|
|
28
|
+
*
|
|
29
|
+
* Note: Allowing more characters - https://github.com/jshttp/cookie/issues/191
|
|
30
|
+
* Allow same range as cookie value, except `=`, which delimits end of name.
|
|
31
|
+
*/
|
|
32
|
+
const cookieNameRegExp = /^[\u0021-\u003A\u003C\u003E-\u007E]+$/;
|
|
33
|
+
/**
|
|
34
|
+
* RegExp to match cookie-value in RFC 6265 sec 4.1.1
|
|
35
|
+
*
|
|
36
|
+
* cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
|
|
37
|
+
* cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
|
|
38
|
+
* ; US-ASCII characters excluding CTLs,
|
|
39
|
+
* ; whitespace DQUOTE, comma, semicolon,
|
|
40
|
+
* ; and backslash
|
|
41
|
+
*
|
|
42
|
+
* Allowing more characters: https://github.com/jshttp/cookie/issues/191
|
|
43
|
+
* Comma, backslash, and DQUOTE are not part of the parsing algorithm.
|
|
44
|
+
*/
|
|
45
|
+
const cookieValueRegExp = /^[\u0021-\u003A\u003C-\u007E]*$/;
|
|
46
|
+
/**
|
|
47
|
+
* RegExp to match domain-value in RFC 6265 sec 4.1.1
|
|
48
|
+
*
|
|
49
|
+
* domain-value = <subdomain>
|
|
50
|
+
* ; defined in [RFC1034], Section 3.5, as
|
|
51
|
+
* ; enhanced by [RFC1123], Section 2.1
|
|
52
|
+
* <subdomain> = <label> | <subdomain> "." <label>
|
|
53
|
+
* <label> = <let-dig> [ [ <ldh-str> ] <let-dig> ]
|
|
54
|
+
* Labels must be 63 characters or less.
|
|
55
|
+
* 'let-dig' not 'letter' in the first char, per RFC1123
|
|
56
|
+
* <ldh-str> = <let-dig-hyp> | <let-dig-hyp> <ldh-str>
|
|
57
|
+
* <let-dig-hyp> = <let-dig> | "-"
|
|
58
|
+
* <let-dig> = <letter> | <digit>
|
|
59
|
+
* <letter> = any one of the 52 alphabetic characters A through Z in
|
|
60
|
+
* upper case and a through z in lower case
|
|
61
|
+
* <digit> = any one of the ten digits 0 through 9
|
|
62
|
+
*
|
|
63
|
+
* Keep support for leading dot: https://github.com/jshttp/cookie/issues/173
|
|
64
|
+
*
|
|
65
|
+
* > (Note that a leading %x2E ("."), if present, is ignored even though that
|
|
66
|
+
* character is not permitted, but a trailing %x2E ("."), if present, will
|
|
67
|
+
* cause the user agent to ignore the attribute.)
|
|
68
|
+
*/
|
|
69
|
+
const domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;
|
|
70
|
+
/**
|
|
71
|
+
* RegExp to match path-value in RFC 6265 sec 4.1.1
|
|
72
|
+
*
|
|
73
|
+
* path-value = <any CHAR except CTLs or ";">
|
|
74
|
+
* CHAR = %x01-7F
|
|
75
|
+
* ; defined in RFC 5234 appendix B.1
|
|
76
|
+
*/
|
|
77
|
+
const pathValueRegExp = /^[\u0020-\u003A\u003D-\u007E]*$/;
|
|
78
|
+
const __toString = Object.prototype.toString;
|
|
79
|
+
const NullObject = /* @__PURE__ */ (() => {
|
|
80
|
+
const C = function () { };
|
|
81
|
+
C.prototype = Object.create(null);
|
|
82
|
+
return C;
|
|
83
|
+
})();
|
|
84
|
+
/**
|
|
85
|
+
* Parse a cookie header.
|
|
86
|
+
*
|
|
87
|
+
* Parse the given cookie header string into an object
|
|
88
|
+
* The object has the various cookies as keys(names) => values
|
|
89
|
+
*/
|
|
90
|
+
function parse(str, options) {
|
|
91
|
+
const obj = new NullObject();
|
|
92
|
+
const len = str.length;
|
|
93
|
+
// RFC 6265 sec 4.1.1, RFC 2616 2.2 defines a cookie name consists of one char minimum, plus '='.
|
|
94
|
+
if (len < 2)
|
|
95
|
+
return obj;
|
|
96
|
+
const dec = options?.decode || decode;
|
|
97
|
+
let index = 0;
|
|
98
|
+
do {
|
|
99
|
+
const eqIdx = str.indexOf("=", index);
|
|
100
|
+
if (eqIdx === -1)
|
|
101
|
+
break; // No more cookie pairs.
|
|
102
|
+
const colonIdx = str.indexOf(";", index);
|
|
103
|
+
const endIdx = colonIdx === -1 ? len : colonIdx;
|
|
104
|
+
if (eqIdx > endIdx) {
|
|
105
|
+
// backtrack on prior semicolon
|
|
106
|
+
index = str.lastIndexOf(";", eqIdx - 1) + 1;
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
const keyStartIdx = startIndex(str, index, eqIdx);
|
|
110
|
+
const keyEndIdx = endIndex(str, eqIdx, keyStartIdx);
|
|
111
|
+
const key = str.slice(keyStartIdx, keyEndIdx);
|
|
112
|
+
// only assign once
|
|
113
|
+
if (obj[key] === undefined) {
|
|
114
|
+
let valStartIdx = startIndex(str, eqIdx + 1, endIdx);
|
|
115
|
+
let valEndIdx = endIndex(str, endIdx, valStartIdx);
|
|
116
|
+
const value = dec(str.slice(valStartIdx, valEndIdx));
|
|
117
|
+
obj[key] = value;
|
|
118
|
+
}
|
|
119
|
+
index = endIdx + 1;
|
|
120
|
+
} while (index < len);
|
|
121
|
+
return obj;
|
|
122
|
+
}
|
|
123
|
+
function startIndex(str, index, max) {
|
|
124
|
+
do {
|
|
125
|
+
const code = str.charCodeAt(index);
|
|
126
|
+
if (code !== 0x20 /* */ && code !== 0x09 /* \t */)
|
|
127
|
+
return index;
|
|
128
|
+
} while (++index < max);
|
|
129
|
+
return max;
|
|
130
|
+
}
|
|
131
|
+
function endIndex(str, index, min) {
|
|
132
|
+
while (index > min) {
|
|
133
|
+
const code = str.charCodeAt(--index);
|
|
134
|
+
if (code !== 0x20 /* */ && code !== 0x09 /* \t */)
|
|
135
|
+
return index + 1;
|
|
136
|
+
}
|
|
137
|
+
return min;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Serialize data into a cookie header.
|
|
141
|
+
*
|
|
142
|
+
* Serialize a name value pair into a cookie string suitable for
|
|
143
|
+
* http headers. An optional options object specifies cookie parameters.
|
|
144
|
+
*
|
|
145
|
+
* serialize('foo', 'bar', { httpOnly: true })
|
|
146
|
+
* => "foo=bar; httpOnly"
|
|
147
|
+
*/
|
|
148
|
+
function serialize(name, val, options) {
|
|
149
|
+
const enc = options?.encode || encodeURIComponent;
|
|
150
|
+
if (!cookieNameRegExp.test(name)) {
|
|
151
|
+
throw new TypeError(`argument name is invalid: ${name}`);
|
|
152
|
+
}
|
|
153
|
+
const value = enc(val);
|
|
154
|
+
if (!cookieValueRegExp.test(value)) {
|
|
155
|
+
throw new TypeError(`argument val is invalid: ${val}`);
|
|
156
|
+
}
|
|
157
|
+
let str = name + "=" + value;
|
|
158
|
+
if (!options)
|
|
159
|
+
return str;
|
|
160
|
+
if (options.maxAge !== undefined) {
|
|
161
|
+
if (!Number.isInteger(options.maxAge)) {
|
|
162
|
+
throw new TypeError(`option maxAge is invalid: ${options.maxAge}`);
|
|
163
|
+
}
|
|
164
|
+
str += "; Max-Age=" + options.maxAge;
|
|
165
|
+
}
|
|
166
|
+
if (options.domain) {
|
|
167
|
+
if (!domainValueRegExp.test(options.domain)) {
|
|
168
|
+
throw new TypeError(`option domain is invalid: ${options.domain}`);
|
|
169
|
+
}
|
|
170
|
+
str += "; Domain=" + options.domain;
|
|
171
|
+
}
|
|
172
|
+
if (options.path) {
|
|
173
|
+
if (!pathValueRegExp.test(options.path)) {
|
|
174
|
+
throw new TypeError(`option path is invalid: ${options.path}`);
|
|
175
|
+
}
|
|
176
|
+
str += "; Path=" + options.path;
|
|
177
|
+
}
|
|
178
|
+
if (options.expires) {
|
|
179
|
+
if (!isDate(options.expires) ||
|
|
180
|
+
!Number.isFinite(options.expires.valueOf())) {
|
|
181
|
+
throw new TypeError(`option expires is invalid: ${options.expires}`);
|
|
182
|
+
}
|
|
183
|
+
str += "; Expires=" + options.expires.toUTCString();
|
|
184
|
+
}
|
|
185
|
+
if (options.httpOnly) {
|
|
186
|
+
str += "; HttpOnly";
|
|
187
|
+
}
|
|
188
|
+
if (options.secure) {
|
|
189
|
+
str += "; Secure";
|
|
190
|
+
}
|
|
191
|
+
if (options.partitioned) {
|
|
192
|
+
str += "; Partitioned";
|
|
193
|
+
}
|
|
194
|
+
if (options.priority) {
|
|
195
|
+
const priority = typeof options.priority === "string"
|
|
196
|
+
? options.priority.toLowerCase()
|
|
197
|
+
: undefined;
|
|
198
|
+
switch (priority) {
|
|
199
|
+
case "low":
|
|
200
|
+
str += "; Priority=Low";
|
|
201
|
+
break;
|
|
202
|
+
case "medium":
|
|
203
|
+
str += "; Priority=Medium";
|
|
204
|
+
break;
|
|
205
|
+
case "high":
|
|
206
|
+
str += "; Priority=High";
|
|
207
|
+
break;
|
|
208
|
+
default:
|
|
209
|
+
throw new TypeError(`option priority is invalid: ${options.priority}`);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
if (options.sameSite) {
|
|
213
|
+
const sameSite = typeof options.sameSite === "string"
|
|
214
|
+
? options.sameSite.toLowerCase()
|
|
215
|
+
: options.sameSite;
|
|
216
|
+
switch (sameSite) {
|
|
217
|
+
case true:
|
|
218
|
+
case "strict":
|
|
219
|
+
str += "; SameSite=Strict";
|
|
220
|
+
break;
|
|
221
|
+
case "lax":
|
|
222
|
+
str += "; SameSite=Lax";
|
|
223
|
+
break;
|
|
224
|
+
case "none":
|
|
225
|
+
str += "; SameSite=None";
|
|
226
|
+
break;
|
|
227
|
+
default:
|
|
228
|
+
throw new TypeError(`option sameSite is invalid: ${options.sameSite}`);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return str;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* URL-decode string value. Optimized to skip native call when no %.
|
|
235
|
+
*/
|
|
236
|
+
function decode(str) {
|
|
237
|
+
if (str.indexOf("%") === -1)
|
|
238
|
+
return str;
|
|
239
|
+
try {
|
|
240
|
+
return decodeURIComponent(str);
|
|
241
|
+
}
|
|
242
|
+
catch (e) {
|
|
243
|
+
return str;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Determine if value is a Date.
|
|
248
|
+
*/
|
|
249
|
+
function isDate(val) {
|
|
250
|
+
return __toString.call(val) === "[object Date]";
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return dist;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
var distExports = requireDist();
|
|
257
|
+
|
|
258
|
+
function hasDocumentCookie() {
|
|
259
|
+
const testingValue = typeof global === 'undefined'
|
|
260
|
+
? undefined
|
|
261
|
+
: global.TEST_HAS_DOCUMENT_COOKIE;
|
|
262
|
+
if (typeof testingValue === 'boolean') {
|
|
263
|
+
return testingValue;
|
|
264
|
+
}
|
|
265
|
+
// Can we get/set cookies on document.cookie?
|
|
266
|
+
return typeof document === 'object' && typeof document.cookie === 'string';
|
|
267
|
+
}
|
|
268
|
+
function parseCookies(cookies) {
|
|
269
|
+
if (typeof cookies === 'string') {
|
|
270
|
+
return distExports.parse(cookies);
|
|
271
|
+
}
|
|
272
|
+
else if (typeof cookies === 'object' && cookies !== null) {
|
|
273
|
+
return cookies;
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
return {};
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
function readCookie(value, options = {}) {
|
|
280
|
+
const cleanValue = cleanupCookieValue(value);
|
|
281
|
+
if (!options.doNotParse) {
|
|
282
|
+
try {
|
|
283
|
+
return JSON.parse(cleanValue);
|
|
284
|
+
}
|
|
285
|
+
catch (e) {
|
|
286
|
+
// At least we tried
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
// Ignore clean value if we failed the deserialization
|
|
290
|
+
// It is not relevant anymore to trim those values
|
|
291
|
+
return value;
|
|
292
|
+
}
|
|
293
|
+
function cleanupCookieValue(value) {
|
|
294
|
+
// express prepend j: before serializing a cookie
|
|
295
|
+
if (value && value[0] === 'j' && value[1] === ':') {
|
|
296
|
+
return value.substr(2);
|
|
297
|
+
}
|
|
298
|
+
return value;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
class Cookies {
|
|
302
|
+
constructor(cookies, defaultSetOptions = {}) {
|
|
303
|
+
this.changeListeners = [];
|
|
304
|
+
this.HAS_DOCUMENT_COOKIE = false;
|
|
305
|
+
this.update = () => {
|
|
306
|
+
if (!this.HAS_DOCUMENT_COOKIE) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
const previousCookies = this.cookies;
|
|
310
|
+
this.cookies = distExports.parse(document.cookie);
|
|
311
|
+
this._checkChanges(previousCookies);
|
|
312
|
+
};
|
|
313
|
+
const domCookies = typeof document === 'undefined' ? '' : document.cookie;
|
|
314
|
+
this.cookies = parseCookies(cookies || domCookies);
|
|
315
|
+
this.defaultSetOptions = defaultSetOptions;
|
|
316
|
+
this.HAS_DOCUMENT_COOKIE = hasDocumentCookie();
|
|
317
|
+
}
|
|
318
|
+
_emitChange(params) {
|
|
319
|
+
for (let i = 0; i < this.changeListeners.length; ++i) {
|
|
320
|
+
this.changeListeners[i](params);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
_checkChanges(previousCookies) {
|
|
324
|
+
const names = new Set(Object.keys(previousCookies).concat(Object.keys(this.cookies)));
|
|
325
|
+
names.forEach((name) => {
|
|
326
|
+
if (previousCookies[name] !== this.cookies[name]) {
|
|
327
|
+
this._emitChange({
|
|
328
|
+
name,
|
|
329
|
+
value: readCookie(this.cookies[name]),
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
_startPolling() {
|
|
335
|
+
this.pollingInterval = setInterval(this.update, 300);
|
|
336
|
+
}
|
|
337
|
+
_stopPolling() {
|
|
338
|
+
if (this.pollingInterval) {
|
|
339
|
+
clearInterval(this.pollingInterval);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
get(name, options = {}) {
|
|
343
|
+
if (!options.doNotUpdate) {
|
|
344
|
+
this.update();
|
|
345
|
+
}
|
|
346
|
+
return readCookie(this.cookies[name], options);
|
|
347
|
+
}
|
|
348
|
+
getAll(options = {}) {
|
|
349
|
+
if (!options.doNotUpdate) {
|
|
350
|
+
this.update();
|
|
351
|
+
}
|
|
352
|
+
const result = {};
|
|
353
|
+
for (let name in this.cookies) {
|
|
354
|
+
result[name] = readCookie(this.cookies[name], options);
|
|
355
|
+
}
|
|
356
|
+
return result;
|
|
357
|
+
}
|
|
358
|
+
set(name, value, options) {
|
|
359
|
+
if (options) {
|
|
360
|
+
options = Object.assign(Object.assign({}, this.defaultSetOptions), options);
|
|
361
|
+
}
|
|
362
|
+
else {
|
|
363
|
+
options = this.defaultSetOptions;
|
|
364
|
+
}
|
|
365
|
+
const stringValue = typeof value === 'string' ? value : JSON.stringify(value);
|
|
366
|
+
this.cookies = Object.assign(Object.assign({}, this.cookies), { [name]: stringValue });
|
|
367
|
+
if (this.HAS_DOCUMENT_COOKIE) {
|
|
368
|
+
document.cookie = distExports.serialize(name, stringValue, options);
|
|
369
|
+
}
|
|
370
|
+
this._emitChange({ name, value, options });
|
|
371
|
+
}
|
|
372
|
+
remove(name, options) {
|
|
373
|
+
const finalOptions = (options = Object.assign(Object.assign(Object.assign({}, this.defaultSetOptions), options), { expires: new Date(1970, 1, 1, 0, 0, 1), maxAge: 0 }));
|
|
374
|
+
this.cookies = Object.assign({}, this.cookies);
|
|
375
|
+
delete this.cookies[name];
|
|
376
|
+
if (this.HAS_DOCUMENT_COOKIE) {
|
|
377
|
+
document.cookie = distExports.serialize(name, '', finalOptions);
|
|
378
|
+
}
|
|
379
|
+
this._emitChange({ name, value: undefined, options });
|
|
380
|
+
}
|
|
381
|
+
addChangeListener(callback) {
|
|
382
|
+
this.changeListeners.push(callback);
|
|
383
|
+
if (this.HAS_DOCUMENT_COOKIE && this.changeListeners.length === 1) {
|
|
384
|
+
if (typeof window === 'object' && 'cookieStore' in window) {
|
|
385
|
+
window.cookieStore.addEventListener('change', this.update);
|
|
386
|
+
}
|
|
387
|
+
else {
|
|
388
|
+
this._startPolling();
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
removeChangeListener(callback) {
|
|
393
|
+
const idx = this.changeListeners.indexOf(callback);
|
|
394
|
+
if (idx >= 0) {
|
|
395
|
+
this.changeListeners.splice(idx, 1);
|
|
396
|
+
}
|
|
397
|
+
if (this.HAS_DOCUMENT_COOKIE && this.changeListeners.length === 0) {
|
|
398
|
+
if (typeof window === 'object' && 'cookieStore' in window) {
|
|
399
|
+
window.cookieStore.removeEventListener('change', this.update);
|
|
400
|
+
}
|
|
401
|
+
else {
|
|
402
|
+
this._stopPolling();
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
removeAllChangeListeners() {
|
|
407
|
+
while (this.changeListeners.length > 0) {
|
|
408
|
+
this.removeChangeListener(this.changeListeners[0]);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
const COOKIE_VALID_DAYS = 1; // 0 = Session cookie
|
|
414
|
+
|
|
415
|
+
// CookieHelper is a class that takes in and lets us pass around the methods provided
|
|
416
|
+
// by `useCookie` react hook in backend code that is connected to the universal-cookies
|
|
417
|
+
// instance created in SSR middleware (and provides browser cookies)
|
|
418
|
+
class CookieHelper {
|
|
419
|
+
get raw() {
|
|
420
|
+
return this.cookies;
|
|
421
|
+
}
|
|
422
|
+
get cookie() {
|
|
423
|
+
return this.set ? this : this.fallback;
|
|
424
|
+
}
|
|
425
|
+
constructor(cookies, setCookie, removeCookie, updateCookies) {
|
|
426
|
+
// Add fallback methods if global cookies not supplied
|
|
427
|
+
if (!cookies || !setCookie || !removeCookie) this.fallback = new Cookies();
|
|
428
|
+
this.cookies = cookies || this.fallback.getAll();
|
|
429
|
+
if (setCookie) this.set = setCookie;
|
|
430
|
+
if (removeCookie) this.remove = removeCookie;
|
|
431
|
+
if (updateCookies) this.update = updateCookies;
|
|
432
|
+
}
|
|
433
|
+
GetCookie(name) {
|
|
434
|
+
const cookie = this.cookies[name];
|
|
435
|
+
if (typeof cookie === 'undefined') {
|
|
436
|
+
return null;
|
|
437
|
+
}
|
|
438
|
+
return cookie;
|
|
439
|
+
}
|
|
440
|
+
SetCookie(name, value, maxAgeDays = COOKIE_VALID_DAYS) {
|
|
441
|
+
// update local cookies object as this is provided as a clone of `req.universalCookies`
|
|
442
|
+
this.cookies[name] = value;
|
|
443
|
+
|
|
444
|
+
// call the passed setCookie method so we can update the `universal-cookie` instance
|
|
445
|
+
// with the change listener attached so the cookies can be set in SSR response
|
|
446
|
+
if (maxAgeDays === 0) this.cookie.set(name, value);else this.cookie.set(name, value, {
|
|
447
|
+
expires: addDays(new Date(), maxAgeDays),
|
|
448
|
+
path: '/'
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
DeleteCookie(name) {
|
|
452
|
+
// update local cookies object as this is provided as a clone of `req.universalCookies`
|
|
453
|
+
delete this.cookies[name];
|
|
454
|
+
this.cookie.remove(name, {
|
|
455
|
+
path: '/'
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
const addDays = (date = new Date(), days) => {
|
|
460
|
+
const result = new Date(date);
|
|
461
|
+
result.setDate(result.getDate() + days);
|
|
462
|
+
return result;
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
exports.BEARER_TOKEN_COOKIE = BEARER_TOKEN_COOKIE;
|
|
466
|
+
exports.CookieHelper = CookieHelper;
|
|
467
|
+
exports.Cookies = Cookies;
|
|
468
|
+
exports.LOGIN_COOKIE = LOGIN_COOKIE;
|
|
469
|
+
exports.REFRESH_TOKEN_COOKIE = REFRESH_TOKEN_COOKIE;
|
|
470
|
+
exports.findLoginCookies = findLoginCookies;
|
|
471
|
+
//# sourceMappingURL=CookieHelper.class-C3Eqoze9.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CookieHelper.class-C3Eqoze9.js","sources":["../src/user/util/CookieConstants.ts","../node_modules/universal-cookie/esm/index.mjs","../src/user/util/CookieHelper.class.ts"],"sourcesContent":["export const BEARER_TOKEN_COOKIE = 'ContensisSecurityBearerToken';\nexport const LOGIN_COOKIE = 'ContensisCMSUserName';\nexport const REFRESH_TOKEN_COOKIE = 'RefreshToken';\n\nexport type CookieObject = { [name: string]: any };\n\nexport const findLoginCookies = (cookies: CookieObject | string) =>\n typeof cookies === 'object'\n ? Object.fromEntries(\n Object.entries(cookies).filter(([name]) =>\n [LOGIN_COOKIE, REFRESH_TOKEN_COOKIE].includes(name)\n )\n )\n : cookies;\n","var dist = {};\n\nvar hasRequiredDist;\n\nfunction requireDist () {\n\tif (hasRequiredDist) return dist;\n\thasRequiredDist = 1;\n\tObject.defineProperty(dist, \"__esModule\", { value: true });\n\tdist.parse = parse;\n\tdist.serialize = serialize;\n\t/**\n\t * RegExp to match cookie-name in RFC 6265 sec 4.1.1\n\t * This refers out to the obsoleted definition of token in RFC 2616 sec 2.2\n\t * which has been replaced by the token definition in RFC 7230 appendix B.\n\t *\n\t * cookie-name = token\n\t * token = 1*tchar\n\t * tchar = \"!\" / \"#\" / \"$\" / \"%\" / \"&\" / \"'\" /\n\t * \"*\" / \"+\" / \"-\" / \".\" / \"^\" / \"_\" /\n\t * \"`\" / \"|\" / \"~\" / DIGIT / ALPHA\n\t *\n\t * Note: Allowing more characters - https://github.com/jshttp/cookie/issues/191\n\t * Allow same range as cookie value, except `=`, which delimits end of name.\n\t */\n\tconst cookieNameRegExp = /^[\\u0021-\\u003A\\u003C\\u003E-\\u007E]+$/;\n\t/**\n\t * RegExp to match cookie-value in RFC 6265 sec 4.1.1\n\t *\n\t * cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )\n\t * cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E\n\t * ; US-ASCII characters excluding CTLs,\n\t * ; whitespace DQUOTE, comma, semicolon,\n\t * ; and backslash\n\t *\n\t * Allowing more characters: https://github.com/jshttp/cookie/issues/191\n\t * Comma, backslash, and DQUOTE are not part of the parsing algorithm.\n\t */\n\tconst cookieValueRegExp = /^[\\u0021-\\u003A\\u003C-\\u007E]*$/;\n\t/**\n\t * RegExp to match domain-value in RFC 6265 sec 4.1.1\n\t *\n\t * domain-value = <subdomain>\n\t * ; defined in [RFC1034], Section 3.5, as\n\t * ; enhanced by [RFC1123], Section 2.1\n\t * <subdomain> = <label> | <subdomain> \".\" <label>\n\t * <label> = <let-dig> [ [ <ldh-str> ] <let-dig> ]\n\t * Labels must be 63 characters or less.\n\t * 'let-dig' not 'letter' in the first char, per RFC1123\n\t * <ldh-str> = <let-dig-hyp> | <let-dig-hyp> <ldh-str>\n\t * <let-dig-hyp> = <let-dig> | \"-\"\n\t * <let-dig> = <letter> | <digit>\n\t * <letter> = any one of the 52 alphabetic characters A through Z in\n\t * upper case and a through z in lower case\n\t * <digit> = any one of the ten digits 0 through 9\n\t *\n\t * Keep support for leading dot: https://github.com/jshttp/cookie/issues/173\n\t *\n\t * > (Note that a leading %x2E (\".\"), if present, is ignored even though that\n\t * character is not permitted, but a trailing %x2E (\".\"), if present, will\n\t * cause the user agent to ignore the attribute.)\n\t */\n\tconst domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;\n\t/**\n\t * RegExp to match path-value in RFC 6265 sec 4.1.1\n\t *\n\t * path-value = <any CHAR except CTLs or \";\">\n\t * CHAR = %x01-7F\n\t * ; defined in RFC 5234 appendix B.1\n\t */\n\tconst pathValueRegExp = /^[\\u0020-\\u003A\\u003D-\\u007E]*$/;\n\tconst __toString = Object.prototype.toString;\n\tconst NullObject = /* @__PURE__ */ (() => {\n\t const C = function () { };\n\t C.prototype = Object.create(null);\n\t return C;\n\t})();\n\t/**\n\t * Parse a cookie header.\n\t *\n\t * Parse the given cookie header string into an object\n\t * The object has the various cookies as keys(names) => values\n\t */\n\tfunction parse(str, options) {\n\t const obj = new NullObject();\n\t const len = str.length;\n\t // RFC 6265 sec 4.1.1, RFC 2616 2.2 defines a cookie name consists of one char minimum, plus '='.\n\t if (len < 2)\n\t return obj;\n\t const dec = options?.decode || decode;\n\t let index = 0;\n\t do {\n\t const eqIdx = str.indexOf(\"=\", index);\n\t if (eqIdx === -1)\n\t break; // No more cookie pairs.\n\t const colonIdx = str.indexOf(\";\", index);\n\t const endIdx = colonIdx === -1 ? len : colonIdx;\n\t if (eqIdx > endIdx) {\n\t // backtrack on prior semicolon\n\t index = str.lastIndexOf(\";\", eqIdx - 1) + 1;\n\t continue;\n\t }\n\t const keyStartIdx = startIndex(str, index, eqIdx);\n\t const keyEndIdx = endIndex(str, eqIdx, keyStartIdx);\n\t const key = str.slice(keyStartIdx, keyEndIdx);\n\t // only assign once\n\t if (obj[key] === undefined) {\n\t let valStartIdx = startIndex(str, eqIdx + 1, endIdx);\n\t let valEndIdx = endIndex(str, endIdx, valStartIdx);\n\t const value = dec(str.slice(valStartIdx, valEndIdx));\n\t obj[key] = value;\n\t }\n\t index = endIdx + 1;\n\t } while (index < len);\n\t return obj;\n\t}\n\tfunction startIndex(str, index, max) {\n\t do {\n\t const code = str.charCodeAt(index);\n\t if (code !== 0x20 /* */ && code !== 0x09 /* \\t */)\n\t return index;\n\t } while (++index < max);\n\t return max;\n\t}\n\tfunction endIndex(str, index, min) {\n\t while (index > min) {\n\t const code = str.charCodeAt(--index);\n\t if (code !== 0x20 /* */ && code !== 0x09 /* \\t */)\n\t return index + 1;\n\t }\n\t return min;\n\t}\n\t/**\n\t * Serialize data into a cookie header.\n\t *\n\t * Serialize a name value pair into a cookie string suitable for\n\t * http headers. An optional options object specifies cookie parameters.\n\t *\n\t * serialize('foo', 'bar', { httpOnly: true })\n\t * => \"foo=bar; httpOnly\"\n\t */\n\tfunction serialize(name, val, options) {\n\t const enc = options?.encode || encodeURIComponent;\n\t if (!cookieNameRegExp.test(name)) {\n\t throw new TypeError(`argument name is invalid: ${name}`);\n\t }\n\t const value = enc(val);\n\t if (!cookieValueRegExp.test(value)) {\n\t throw new TypeError(`argument val is invalid: ${val}`);\n\t }\n\t let str = name + \"=\" + value;\n\t if (!options)\n\t return str;\n\t if (options.maxAge !== undefined) {\n\t if (!Number.isInteger(options.maxAge)) {\n\t throw new TypeError(`option maxAge is invalid: ${options.maxAge}`);\n\t }\n\t str += \"; Max-Age=\" + options.maxAge;\n\t }\n\t if (options.domain) {\n\t if (!domainValueRegExp.test(options.domain)) {\n\t throw new TypeError(`option domain is invalid: ${options.domain}`);\n\t }\n\t str += \"; Domain=\" + options.domain;\n\t }\n\t if (options.path) {\n\t if (!pathValueRegExp.test(options.path)) {\n\t throw new TypeError(`option path is invalid: ${options.path}`);\n\t }\n\t str += \"; Path=\" + options.path;\n\t }\n\t if (options.expires) {\n\t if (!isDate(options.expires) ||\n\t !Number.isFinite(options.expires.valueOf())) {\n\t throw new TypeError(`option expires is invalid: ${options.expires}`);\n\t }\n\t str += \"; Expires=\" + options.expires.toUTCString();\n\t }\n\t if (options.httpOnly) {\n\t str += \"; HttpOnly\";\n\t }\n\t if (options.secure) {\n\t str += \"; Secure\";\n\t }\n\t if (options.partitioned) {\n\t str += \"; Partitioned\";\n\t }\n\t if (options.priority) {\n\t const priority = typeof options.priority === \"string\"\n\t ? options.priority.toLowerCase()\n\t : undefined;\n\t switch (priority) {\n\t case \"low\":\n\t str += \"; Priority=Low\";\n\t break;\n\t case \"medium\":\n\t str += \"; Priority=Medium\";\n\t break;\n\t case \"high\":\n\t str += \"; Priority=High\";\n\t break;\n\t default:\n\t throw new TypeError(`option priority is invalid: ${options.priority}`);\n\t }\n\t }\n\t if (options.sameSite) {\n\t const sameSite = typeof options.sameSite === \"string\"\n\t ? options.sameSite.toLowerCase()\n\t : options.sameSite;\n\t switch (sameSite) {\n\t case true:\n\t case \"strict\":\n\t str += \"; SameSite=Strict\";\n\t break;\n\t case \"lax\":\n\t str += \"; SameSite=Lax\";\n\t break;\n\t case \"none\":\n\t str += \"; SameSite=None\";\n\t break;\n\t default:\n\t throw new TypeError(`option sameSite is invalid: ${options.sameSite}`);\n\t }\n\t }\n\t return str;\n\t}\n\t/**\n\t * URL-decode string value. Optimized to skip native call when no %.\n\t */\n\tfunction decode(str) {\n\t if (str.indexOf(\"%\") === -1)\n\t return str;\n\t try {\n\t return decodeURIComponent(str);\n\t }\n\t catch (e) {\n\t return str;\n\t }\n\t}\n\t/**\n\t * Determine if value is a Date.\n\t */\n\tfunction isDate(val) {\n\t return __toString.call(val) === \"[object Date]\";\n\t}\n\t\n\treturn dist;\n}\n\nvar distExports = requireDist();\n\nfunction hasDocumentCookie() {\n const testingValue = typeof global === 'undefined'\n ? undefined\n : global.TEST_HAS_DOCUMENT_COOKIE;\n if (typeof testingValue === 'boolean') {\n return testingValue;\n }\n // Can we get/set cookies on document.cookie?\n return typeof document === 'object' && typeof document.cookie === 'string';\n}\nfunction parseCookies(cookies) {\n if (typeof cookies === 'string') {\n return distExports.parse(cookies);\n }\n else if (typeof cookies === 'object' && cookies !== null) {\n return cookies;\n }\n else {\n return {};\n }\n}\nfunction readCookie(value, options = {}) {\n const cleanValue = cleanupCookieValue(value);\n if (!options.doNotParse) {\n try {\n return JSON.parse(cleanValue);\n }\n catch (e) {\n // At least we tried\n }\n }\n // Ignore clean value if we failed the deserialization\n // It is not relevant anymore to trim those values\n return value;\n}\nfunction cleanupCookieValue(value) {\n // express prepend j: before serializing a cookie\n if (value && value[0] === 'j' && value[1] === ':') {\n return value.substr(2);\n }\n return value;\n}\n\nclass Cookies {\n constructor(cookies, defaultSetOptions = {}) {\n this.changeListeners = [];\n this.HAS_DOCUMENT_COOKIE = false;\n this.update = () => {\n if (!this.HAS_DOCUMENT_COOKIE) {\n return;\n }\n const previousCookies = this.cookies;\n this.cookies = distExports.parse(document.cookie);\n this._checkChanges(previousCookies);\n };\n const domCookies = typeof document === 'undefined' ? '' : document.cookie;\n this.cookies = parseCookies(cookies || domCookies);\n this.defaultSetOptions = defaultSetOptions;\n this.HAS_DOCUMENT_COOKIE = hasDocumentCookie();\n }\n _emitChange(params) {\n for (let i = 0; i < this.changeListeners.length; ++i) {\n this.changeListeners[i](params);\n }\n }\n _checkChanges(previousCookies) {\n const names = new Set(Object.keys(previousCookies).concat(Object.keys(this.cookies)));\n names.forEach((name) => {\n if (previousCookies[name] !== this.cookies[name]) {\n this._emitChange({\n name,\n value: readCookie(this.cookies[name]),\n });\n }\n });\n }\n _startPolling() {\n this.pollingInterval = setInterval(this.update, 300);\n }\n _stopPolling() {\n if (this.pollingInterval) {\n clearInterval(this.pollingInterval);\n }\n }\n get(name, options = {}) {\n if (!options.doNotUpdate) {\n this.update();\n }\n return readCookie(this.cookies[name], options);\n }\n getAll(options = {}) {\n if (!options.doNotUpdate) {\n this.update();\n }\n const result = {};\n for (let name in this.cookies) {\n result[name] = readCookie(this.cookies[name], options);\n }\n return result;\n }\n set(name, value, options) {\n if (options) {\n options = Object.assign(Object.assign({}, this.defaultSetOptions), options);\n }\n else {\n options = this.defaultSetOptions;\n }\n const stringValue = typeof value === 'string' ? value : JSON.stringify(value);\n this.cookies = Object.assign(Object.assign({}, this.cookies), { [name]: stringValue });\n if (this.HAS_DOCUMENT_COOKIE) {\n document.cookie = distExports.serialize(name, stringValue, options);\n }\n this._emitChange({ name, value, options });\n }\n remove(name, options) {\n const finalOptions = (options = Object.assign(Object.assign(Object.assign({}, this.defaultSetOptions), options), { expires: new Date(1970, 1, 1, 0, 0, 1), maxAge: 0 }));\n this.cookies = Object.assign({}, this.cookies);\n delete this.cookies[name];\n if (this.HAS_DOCUMENT_COOKIE) {\n document.cookie = distExports.serialize(name, '', finalOptions);\n }\n this._emitChange({ name, value: undefined, options });\n }\n addChangeListener(callback) {\n this.changeListeners.push(callback);\n if (this.HAS_DOCUMENT_COOKIE && this.changeListeners.length === 1) {\n if (typeof window === 'object' && 'cookieStore' in window) {\n window.cookieStore.addEventListener('change', this.update);\n }\n else {\n this._startPolling();\n }\n }\n }\n removeChangeListener(callback) {\n const idx = this.changeListeners.indexOf(callback);\n if (idx >= 0) {\n this.changeListeners.splice(idx, 1);\n }\n if (this.HAS_DOCUMENT_COOKIE && this.changeListeners.length === 0) {\n if (typeof window === 'object' && 'cookieStore' in window) {\n window.cookieStore.removeEventListener('change', this.update);\n }\n else {\n this._stopPolling();\n }\n }\n }\n removeAllChangeListeners() {\n while (this.changeListeners.length > 0) {\n this.removeChangeListener(this.changeListeners[0]);\n }\n }\n}\n\nexport { Cookies as default };\n","import { useCookies } from 'react-cookie';\nimport FallbackCookies from 'universal-cookie';\n\nconst COOKIE_VALID_DAYS = 1; // 0 = Session cookie\n\ntype CookieHook = ReturnType<typeof useCookies>;\ntype Cookies = { [k: string]: string };\ntype SetCookie = CookieHook[1];\ntype RemoveCookie = CookieHook[2];\ntype UpdateCookie = CookieHook[3];\n\n// CookieHelper is a class that takes in and lets us pass around the methods provided\n// by `useCookie` react hook in backend code that is connected to the universal-cookies\n// instance created in SSR middleware (and provides browser cookies)\nexport class CookieHelper {\n private cookies: Cookies;\n private set?: SetCookie;\n private remove?: RemoveCookie;\n private update?: UpdateCookie;\n private fallback!: FallbackCookies;\n\n get raw() {\n return this.cookies;\n }\n\n get cookie(): FallbackCookies {\n return (this.set ? this : this.fallback) as FallbackCookies;\n }\n\n constructor(\n cookies?: { [k: string]: string },\n setCookie?: CookieHelper['set'],\n removeCookie?: CookieHelper['remove'],\n updateCookies?: CookieHelper['update']\n ) {\n // Add fallback methods if global cookies not supplied\n if (!cookies || !setCookie || !removeCookie)\n this.fallback = new FallbackCookies();\n\n this.cookies = cookies || this.fallback.getAll();\n if (setCookie) this.set = setCookie;\n if (removeCookie) this.remove = removeCookie;\n if (updateCookies) this.update = updateCookies;\n }\n\n GetCookie(name: string) {\n const cookie = this.cookies[name];\n if (typeof cookie === 'undefined') {\n return null;\n }\n return cookie;\n }\n\n SetCookie(name: string, value: string, maxAgeDays = COOKIE_VALID_DAYS) {\n // update local cookies object as this is provided as a clone of `req.universalCookies`\n this.cookies[name] = value;\n\n // call the passed setCookie method so we can update the `universal-cookie` instance\n // with the change listener attached so the cookies can be set in SSR response\n if (maxAgeDays === 0) this.cookie.set(name, value);\n else\n this.cookie.set(name, value, {\n expires: addDays(new Date(), maxAgeDays),\n path: '/',\n });\n }\n\n DeleteCookie(name: string) {\n // update local cookies object as this is provided as a clone of `req.universalCookies`\n delete this.cookies[name];\n\n this.cookie.remove(name, {\n path: '/',\n });\n }\n}\nconst addDays = (date = new Date(), days: number) => {\n const result = new Date(date);\n result.setDate(result.getDate() + days);\n return result;\n};\n\nexport const mapCookieHeader = cookies =>\n typeof cookies === 'object'\n ? Object.entries(cookies)\n .map(([name, value]) => `${name}=${value}`)\n .join('; ')\n : cookies;\n"],"names":["BEARER_TOKEN_COOKIE","LOGIN_COOKIE","REFRESH_TOKEN_COOKIE","findLoginCookies","cookies","Object","fromEntries","entries","filter","name","includes","COOKIE_VALID_DAYS","CookieHelper","raw","cookie","set","fallback","constructor","setCookie","removeCookie","updateCookies","FallbackCookies","getAll","remove","update","GetCookie","SetCookie","value","maxAgeDays","expires","addDays","Date","path","DeleteCookie","date","days","result","setDate","getDate"],"mappings":";;AAAO,MAAMA,mBAAmB,GAAG;AAC5B,MAAMC,YAAY,GAAG;AACrB,MAAMC,oBAAoB,GAAG;MAIvBC,gBAAgB,GAAIC,OAA8B,IAC7D,OAAOA,OAAO,KAAK,QAAQ,GACvBC,MAAM,CAACC,WAAW,CAChBD,MAAM,CAACE,OAAO,CAAC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