@zengenti/contensis-react-base 4.0.0-beta.2 → 4.0.0-beta.3

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 (209) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +18 -478
  3. package/cjs/{App-b56aca04.js → App-BNcmM8rN.js} +215 -234
  4. package/cjs/App-BNcmM8rN.js.map +1 -0
  5. package/cjs/{ChangePassword.container-ae35785e.js → ChangePassword.container-642SYfpS.js} +209 -286
  6. package/cjs/ChangePassword.container-642SYfpS.js.map +1 -0
  7. package/cjs/CookieHelper.class-BoY5TrIi.js +562 -0
  8. package/cjs/CookieHelper.class-BoY5TrIi.js.map +1 -0
  9. package/cjs/{RouteLoader-c06dccd5.js → RouteLoader-DvyYYyIE.js} +55 -68
  10. package/cjs/RouteLoader-DvyYYyIE.js.map +1 -0
  11. package/cjs/{ContensisDeliveryApi-4fcf049d.js → SSRContext-D66GKlH7.js} +165 -119
  12. package/cjs/SSRContext-D66GKlH7.js.map +1 -0
  13. package/cjs/{ToJs-a8d8f3f0.js → ToJs-C9jwV7YB.js} +26 -80
  14. package/cjs/ToJs-C9jwV7YB.js.map +1 -0
  15. package/cjs/{_commonjsHelpers-b3309d7b.js → _commonjsHelpers-BJu3ubxk.js} +1 -1
  16. package/cjs/_commonjsHelpers-BJu3ubxk.js.map +1 -0
  17. package/cjs/client.js +67 -65
  18. package/cjs/client.js.map +1 -1
  19. package/cjs/contensis-react-base.js +386 -3293
  20. package/cjs/contensis-react-base.js.map +1 -1
  21. package/cjs/{fromJSLeaveImmer-e74c673c.js → fromJSLeaveImmer-Blvlk4t2.js} +3 -7
  22. package/{esm/fromJSLeaveImmer-0114ffcf.js.map → cjs/fromJSLeaveImmer-Blvlk4t2.js.map} +1 -1
  23. package/cjs/redux.js +18 -19
  24. package/cjs/redux.js.map +1 -1
  25. package/cjs/routing.js +13 -6
  26. package/cjs/routing.js.map +1 -1
  27. package/cjs/sagas-CbZhaRNd.js +6010 -0
  28. package/cjs/sagas-CbZhaRNd.js.map +1 -0
  29. package/cjs/search.js +105 -305
  30. package/cjs/search.js.map +1 -1
  31. package/cjs/selectors-wCs5fHD4.js +460 -0
  32. package/cjs/selectors-wCs5fHD4.js.map +1 -0
  33. package/cjs/{version-34d91f68.js → store-CADDS7cV.js} +44 -111
  34. package/cjs/store-CADDS7cV.js.map +1 -0
  35. package/cjs/{urls-6fcaf4c6.js → urls-DVIwGZmd.js} +1 -1
  36. package/{esm/urls-eac9a747.js.map → cjs/urls-DVIwGZmd.js.map} +1 -1
  37. package/cjs/user.js +12 -20
  38. package/cjs/user.js.map +1 -1
  39. package/cjs/util.js +108 -115
  40. package/cjs/util.js.map +1 -1
  41. package/cjs/{version-a410c88e.js → version-ASZx0NDG.js} +19 -22
  42. package/{esm/version-9f29becb.js.map → cjs/version-ASZx0NDG.js.map} +1 -1
  43. package/cjs/version-CM-bJ62L.js +20 -0
  44. package/cjs/version-CM-bJ62L.js.map +1 -0
  45. package/esm/{App-83107d7e.js → App-CfIZbvU9.js} +176 -195
  46. package/esm/App-CfIZbvU9.js.map +1 -0
  47. package/esm/{ChangePassword.container-76fd5e9b.js → ChangePassword.container-Q7bElOVz.js} +191 -250
  48. package/esm/ChangePassword.container-Q7bElOVz.js.map +1 -0
  49. package/esm/CookieHelper.class-DzleKOOc.js +555 -0
  50. package/esm/CookieHelper.class-DzleKOOc.js.map +1 -0
  51. package/esm/{RouteLoader-29fd689a.js → RouteLoader-qJA3UqTM.js} +40 -53
  52. package/esm/RouteLoader-qJA3UqTM.js.map +1 -0
  53. package/esm/{ContensisDeliveryApi-fe57a037.js → SSRContext-C743Oeli.js} +159 -120
  54. package/esm/SSRContext-C743Oeli.js.map +1 -0
  55. package/esm/{ToJs-df57f31d.js → ToJs-CpPNdcXS.js} +24 -77
  56. package/esm/ToJs-CpPNdcXS.js.map +1 -0
  57. package/esm/{_commonjsHelpers-1789f0cf.js → _commonjsHelpers-BFTU3MAI.js} +1 -1
  58. package/esm/_commonjsHelpers-BFTU3MAI.js.map +1 -0
  59. package/esm/client.js +55 -53
  60. package/esm/client.js.map +1 -1
  61. package/esm/contensis-react-base.js +317 -3222
  62. package/esm/contensis-react-base.js.map +1 -1
  63. package/esm/{fromJSLeaveImmer-0114ffcf.js → fromJSLeaveImmer-C_YACmOf.js} +2 -6
  64. package/{cjs/fromJSLeaveImmer-e74c673c.js.map → esm/fromJSLeaveImmer-C_YACmOf.js.map} +1 -1
  65. package/esm/redux.js +9 -8
  66. package/esm/redux.js.map +1 -1
  67. package/esm/routing.js +13 -4
  68. package/esm/routing.js.map +1 -1
  69. package/esm/sagas-xJU-zOpn.js +5916 -0
  70. package/esm/sagas-xJU-zOpn.js.map +1 -0
  71. package/esm/search.js +113 -311
  72. package/esm/search.js.map +1 -1
  73. package/esm/selectors-CBdCY0u3.js +396 -0
  74. package/esm/selectors-CBdCY0u3.js.map +1 -0
  75. package/esm/{version-3d9911e2.js → store-uQZKjfA8.js} +36 -81
  76. package/esm/store-uQZKjfA8.js.map +1 -0
  77. package/esm/{urls-eac9a747.js → urls-DfCisos-.js} +1 -1
  78. package/{cjs/urls-6fcaf4c6.js.map → esm/urls-DfCisos-.js.map} +1 -1
  79. package/esm/user.js +7 -13
  80. package/esm/user.js.map +1 -1
  81. package/esm/util.js +66 -74
  82. package/esm/util.js.map +1 -1
  83. package/esm/{version-9f29becb.js → version-B9nPx4IF.js} +6 -9
  84. package/{cjs/version-a410c88e.js.map → esm/version-B9nPx4IF.js.map} +1 -1
  85. package/esm/version-D773TD9j.js +15 -0
  86. package/esm/version-D773TD9j.js.map +1 -0
  87. package/models/app/App.d.ts +1 -1
  88. package/models/app/pages/VersionInfo/components/VersionInfo.d.ts +1 -1
  89. package/models/app/pages/VersionInfo/components/VersionInfo.styled.d.ts +2 -1
  90. package/models/client/client.d.ts +1 -1
  91. package/models/index.d.ts +1 -2
  92. package/models/models/AppRouteProps.d.ts +11 -0
  93. package/models/models/ContentTypeMapping.d.ts +89 -0
  94. package/models/models/EntryMapper.d.ts +3 -0
  95. package/models/models/GetRouteActionArgs.d.ts +15 -0
  96. package/models/models/MatchedRoute.d.ts +4 -0
  97. package/models/models/ReduxInjector.d.ts +5 -0
  98. package/models/models/RequireLogin.d.ts +6 -0
  99. package/models/models/RouteComponent.d.ts +4 -0
  100. package/models/models/RouteComponentProps.d.ts +9 -0
  101. package/models/models/RouteLoaderProps.d.ts +9 -0
  102. package/models/models/RouteNode.d.ts +5 -0
  103. package/models/models/SSRContext.d.ts +11 -0
  104. package/models/models/StaticRoute.d.ts +60 -0
  105. package/models/models/WithEvents.d.ts +58 -0
  106. package/models/models/config/AppConfig.d.ts +12 -0
  107. package/models/{config.d.ts → models/config/ServerConfig.d.ts} +3 -12
  108. package/models/models/config/StateType.d.ts +1 -0
  109. package/models/models/config/index.d.ts +3 -0
  110. package/models/models/index.d.ts +16 -0
  111. package/models/redux/actions/index.d.ts +2 -2
  112. package/models/redux/sagas/navigation.d.ts +1 -3
  113. package/models/redux/selectors/index.d.ts +2 -2
  114. package/models/redux/store/injectors.d.ts +16 -4
  115. package/models/redux/store/store.d.ts +10 -4
  116. package/models/redux/types/index.d.ts +2 -2
  117. package/models/redux/types/navigation.d.ts +3 -3
  118. package/models/redux/types/version.d.ts +2 -2
  119. package/models/routing/components/Redirect.d.ts +1 -1
  120. package/models/routing/components/RouteLoader.d.ts +1 -1
  121. package/models/routing/components/StaticRouteLoader.d.ts +1 -1
  122. package/models/routing/components/Status.d.ts +1 -1
  123. package/models/routing/redux/actions.d.ts +3 -4
  124. package/models/routing/redux/selectors.d.ts +2 -2
  125. package/models/routing/redux/types.d.ts +11 -11
  126. package/models/routing/routes.d.ts +1 -1
  127. package/models/routing/util/find-contenttype-mapping.d.ts +1 -1
  128. package/models/routing/util/queries.d.ts +2 -2
  129. package/models/search/models/Queries.d.ts +4 -2
  130. package/models/search/models/Search.d.ts +8 -1
  131. package/models/search/models/SearchActions.d.ts +3 -2
  132. package/models/search/models/SearchState.d.ts +5 -1
  133. package/models/search/redux/reducers.d.ts +2 -257
  134. package/models/search/redux/schema.d.ts +1 -1
  135. package/models/search/redux/selectors.d.ts +5 -5
  136. package/models/search/search/ContensisDeliveryApi.d.ts +2 -2
  137. package/models/search/search/ToJs.d.ts +1 -1
  138. package/models/search/search/expressions.d.ts +3 -3
  139. package/models/search/search/util.d.ts +17 -2
  140. package/models/search/transformations/searchresult-to-state.mapper.d.ts +1 -2
  141. package/models/server/features/caching/cacheDuration.schema.d.ts +1 -0
  142. package/models/server/features/linkdepth-api/search.d.ts +1 -1
  143. package/models/server/features/static-assets/index.d.ts +1 -1
  144. package/models/server/internalServer.d.ts +1 -1
  145. package/models/server/util/bundles.d.ts +1 -1
  146. package/models/server/util/headers.d.ts +1 -1
  147. package/models/server/webApp.d.ts +1 -1
  148. package/models/user/components/Login.d.ts +1 -1
  149. package/models/user/components/LoginForm.d.ts +6 -6
  150. package/models/user/components/LogoutForm.d.ts +4 -4
  151. package/models/user/components.styled/Login.styled.d.ts +1 -1
  152. package/models/user/components.styled/LoginForm.styled.d.ts +1 -1
  153. package/models/user/hocs/withLogin.d.ts +4 -4
  154. package/models/user/hooks/useLogin.d.ts +4 -4
  155. package/models/user/redux/actions.d.ts +7 -6
  156. package/models/user/redux/sagas/index.d.ts +1 -1
  157. package/models/user/redux/sagas/login.d.ts +5 -17
  158. package/models/user/redux/selectors.d.ts +1 -2
  159. package/models/user/redux/types.d.ts +21 -21
  160. package/models/user/state.d.ts +12 -0
  161. package/models/user/transformations/mapClientCredentials.d.ts +3 -1
  162. package/models/user/util/ContensisManagementApi.d.ts +10 -9
  163. package/models/user/util/CookieConstants.d.ts +1 -0
  164. package/models/user/util/CookieHelper.class.d.ts +8 -4
  165. package/models/user/util/LoginHelper.class.d.ts +25 -37
  166. package/models/user/util/OidcUserManager.d.ts +1 -1
  167. package/models/user/util/matchGroups.d.ts +1 -1
  168. package/models/util/CachedDeliveryApi.d.ts +11 -10
  169. package/models/util/ContensisDeliveryApi.d.ts +11 -7
  170. package/models/util/SSRContext.d.ts +29 -0
  171. package/models/util/index.d.ts +1 -0
  172. package/models/util/json-mapper.d.ts +4 -5
  173. package/package.json +71 -92
  174. package/cjs/App-b56aca04.js.map +0 -1
  175. package/cjs/ChangePassword.container-ae35785e.js.map +0 -1
  176. package/cjs/ContensisDeliveryApi-4fcf049d.js.map +0 -1
  177. package/cjs/CookieConstants-000427db.js +0 -10
  178. package/cjs/CookieConstants-000427db.js.map +0 -1
  179. package/cjs/RouteLoader-c06dccd5.js.map +0 -1
  180. package/cjs/ToJs-a8d8f3f0.js.map +0 -1
  181. package/cjs/_commonjsHelpers-b3309d7b.js.map +0 -1
  182. package/cjs/forms.js +0 -5998
  183. package/cjs/forms.js.map +0 -1
  184. package/cjs/reducers-73a03ef4.js +0 -257
  185. package/cjs/reducers-73a03ef4.js.map +0 -1
  186. package/cjs/sagas-570f23ba.js +0 -2175
  187. package/cjs/sagas-570f23ba.js.map +0 -1
  188. package/cjs/selectors-14caa813.js +0 -228
  189. package/cjs/selectors-14caa813.js.map +0 -1
  190. package/cjs/version-34d91f68.js.map +0 -1
  191. package/esm/App-83107d7e.js.map +0 -1
  192. package/esm/ChangePassword.container-76fd5e9b.js.map +0 -1
  193. package/esm/ContensisDeliveryApi-fe57a037.js.map +0 -1
  194. package/esm/CookieConstants-3d3b6531.js +0 -6
  195. package/esm/CookieConstants-3d3b6531.js.map +0 -1
  196. package/esm/RouteLoader-29fd689a.js.map +0 -1
  197. package/esm/ToJs-df57f31d.js.map +0 -1
  198. package/esm/_commonjsHelpers-1789f0cf.js.map +0 -1
  199. package/esm/forms.js +0 -5984
  200. package/esm/forms.js.map +0 -1
  201. package/esm/reducers-aa8cef1e.js +0 -234
  202. package/esm/reducers-aa8cef1e.js.map +0 -1
  203. package/esm/sagas-07e82e18.js +0 -2083
  204. package/esm/sagas-07e82e18.js.map +0 -1
  205. package/esm/selectors-691caf02.js +0 -186
  206. package/esm/selectors-691caf02.js.map +0 -1
  207. package/esm/version-3d9911e2.js.map +0 -1
  208. package/models/forms/index.d.ts +0 -1
  209. /package/models/{redux/appstate.d.ts → models/AppState.d.ts} +0 -0
@@ -0,0 +1,555 @@
1
+ const BEARER_TOKEN_COOKIE = 'ContensisSecurityBearerToken';
2
+ const LOGIN_COOKIE = 'ContensisCMSUserName';
3
+ const REFRESH_TOKEN_COOKIE = 'RefreshToken';
4
+ const findLoginCookies = cookies => typeof cookies === 'object' ? Object.fromEntries(Object.entries(cookies).filter(([name]) => [LOGIN_COOKIE, REFRESH_TOKEN_COOKIE].includes(name))) : cookies;
5
+
6
+ var cookie = {};
7
+
8
+ /*!
9
+ * cookie
10
+ * Copyright(c) 2012-2014 Roman Shtylman
11
+ * Copyright(c) 2015 Douglas Christopher Wilson
12
+ * MIT Licensed
13
+ */
14
+
15
+ var hasRequiredCookie;
16
+
17
+ function requireCookie () {
18
+ if (hasRequiredCookie) return cookie;
19
+ hasRequiredCookie = 1;
20
+
21
+ /**
22
+ * Module exports.
23
+ * @public
24
+ */
25
+
26
+ cookie.parse = parse;
27
+ cookie.serialize = serialize;
28
+
29
+ /**
30
+ * Module variables.
31
+ * @private
32
+ */
33
+
34
+ var __toString = Object.prototype.toString;
35
+ var __hasOwnProperty = Object.prototype.hasOwnProperty;
36
+
37
+ /**
38
+ * RegExp to match cookie-name in RFC 6265 sec 4.1.1
39
+ * This refers out to the obsoleted definition of token in RFC 2616 sec 2.2
40
+ * which has been replaced by the token definition in RFC 7230 appendix B.
41
+ *
42
+ * cookie-name = token
43
+ * token = 1*tchar
44
+ * tchar = "!" / "#" / "$" / "%" / "&" / "'" /
45
+ * "*" / "+" / "-" / "." / "^" / "_" /
46
+ * "`" / "|" / "~" / DIGIT / ALPHA
47
+ */
48
+
49
+ var cookieNameRegExp = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
50
+
51
+ /**
52
+ * RegExp to match cookie-value in RFC 6265 sec 4.1.1
53
+ *
54
+ * cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
55
+ * cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
56
+ * ; US-ASCII characters excluding CTLs,
57
+ * ; whitespace DQUOTE, comma, semicolon,
58
+ * ; and backslash
59
+ */
60
+
61
+ var cookieValueRegExp = /^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/;
62
+
63
+ /**
64
+ * RegExp to match domain-value in RFC 6265 sec 4.1.1
65
+ *
66
+ * domain-value = <subdomain>
67
+ * ; defined in [RFC1034], Section 3.5, as
68
+ * ; enhanced by [RFC1123], Section 2.1
69
+ * <subdomain> = <label> | <subdomain> "." <label>
70
+ * <label> = <let-dig> [ [ <ldh-str> ] <let-dig> ]
71
+ * Labels must be 63 characters or less.
72
+ * 'let-dig' not 'letter' in the first char, per RFC1123
73
+ * <ldh-str> = <let-dig-hyp> | <let-dig-hyp> <ldh-str>
74
+ * <let-dig-hyp> = <let-dig> | "-"
75
+ * <let-dig> = <letter> | <digit>
76
+ * <letter> = any one of the 52 alphabetic characters A through Z in
77
+ * upper case and a through z in lower case
78
+ * <digit> = any one of the ten digits 0 through 9
79
+ *
80
+ * Keep support for leading dot: https://github.com/jshttp/cookie/issues/173
81
+ *
82
+ * > (Note that a leading %x2E ("."), if present, is ignored even though that
83
+ * character is not permitted, but a trailing %x2E ("."), if present, will
84
+ * cause the user agent to ignore the attribute.)
85
+ */
86
+
87
+ var domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;
88
+
89
+ /**
90
+ * RegExp to match path-value in RFC 6265 sec 4.1.1
91
+ *
92
+ * path-value = <any CHAR except CTLs or ";">
93
+ * CHAR = %x01-7F
94
+ * ; defined in RFC 5234 appendix B.1
95
+ */
96
+
97
+ var pathValueRegExp = /^[\u0020-\u003A\u003D-\u007E]*$/;
98
+
99
+ /**
100
+ * Parse a cookie header.
101
+ *
102
+ * Parse the given cookie header string into an object
103
+ * The object has the various cookies as keys(names) => values
104
+ *
105
+ * @param {string} str
106
+ * @param {object} [opt]
107
+ * @return {object}
108
+ * @public
109
+ */
110
+
111
+ function parse(str, opt) {
112
+ if (typeof str !== 'string') {
113
+ throw new TypeError('argument str must be a string');
114
+ }
115
+
116
+ var obj = {};
117
+ var len = str.length;
118
+ // RFC 6265 sec 4.1.1, RFC 2616 2.2 defines a cookie name consists of one char minimum, plus '='.
119
+ if (len < 2) return obj;
120
+
121
+ var dec = (opt && opt.decode) || decode;
122
+ var index = 0;
123
+ var eqIdx = 0;
124
+ var endIdx = 0;
125
+
126
+ do {
127
+ eqIdx = str.indexOf('=', index);
128
+ if (eqIdx === -1) break; // No more cookie pairs.
129
+
130
+ endIdx = str.indexOf(';', index);
131
+
132
+ if (endIdx === -1) {
133
+ endIdx = len;
134
+ } else if (eqIdx > endIdx) {
135
+ // backtrack on prior semicolon
136
+ index = str.lastIndexOf(';', eqIdx - 1) + 1;
137
+ continue;
138
+ }
139
+
140
+ var keyStartIdx = startIndex(str, index, eqIdx);
141
+ var keyEndIdx = endIndex(str, eqIdx, keyStartIdx);
142
+ var key = str.slice(keyStartIdx, keyEndIdx);
143
+
144
+ // only assign once
145
+ if (!__hasOwnProperty.call(obj, key)) {
146
+ var valStartIdx = startIndex(str, eqIdx + 1, endIdx);
147
+ var valEndIdx = endIndex(str, endIdx, valStartIdx);
148
+
149
+ if (str.charCodeAt(valStartIdx) === 0x22 /* " */ && str.charCodeAt(valEndIdx - 1) === 0x22 /* " */) {
150
+ valStartIdx++;
151
+ valEndIdx--;
152
+ }
153
+
154
+ var val = str.slice(valStartIdx, valEndIdx);
155
+ obj[key] = tryDecode(val, dec);
156
+ }
157
+
158
+ index = endIdx + 1;
159
+ } while (index < len);
160
+
161
+ return obj;
162
+ }
163
+
164
+ function startIndex(str, index, max) {
165
+ do {
166
+ var code = str.charCodeAt(index);
167
+ if (code !== 0x20 /* */ && code !== 0x09 /* \t */) return index;
168
+ } while (++index < max);
169
+ return max;
170
+ }
171
+
172
+ function endIndex(str, index, min) {
173
+ while (index > min) {
174
+ var code = str.charCodeAt(--index);
175
+ if (code !== 0x20 /* */ && code !== 0x09 /* \t */) return index + 1;
176
+ }
177
+ return min;
178
+ }
179
+
180
+ /**
181
+ * Serialize data into a cookie header.
182
+ *
183
+ * Serialize a name value pair into a cookie string suitable for
184
+ * http headers. An optional options object specifies cookie parameters.
185
+ *
186
+ * serialize('foo', 'bar', { httpOnly: true })
187
+ * => "foo=bar; httpOnly"
188
+ *
189
+ * @param {string} name
190
+ * @param {string} val
191
+ * @param {object} [opt]
192
+ * @return {string}
193
+ * @public
194
+ */
195
+
196
+ function serialize(name, val, opt) {
197
+ var enc = (opt && opt.encode) || encodeURIComponent;
198
+
199
+ if (typeof enc !== 'function') {
200
+ throw new TypeError('option encode is invalid');
201
+ }
202
+
203
+ if (!cookieNameRegExp.test(name)) {
204
+ throw new TypeError('argument name is invalid');
205
+ }
206
+
207
+ var value = enc(val);
208
+
209
+ if (!cookieValueRegExp.test(value)) {
210
+ throw new TypeError('argument val is invalid');
211
+ }
212
+
213
+ var str = name + '=' + value;
214
+ if (!opt) return str;
215
+
216
+ if (null != opt.maxAge) {
217
+ var maxAge = Math.floor(opt.maxAge);
218
+
219
+ if (!isFinite(maxAge)) {
220
+ throw new TypeError('option maxAge is invalid')
221
+ }
222
+
223
+ str += '; Max-Age=' + maxAge;
224
+ }
225
+
226
+ if (opt.domain) {
227
+ if (!domainValueRegExp.test(opt.domain)) {
228
+ throw new TypeError('option domain is invalid');
229
+ }
230
+
231
+ str += '; Domain=' + opt.domain;
232
+ }
233
+
234
+ if (opt.path) {
235
+ if (!pathValueRegExp.test(opt.path)) {
236
+ throw new TypeError('option path is invalid');
237
+ }
238
+
239
+ str += '; Path=' + opt.path;
240
+ }
241
+
242
+ if (opt.expires) {
243
+ var expires = opt.expires;
244
+
245
+ if (!isDate(expires) || isNaN(expires.valueOf())) {
246
+ throw new TypeError('option expires is invalid');
247
+ }
248
+
249
+ str += '; Expires=' + expires.toUTCString();
250
+ }
251
+
252
+ if (opt.httpOnly) {
253
+ str += '; HttpOnly';
254
+ }
255
+
256
+ if (opt.secure) {
257
+ str += '; Secure';
258
+ }
259
+
260
+ if (opt.partitioned) {
261
+ str += '; Partitioned';
262
+ }
263
+
264
+ if (opt.priority) {
265
+ var priority = typeof opt.priority === 'string'
266
+ ? opt.priority.toLowerCase() : opt.priority;
267
+
268
+ switch (priority) {
269
+ case 'low':
270
+ str += '; Priority=Low';
271
+ break
272
+ case 'medium':
273
+ str += '; Priority=Medium';
274
+ break
275
+ case 'high':
276
+ str += '; Priority=High';
277
+ break
278
+ default:
279
+ throw new TypeError('option priority is invalid')
280
+ }
281
+ }
282
+
283
+ if (opt.sameSite) {
284
+ var sameSite = typeof opt.sameSite === 'string'
285
+ ? opt.sameSite.toLowerCase() : opt.sameSite;
286
+
287
+ switch (sameSite) {
288
+ case true:
289
+ str += '; SameSite=Strict';
290
+ break;
291
+ case 'lax':
292
+ str += '; SameSite=Lax';
293
+ break;
294
+ case 'strict':
295
+ str += '; SameSite=Strict';
296
+ break;
297
+ case 'none':
298
+ str += '; SameSite=None';
299
+ break;
300
+ default:
301
+ throw new TypeError('option sameSite is invalid');
302
+ }
303
+ }
304
+
305
+ return str;
306
+ }
307
+
308
+ /**
309
+ * URL-decode string value. Optimized to skip native call when no %.
310
+ *
311
+ * @param {string} str
312
+ * @returns {string}
313
+ */
314
+
315
+ function decode (str) {
316
+ return str.indexOf('%') !== -1
317
+ ? decodeURIComponent(str)
318
+ : str
319
+ }
320
+
321
+ /**
322
+ * Determine if value is a Date.
323
+ *
324
+ * @param {*} val
325
+ * @private
326
+ */
327
+
328
+ function isDate (val) {
329
+ return __toString.call(val) === '[object Date]';
330
+ }
331
+
332
+ /**
333
+ * Try decoding a string using a decoding function.
334
+ *
335
+ * @param {string} str
336
+ * @param {function} decode
337
+ * @private
338
+ */
339
+
340
+ function tryDecode(str, decode) {
341
+ try {
342
+ return decode(str);
343
+ } catch (e) {
344
+ return str;
345
+ }
346
+ }
347
+ return cookie;
348
+ }
349
+
350
+ var cookieExports = requireCookie();
351
+
352
+ function hasDocumentCookie() {
353
+ const testingValue = typeof global === 'undefined'
354
+ ? undefined
355
+ : global.TEST_HAS_DOCUMENT_COOKIE;
356
+ if (typeof testingValue === 'boolean') {
357
+ return testingValue;
358
+ }
359
+ // Can we get/set cookies on document.cookie?
360
+ return typeof document === 'object' && typeof document.cookie === 'string';
361
+ }
362
+ function parseCookies(cookies) {
363
+ if (typeof cookies === 'string') {
364
+ return cookieExports.parse(cookies);
365
+ }
366
+ else if (typeof cookies === 'object' && cookies !== null) {
367
+ return cookies;
368
+ }
369
+ else {
370
+ return {};
371
+ }
372
+ }
373
+ function readCookie(value, options = {}) {
374
+ const cleanValue = cleanupCookieValue(value);
375
+ if (!options.doNotParse) {
376
+ try {
377
+ return JSON.parse(cleanValue);
378
+ }
379
+ catch (e) {
380
+ // At least we tried
381
+ }
382
+ }
383
+ // Ignore clean value if we failed the deserialization
384
+ // It is not relevant anymore to trim those values
385
+ return value;
386
+ }
387
+ function cleanupCookieValue(value) {
388
+ // express prepend j: before serializing a cookie
389
+ if (value && value[0] === 'j' && value[1] === ':') {
390
+ return value.substr(2);
391
+ }
392
+ return value;
393
+ }
394
+
395
+ class Cookies {
396
+ constructor(cookies, defaultSetOptions = {}) {
397
+ this.changeListeners = [];
398
+ this.HAS_DOCUMENT_COOKIE = false;
399
+ this.update = () => {
400
+ if (!this.HAS_DOCUMENT_COOKIE) {
401
+ return;
402
+ }
403
+ const previousCookies = this.cookies;
404
+ this.cookies = cookieExports.parse(document.cookie);
405
+ this._checkChanges(previousCookies);
406
+ };
407
+ const domCookies = typeof document === 'undefined' ? '' : document.cookie;
408
+ this.cookies = parseCookies(cookies || domCookies);
409
+ this.defaultSetOptions = defaultSetOptions;
410
+ this.HAS_DOCUMENT_COOKIE = hasDocumentCookie();
411
+ }
412
+ _emitChange(params) {
413
+ for (let i = 0; i < this.changeListeners.length; ++i) {
414
+ this.changeListeners[i](params);
415
+ }
416
+ }
417
+ _checkChanges(previousCookies) {
418
+ const names = new Set(Object.keys(previousCookies).concat(Object.keys(this.cookies)));
419
+ names.forEach((name) => {
420
+ if (previousCookies[name] !== this.cookies[name]) {
421
+ this._emitChange({
422
+ name,
423
+ value: readCookie(this.cookies[name]),
424
+ });
425
+ }
426
+ });
427
+ }
428
+ _startPolling() {
429
+ this.pollingInterval = setInterval(this.update, 300);
430
+ }
431
+ _stopPolling() {
432
+ if (this.pollingInterval) {
433
+ clearInterval(this.pollingInterval);
434
+ }
435
+ }
436
+ get(name, options = {}) {
437
+ if (!options.doNotUpdate) {
438
+ this.update();
439
+ }
440
+ return readCookie(this.cookies[name], options);
441
+ }
442
+ getAll(options = {}) {
443
+ if (!options.doNotUpdate) {
444
+ this.update();
445
+ }
446
+ const result = {};
447
+ for (let name in this.cookies) {
448
+ result[name] = readCookie(this.cookies[name], options);
449
+ }
450
+ return result;
451
+ }
452
+ set(name, value, options) {
453
+ if (options) {
454
+ options = Object.assign(Object.assign({}, this.defaultSetOptions), options);
455
+ }
456
+ else {
457
+ options = this.defaultSetOptions;
458
+ }
459
+ const stringValue = typeof value === 'string' ? value : JSON.stringify(value);
460
+ this.cookies = Object.assign(Object.assign({}, this.cookies), { [name]: stringValue });
461
+ if (this.HAS_DOCUMENT_COOKIE) {
462
+ document.cookie = cookieExports.serialize(name, stringValue, options);
463
+ }
464
+ this._emitChange({ name, value, options });
465
+ }
466
+ remove(name, options) {
467
+ const finalOptions = (options = Object.assign(Object.assign(Object.assign({}, this.defaultSetOptions), options), { expires: new Date(1970, 1, 1, 0, 0, 1), maxAge: 0 }));
468
+ this.cookies = Object.assign({}, this.cookies);
469
+ delete this.cookies[name];
470
+ if (this.HAS_DOCUMENT_COOKIE) {
471
+ document.cookie = cookieExports.serialize(name, '', finalOptions);
472
+ }
473
+ this._emitChange({ name, value: undefined, options });
474
+ }
475
+ addChangeListener(callback) {
476
+ this.changeListeners.push(callback);
477
+ if (this.HAS_DOCUMENT_COOKIE && this.changeListeners.length === 1) {
478
+ if (typeof window === 'object' && 'cookieStore' in window) {
479
+ window.cookieStore.addEventListener('change', this.update);
480
+ }
481
+ else {
482
+ this._startPolling();
483
+ }
484
+ }
485
+ }
486
+ removeChangeListener(callback) {
487
+ const idx = this.changeListeners.indexOf(callback);
488
+ if (idx >= 0) {
489
+ this.changeListeners.splice(idx, 1);
490
+ }
491
+ if (this.HAS_DOCUMENT_COOKIE && this.changeListeners.length === 0) {
492
+ if (typeof window === 'object' && 'cookieStore' in window) {
493
+ window.cookieStore.removeEventListener('change', this.update);
494
+ }
495
+ else {
496
+ this._stopPolling();
497
+ }
498
+ }
499
+ }
500
+ }
501
+
502
+ const COOKIE_VALID_DAYS = 1; // 0 = Session cookie
503
+
504
+ // CookieHelper is a class that takes in and lets us pass around the methods provided
505
+ // by `useCookie` react hook in backend code that is connected to the universal-cookies
506
+ // instance created in SSR middleware (and provides browser cookies)
507
+ class CookieHelper {
508
+ get raw() {
509
+ return this.cookies;
510
+ }
511
+ get cookie() {
512
+ return this.set ? this : this.fallback;
513
+ }
514
+ constructor(cookies, setCookie, removeCookie, updateCookies) {
515
+ // Add fallback methods if global cookies not supplied
516
+ if (!cookies || !setCookie || !removeCookie) this.fallback = new Cookies();
517
+ this.cookies = cookies || this.fallback.getAll();
518
+ if (setCookie) this.set = setCookie;
519
+ if (removeCookie) this.remove = removeCookie;
520
+ if (updateCookies) this.update = updateCookies;
521
+ }
522
+ GetCookie(name) {
523
+ const cookie = this.cookies[name];
524
+ if (typeof cookie === 'undefined') {
525
+ return null;
526
+ }
527
+ return cookie;
528
+ }
529
+ SetCookie(name, value, maxAgeDays = COOKIE_VALID_DAYS) {
530
+ // update local cookies object as this is provided as a clone of `req.universalCookies`
531
+ this.cookies[name] = value;
532
+
533
+ // call the passed setCookie method so we can update the `universal-cookie` instance
534
+ // with the change listener attached so the cookies can be set in SSR response
535
+ if (maxAgeDays === 0) this.cookie.set(name, value);else this.cookie.set(name, value, {
536
+ expires: addDays(new Date(), maxAgeDays),
537
+ path: '/'
538
+ });
539
+ }
540
+ DeleteCookie(name) {
541
+ // update local cookies object as this is provided as a clone of `req.universalCookies`
542
+ delete this.cookies[name];
543
+ this.cookie.remove(name, {
544
+ path: '/'
545
+ });
546
+ }
547
+ }
548
+ const addDays = (date = new Date(), days) => {
549
+ const result = new Date(date);
550
+ result.setDate(result.getDate() + days);
551
+ return result;
552
+ };
553
+
554
+ export { BEARER_TOKEN_COOKIE as B, CookieHelper as C, LOGIN_COOKIE as L, REFRESH_TOKEN_COOKIE as R, Cookies as a, findLoginCookies as f };
555
+ //# sourceMappingURL=CookieHelper.class-DzleKOOc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CookieHelper.class-DzleKOOc.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 cookie = {};\n\n/*!\n * cookie\n * Copyright(c) 2012-2014 Roman Shtylman\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\nvar hasRequiredCookie;\n\nfunction requireCookie () {\n\tif (hasRequiredCookie) return cookie;\n\thasRequiredCookie = 1;\n\n\t/**\n\t * Module exports.\n\t * @public\n\t */\n\n\tcookie.parse = parse;\n\tcookie.serialize = serialize;\n\n\t/**\n\t * Module variables.\n\t * @private\n\t */\n\n\tvar __toString = Object.prototype.toString;\n\tvar __hasOwnProperty = Object.prototype.hasOwnProperty;\n\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\n\tvar cookieNameRegExp = /^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$/;\n\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\n\tvar cookieValueRegExp = /^(\"?)[\\u0021\\u0023-\\u002B\\u002D-\\u003A\\u003C-\\u005B\\u005D-\\u007E]*\\1$/;\n\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\n\tvar 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\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\n\tvar pathValueRegExp = /^[\\u0020-\\u003A\\u003D-\\u007E]*$/;\n\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\t * @param {string} str\n\t * @param {object} [opt]\n\t * @return {object}\n\t * @public\n\t */\n\n\tfunction parse(str, opt) {\n\t if (typeof str !== 'string') {\n\t throw new TypeError('argument str must be a string');\n\t }\n\n\t var obj = {};\n\t var 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) return obj;\n\n\t var dec = (opt && opt.decode) || decode;\n\t var index = 0;\n\t var eqIdx = 0;\n\t var endIdx = 0;\n\n\t do {\n\t eqIdx = str.indexOf('=', index);\n\t if (eqIdx === -1) break; // No more cookie pairs.\n\n\t endIdx = str.indexOf(';', index);\n\n\t if (endIdx === -1) {\n\t endIdx = len;\n\t } else if (eqIdx > endIdx) {\n\t // backtrack on prior semicolon\n\t index = str.lastIndexOf(';', eqIdx - 1) + 1;\n\t continue;\n\t }\n\n\t var keyStartIdx = startIndex(str, index, eqIdx);\n\t var keyEndIdx = endIndex(str, eqIdx, keyStartIdx);\n\t var key = str.slice(keyStartIdx, keyEndIdx);\n\n\t // only assign once\n\t if (!__hasOwnProperty.call(obj, key)) {\n\t var valStartIdx = startIndex(str, eqIdx + 1, endIdx);\n\t var valEndIdx = endIndex(str, endIdx, valStartIdx);\n\n\t if (str.charCodeAt(valStartIdx) === 0x22 /* \" */ && str.charCodeAt(valEndIdx - 1) === 0x22 /* \" */) {\n\t valStartIdx++;\n\t valEndIdx--;\n\t }\n\n\t var val = str.slice(valStartIdx, valEndIdx);\n\t obj[key] = tryDecode(val, dec);\n\t }\n\n\t index = endIdx + 1;\n\t } while (index < len);\n\n\t return obj;\n\t}\n\n\tfunction startIndex(str, index, max) {\n\t do {\n\t var code = str.charCodeAt(index);\n\t if (code !== 0x20 /* */ && code !== 0x09 /* \\t */) return index;\n\t } while (++index < max);\n\t return max;\n\t}\n\n\tfunction endIndex(str, index, min) {\n\t while (index > min) {\n\t var code = str.charCodeAt(--index);\n\t if (code !== 0x20 /* */ && code !== 0x09 /* \\t */) return index + 1;\n\t }\n\t return min;\n\t}\n\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\t * @param {string} name\n\t * @param {string} val\n\t * @param {object} [opt]\n\t * @return {string}\n\t * @public\n\t */\n\n\tfunction serialize(name, val, opt) {\n\t var enc = (opt && opt.encode) || encodeURIComponent;\n\n\t if (typeof enc !== 'function') {\n\t throw new TypeError('option encode is invalid');\n\t }\n\n\t if (!cookieNameRegExp.test(name)) {\n\t throw new TypeError('argument name is invalid');\n\t }\n\n\t var value = enc(val);\n\n\t if (!cookieValueRegExp.test(value)) {\n\t throw new TypeError('argument val is invalid');\n\t }\n\n\t var str = name + '=' + value;\n\t if (!opt) return str;\n\n\t if (null != opt.maxAge) {\n\t var maxAge = Math.floor(opt.maxAge);\n\n\t if (!isFinite(maxAge)) {\n\t throw new TypeError('option maxAge is invalid')\n\t }\n\n\t str += '; Max-Age=' + maxAge;\n\t }\n\n\t if (opt.domain) {\n\t if (!domainValueRegExp.test(opt.domain)) {\n\t throw new TypeError('option domain is invalid');\n\t }\n\n\t str += '; Domain=' + opt.domain;\n\t }\n\n\t if (opt.path) {\n\t if (!pathValueRegExp.test(opt.path)) {\n\t throw new TypeError('option path is invalid');\n\t }\n\n\t str += '; Path=' + opt.path;\n\t }\n\n\t if (opt.expires) {\n\t var expires = opt.expires;\n\n\t if (!isDate(expires) || isNaN(expires.valueOf())) {\n\t throw new TypeError('option expires is invalid');\n\t }\n\n\t str += '; Expires=' + expires.toUTCString();\n\t }\n\n\t if (opt.httpOnly) {\n\t str += '; HttpOnly';\n\t }\n\n\t if (opt.secure) {\n\t str += '; Secure';\n\t }\n\n\t if (opt.partitioned) {\n\t str += '; Partitioned';\n\t }\n\n\t if (opt.priority) {\n\t var priority = typeof opt.priority === 'string'\n\t ? opt.priority.toLowerCase() : opt.priority;\n\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')\n\t }\n\t }\n\n\t if (opt.sameSite) {\n\t var sameSite = typeof opt.sameSite === 'string'\n\t ? opt.sameSite.toLowerCase() : opt.sameSite;\n\n\t switch (sameSite) {\n\t case true:\n\t str += '; SameSite=Strict';\n\t break;\n\t case 'lax':\n\t str += '; SameSite=Lax';\n\t break;\n\t case 'strict':\n\t str += '; SameSite=Strict';\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');\n\t }\n\t }\n\n\t return str;\n\t}\n\n\t/**\n\t * URL-decode string value. Optimized to skip native call when no %.\n\t *\n\t * @param {string} str\n\t * @returns {string}\n\t */\n\n\tfunction decode (str) {\n\t return str.indexOf('%') !== -1\n\t ? decodeURIComponent(str)\n\t : str\n\t}\n\n\t/**\n\t * Determine if value is a Date.\n\t *\n\t * @param {*} val\n\t * @private\n\t */\n\n\tfunction isDate (val) {\n\t return __toString.call(val) === '[object Date]';\n\t}\n\n\t/**\n\t * Try decoding a string using a decoding function.\n\t *\n\t * @param {string} str\n\t * @param {function} decode\n\t * @private\n\t */\n\n\tfunction tryDecode(str, decode) {\n\t try {\n\t return decode(str);\n\t } catch (e) {\n\t return str;\n\t }\n\t}\n\treturn cookie;\n}\n\nvar cookieExports = requireCookie();\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 cookieExports.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 = cookieExports.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 = cookieExports.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 = cookieExports.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}\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,CAACH,OAAO,CAAC,CAACI,MAAM,CAAC,CAAC,CAACC,IAAI,CAAC,KACpC,CAACR,YAAY,EAAEC,oBAAoB,CAAC,CAACQ,QAAQ,CAACD,IAAI,CACpD,CACF,CAAC,GACDL;;ACbN,IAAI,MAAM,GAAG,EAAE;;AAEf;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAI,iBAAiB;;AAErB,SAAS,aAAa,IAAI;AAC1B,CAAC,IAAI,iBAAiB,EAAE,OAAO,MAAM;AACrC,CAAC,iBAAiB,GAAG,CAAC;;AAEtB;AACA;AACA;AACA;;AAEA,CAAC,MAAM,CAAC,KAAK,GAAG,KAAK;AACrB,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS;;AAE7B;AACA;AACA;AACA;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