@mjhls/mjh-framework 1.0.1023-blanktagremoval-v1 → 1.0.1023

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 (184) hide show
  1. package/README.md +168 -168
  2. package/dist/cjs/AD300x250.js +1 -1
  3. package/dist/cjs/AD300x250x600.js +1 -1
  4. package/dist/cjs/AD728x90.js +1 -1
  5. package/dist/cjs/ADFloatingFooter.js +1 -1
  6. package/dist/cjs/ADGutter.js +1 -1
  7. package/dist/cjs/{ADInfeed-89488c41.js → ADInfeed-5dabd71d.js} +1 -1
  8. package/dist/cjs/ADSkyscraper.js +1 -1
  9. package/dist/cjs/ADSponsoredResources.js +1 -1
  10. package/dist/cjs/ADWebcast.js +1 -1
  11. package/dist/cjs/ADWelcome.js +1 -1
  12. package/dist/cjs/{ADlgInfeed-9d62050b.js → ADlgInfeed-1766ce0a.js} +1 -1
  13. package/dist/cjs/AdSlot.js +1 -1
  14. package/dist/cjs/AdSlotsProvider.js +1 -1
  15. package/dist/cjs/AlgoliaSearch.js +1 -1
  16. package/dist/cjs/ArticleCarousel.js +1 -1
  17. package/dist/cjs/ArticleProgramLandingPage.js +3 -3
  18. package/dist/cjs/ArticleSeriesLandingPage.js +3 -3
  19. package/dist/cjs/ArticleSeriesListing.js +1 -1
  20. package/dist/cjs/Auth.js +11 -1493
  21. package/dist/cjs/AuthWrapper.js +294 -1484
  22. package/dist/cjs/CEDeckSupabase.js +2 -2
  23. package/dist/cjs/CMEDeck.js +1 -1
  24. package/dist/cjs/Column2.js +2 -4
  25. package/dist/cjs/Column3.js +1 -1
  26. package/dist/cjs/ConferenceArticleCard.js +15 -15
  27. package/dist/cjs/ContentCardPaginated.js +3 -3
  28. package/dist/cjs/DeckContent.js +11 -11
  29. package/dist/cjs/DeckQueue.js +2 -2
  30. package/dist/cjs/DeckQueuePaginated.js +2 -2
  31. package/dist/cjs/EventsDeck.js +18 -18
  32. package/dist/cjs/ExternalResources.js +6 -6
  33. package/dist/cjs/Feature.js +1 -1
  34. package/dist/cjs/GridContent.js +4 -4
  35. package/dist/cjs/GridContentPaginated.js +4 -4
  36. package/dist/cjs/GridHero.js +1 -1
  37. package/dist/cjs/HamMagazine.js +50 -52
  38. package/dist/cjs/HealthCareProfessionalModal.js +1 -1
  39. package/dist/cjs/Hero.js +1 -1
  40. package/dist/cjs/HorizontalArticleListing.js +3 -3
  41. package/dist/cjs/{ImageSlider-50807a77.js → ImageSlider-fd0cc91c.js} +145 -83
  42. package/dist/cjs/IssueLanding.js +34 -34
  43. package/dist/cjs/KMTracker.js +15 -15
  44. package/dist/cjs/LeftNav.js +15 -14
  45. package/dist/cjs/MasterDeck.js +11 -11
  46. package/dist/cjs/MasterDeckPaginated.js +11 -11
  47. package/dist/cjs/{MediaSeriesCard-de7f7fcc.js → MediaSeriesCard-ae205d40.js} +2 -2
  48. package/dist/cjs/MediaSeriesLanding.js +13 -13
  49. package/dist/cjs/MediaSeriesLandingPaginated.js +13 -13
  50. package/dist/cjs/NavDvm.js +28 -30
  51. package/dist/cjs/{NavFooter-b37e3eed.js → NavFooter-257b5318.js} +3 -4
  52. package/dist/cjs/NavMagazine.js +53 -55
  53. package/dist/cjs/NavNative.js +55 -55
  54. package/dist/cjs/OncliveLargeHero.js +1 -1
  55. package/dist/cjs/PartnerDetailListing.js +28 -40
  56. package/dist/cjs/PartnerDetailListingPaginated.js +32 -38
  57. package/dist/cjs/PodcastsLanding.js +6 -6
  58. package/dist/cjs/PubSection.js +4 -4
  59. package/dist/cjs/PublicationLanding.js +26 -26
  60. package/dist/cjs/QueueDeckExpanded.js +4 -4
  61. package/dist/cjs/QueueDeckExpandedPaginated.js +4 -4
  62. package/dist/cjs/RelatedContent.js +28 -28
  63. package/dist/cjs/RelatedTopicsDropdown.js +10 -10
  64. package/dist/cjs/SeriesListingDeck.js +2 -2
  65. package/dist/cjs/{SeriesSlider-fc6dd07d.js → SeriesSlider-0b2a2775.js} +5 -5
  66. package/dist/cjs/SideFooter.js +9 -11
  67. package/dist/cjs/{SocialSearchComponent-15e03760.js → SocialSearchComponent-6924a853.js} +2 -2
  68. package/dist/cjs/TaxonomyCard.js +8 -8
  69. package/dist/cjs/TaxonomyDescription.js +3 -3
  70. package/dist/cjs/TemplateNormal.js +4 -4
  71. package/dist/cjs/ThumbnailCard.js +1 -1
  72. package/dist/cjs/{Tooltip-8011d690.js → Tooltip-980a1d1a.js} +116 -291
  73. package/dist/cjs/Ustream.js +1 -1
  74. package/dist/cjs/VideoProgramLandingPage.js +3 -3
  75. package/dist/cjs/VideoSeriesCard.js +1 -1
  76. package/dist/cjs/VideoSeriesLandingPage.js +3 -3
  77. package/dist/cjs/VideoSeriesListing.js +1 -1
  78. package/dist/cjs/View.js +8 -8
  79. package/dist/cjs/YahooHero.js +1 -1
  80. package/dist/cjs/YoutubeGroup.js +5 -5
  81. package/dist/cjs/{entities-df1aed86.js → entities-3f9d0f2f.js} +0 -4
  82. package/dist/cjs/getRelatedArticle.js +1 -1
  83. package/dist/cjs/getSerializers.js +3 -3
  84. package/dist/cjs/{getTargeting-ba942d9a.js → getTargeting-4439c99d.js} +9 -9
  85. package/dist/cjs/getTargeting.js +1 -1
  86. package/dist/cjs/{index-50be6759.js → index-8041a4eb.js} +9 -15
  87. package/dist/cjs/{index-3111bc4e.js → index-b78ce702.js} +2 -2
  88. package/dist/cjs/{index-3cd60d26.js → index-bd6c9f56.js} +11 -11
  89. package/dist/cjs/{index.esm-bb54403e.js → index.esm-91e651b0.js} +7 -8
  90. package/dist/cjs/index.js +14 -14
  91. package/dist/cjs/{main-ae8472f3.js → main-47be4f9f.js} +9 -4
  92. package/dist/esm/AD300x250.js +1 -1
  93. package/dist/esm/AD300x250x600.js +1 -1
  94. package/dist/esm/AD728x90.js +1 -1
  95. package/dist/esm/ADFloatingFooter.js +1 -1
  96. package/dist/esm/ADGutter.js +1 -1
  97. package/dist/esm/{ADInfeed-fb3b056f.js → ADInfeed-cfc4f7b2.js} +1 -1
  98. package/dist/esm/ADSkyscraper.js +1 -1
  99. package/dist/esm/ADSponsoredResources.js +1 -1
  100. package/dist/esm/ADWebcast.js +1 -1
  101. package/dist/esm/ADWelcome.js +1 -1
  102. package/dist/esm/{ADlgInfeed-29f7b84c.js → ADlgInfeed-74c975b9.js} +1 -1
  103. package/dist/esm/AdSlot.js +1 -1
  104. package/dist/esm/AdSlotsProvider.js +1 -1
  105. package/dist/esm/AlgoliaSearch.js +1 -1
  106. package/dist/esm/ArticleCarousel.js +1 -1
  107. package/dist/esm/ArticleProgramLandingPage.js +3 -3
  108. package/dist/esm/ArticleSeriesLandingPage.js +3 -3
  109. package/dist/esm/ArticleSeriesListing.js +1 -1
  110. package/dist/esm/Auth.js +10 -1493
  111. package/dist/esm/AuthWrapper.js +288 -1478
  112. package/dist/esm/CEDeckSupabase.js +2 -2
  113. package/dist/esm/CMEDeck.js +1 -1
  114. package/dist/esm/Column2.js +2 -4
  115. package/dist/esm/Column3.js +1 -1
  116. package/dist/esm/ConferenceArticleCard.js +15 -15
  117. package/dist/esm/ContentCardPaginated.js +3 -3
  118. package/dist/esm/DeckContent.js +11 -11
  119. package/dist/esm/DeckQueue.js +2 -2
  120. package/dist/esm/DeckQueuePaginated.js +2 -2
  121. package/dist/esm/EventsDeck.js +18 -18
  122. package/dist/esm/ExternalResources.js +6 -6
  123. package/dist/esm/Feature.js +1 -1
  124. package/dist/esm/GridContent.js +4 -4
  125. package/dist/esm/GridContentPaginated.js +4 -4
  126. package/dist/esm/GridHero.js +1 -1
  127. package/dist/esm/HamMagazine.js +50 -52
  128. package/dist/esm/HealthCareProfessionalModal.js +1 -1
  129. package/dist/esm/Hero.js +1 -1
  130. package/dist/esm/HorizontalArticleListing.js +3 -3
  131. package/dist/esm/{ImageSlider-cdb57d30.js → ImageSlider-c3a57384.js} +63 -1
  132. package/dist/esm/IssueLanding.js +34 -34
  133. package/dist/esm/KMTracker.js +15 -15
  134. package/dist/esm/LeftNav.js +15 -14
  135. package/dist/esm/MasterDeck.js +11 -11
  136. package/dist/esm/MasterDeckPaginated.js +11 -11
  137. package/dist/esm/{MediaSeriesCard-8ec69f60.js → MediaSeriesCard-957b218d.js} +2 -2
  138. package/dist/esm/MediaSeriesLanding.js +13 -13
  139. package/dist/esm/MediaSeriesLandingPaginated.js +13 -13
  140. package/dist/esm/NavDvm.js +28 -30
  141. package/dist/esm/{NavFooter-37c5eea2.js → NavFooter-27a16f65.js} +3 -4
  142. package/dist/esm/NavMagazine.js +53 -55
  143. package/dist/esm/NavNative.js +55 -55
  144. package/dist/esm/OncliveLargeHero.js +1 -1
  145. package/dist/esm/PartnerDetailListing.js +28 -40
  146. package/dist/esm/PartnerDetailListingPaginated.js +32 -38
  147. package/dist/esm/PodcastsLanding.js +6 -6
  148. package/dist/esm/PubSection.js +4 -4
  149. package/dist/esm/PublicationLanding.js +26 -26
  150. package/dist/esm/QueueDeckExpanded.js +4 -4
  151. package/dist/esm/QueueDeckExpandedPaginated.js +4 -4
  152. package/dist/esm/RelatedContent.js +28 -28
  153. package/dist/esm/RelatedTopicsDropdown.js +10 -10
  154. package/dist/esm/SeriesListingDeck.js +2 -2
  155. package/dist/esm/{SeriesSlider-771918ce.js → SeriesSlider-3f4d6012.js} +5 -5
  156. package/dist/esm/SideFooter.js +9 -11
  157. package/dist/esm/{SocialSearchComponent-b102181b.js → SocialSearchComponent-2451acd2.js} +2 -2
  158. package/dist/esm/TaxonomyCard.js +8 -8
  159. package/dist/esm/TaxonomyDescription.js +3 -3
  160. package/dist/esm/TemplateNormal.js +4 -4
  161. package/dist/esm/ThumbnailCard.js +1 -1
  162. package/dist/esm/{Tooltip-2cdd0895.js → Tooltip-51957f7c.js} +116 -291
  163. package/dist/esm/Ustream.js +1 -1
  164. package/dist/esm/VideoProgramLandingPage.js +3 -3
  165. package/dist/esm/VideoSeriesCard.js +1 -1
  166. package/dist/esm/VideoSeriesLandingPage.js +3 -3
  167. package/dist/esm/VideoSeriesListing.js +1 -1
  168. package/dist/esm/View.js +8 -8
  169. package/dist/esm/YahooHero.js +1 -1
  170. package/dist/esm/YoutubeGroup.js +5 -5
  171. package/dist/esm/{entities-6d9154b4.js → entities-932b50cf.js} +0 -4
  172. package/dist/esm/getRelatedArticle.js +1 -1
  173. package/dist/esm/getSerializers.js +3 -3
  174. package/dist/esm/{getTargeting-9bd28724.js → getTargeting-c6884f34.js} +9 -9
  175. package/dist/esm/getTargeting.js +1 -1
  176. package/dist/esm/{index-98ca9cec.js → index-67e1773f.js} +9 -15
  177. package/dist/esm/{index-0a63f9a3.js → index-db3bb315.js} +11 -11
  178. package/dist/esm/{index-a71a6cc7.js → index-f2f5b752.js} +2 -2
  179. package/dist/esm/{index.esm-8639823a.js → index.esm-06bf63a3.js} +7 -8
  180. package/dist/esm/index.js +14 -14
  181. package/dist/esm/{main-754d4992.js → main-f97773b2.js} +9 -4
  182. package/package.json +116 -116
  183. package/dist/cjs/defineProperty-19580e93.js +0 -71
  184. package/dist/esm/defineProperty-e8022d1e.js +0 -66
@@ -1,895 +1,11 @@
1
1
  import { _ as _slicedToArray } from './slicedToArray-6ebcbfea.js';
2
2
  import { c as createCommonjsModule, u as unwrapExports } from './_commonjsHelpers-0c4b6f40.js';
3
- import { d as defineProperty, b as asyncToGenerator } from './defineProperty-e8022d1e.js';
4
3
  import React__default, { useState, useEffect } from 'react';
5
4
  import { Form } from 'react-bootstrap';
6
5
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
7
6
  import './web.dom.iterable-ab4dea5c.js';
8
7
  import './core.get-iterator-method-ea258bb1.js';
9
8
 
10
- var interopRequireDefault = createCommonjsModule(function (module) {
11
- function _interopRequireDefault(obj) {
12
- return obj && obj.__esModule ? obj : {
13
- "default": obj
14
- };
15
- }
16
-
17
- module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
18
- });
19
-
20
- unwrapExports(interopRequireDefault);
21
-
22
- var _typeof_1 = createCommonjsModule(function (module) {
23
- function _typeof(obj) {
24
- "@babel/helpers - typeof";
25
-
26
- return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
27
- return typeof obj;
28
- } : function (obj) {
29
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
30
- }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
31
- }
32
-
33
- module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
34
- });
35
-
36
- unwrapExports(_typeof_1);
37
-
38
- var runtime_1 = createCommonjsModule(function (module) {
39
- /**
40
- * Copyright (c) 2014-present, Facebook, Inc.
41
- *
42
- * This source code is licensed under the MIT license found in the
43
- * LICENSE file in the root directory of this source tree.
44
- */
45
-
46
- var runtime = (function (exports) {
47
-
48
- var Op = Object.prototype;
49
- var hasOwn = Op.hasOwnProperty;
50
- var undefined$1; // More compressible than void 0.
51
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
52
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
53
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
54
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
55
-
56
- function define(obj, key, value) {
57
- Object.defineProperty(obj, key, {
58
- value: value,
59
- enumerable: true,
60
- configurable: true,
61
- writable: true
62
- });
63
- return obj[key];
64
- }
65
- try {
66
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
67
- define({}, "");
68
- } catch (err) {
69
- define = function(obj, key, value) {
70
- return obj[key] = value;
71
- };
72
- }
73
-
74
- function wrap(innerFn, outerFn, self, tryLocsList) {
75
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
76
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
77
- var generator = Object.create(protoGenerator.prototype);
78
- var context = new Context(tryLocsList || []);
79
-
80
- // The ._invoke method unifies the implementations of the .next,
81
- // .throw, and .return methods.
82
- generator._invoke = makeInvokeMethod(innerFn, self, context);
83
-
84
- return generator;
85
- }
86
- exports.wrap = wrap;
87
-
88
- // Try/catch helper to minimize deoptimizations. Returns a completion
89
- // record like context.tryEntries[i].completion. This interface could
90
- // have been (and was previously) designed to take a closure to be
91
- // invoked without arguments, but in all the cases we care about we
92
- // already have an existing method we want to call, so there's no need
93
- // to create a new function object. We can even get away with assuming
94
- // the method takes exactly one argument, since that happens to be true
95
- // in every case, so we don't have to touch the arguments object. The
96
- // only additional allocation required is the completion record, which
97
- // has a stable shape and so hopefully should be cheap to allocate.
98
- function tryCatch(fn, obj, arg) {
99
- try {
100
- return { type: "normal", arg: fn.call(obj, arg) };
101
- } catch (err) {
102
- return { type: "throw", arg: err };
103
- }
104
- }
105
-
106
- var GenStateSuspendedStart = "suspendedStart";
107
- var GenStateSuspendedYield = "suspendedYield";
108
- var GenStateExecuting = "executing";
109
- var GenStateCompleted = "completed";
110
-
111
- // Returning this object from the innerFn has the same effect as
112
- // breaking out of the dispatch switch statement.
113
- var ContinueSentinel = {};
114
-
115
- // Dummy constructor functions that we use as the .constructor and
116
- // .constructor.prototype properties for functions that return Generator
117
- // objects. For full spec compliance, you may wish to configure your
118
- // minifier not to mangle the names of these two functions.
119
- function Generator() {}
120
- function GeneratorFunction() {}
121
- function GeneratorFunctionPrototype() {}
122
-
123
- // This is a polyfill for %IteratorPrototype% for environments that
124
- // don't natively support it.
125
- var IteratorPrototype = {};
126
- define(IteratorPrototype, iteratorSymbol, function () {
127
- return this;
128
- });
129
-
130
- var getProto = Object.getPrototypeOf;
131
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
132
- if (NativeIteratorPrototype &&
133
- NativeIteratorPrototype !== Op &&
134
- hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
135
- // This environment has a native %IteratorPrototype%; use it instead
136
- // of the polyfill.
137
- IteratorPrototype = NativeIteratorPrototype;
138
- }
139
-
140
- var Gp = GeneratorFunctionPrototype.prototype =
141
- Generator.prototype = Object.create(IteratorPrototype);
142
- GeneratorFunction.prototype = GeneratorFunctionPrototype;
143
- define(Gp, "constructor", GeneratorFunctionPrototype);
144
- define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
145
- GeneratorFunction.displayName = define(
146
- GeneratorFunctionPrototype,
147
- toStringTagSymbol,
148
- "GeneratorFunction"
149
- );
150
-
151
- // Helper for defining the .next, .throw, and .return methods of the
152
- // Iterator interface in terms of a single ._invoke method.
153
- function defineIteratorMethods(prototype) {
154
- ["next", "throw", "return"].forEach(function(method) {
155
- define(prototype, method, function(arg) {
156
- return this._invoke(method, arg);
157
- });
158
- });
159
- }
160
-
161
- exports.isGeneratorFunction = function(genFun) {
162
- var ctor = typeof genFun === "function" && genFun.constructor;
163
- return ctor
164
- ? ctor === GeneratorFunction ||
165
- // For the native GeneratorFunction constructor, the best we can
166
- // do is to check its .name property.
167
- (ctor.displayName || ctor.name) === "GeneratorFunction"
168
- : false;
169
- };
170
-
171
- exports.mark = function(genFun) {
172
- if (Object.setPrototypeOf) {
173
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
174
- } else {
175
- genFun.__proto__ = GeneratorFunctionPrototype;
176
- define(genFun, toStringTagSymbol, "GeneratorFunction");
177
- }
178
- genFun.prototype = Object.create(Gp);
179
- return genFun;
180
- };
181
-
182
- // Within the body of any async function, `await x` is transformed to
183
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
184
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
185
- // meant to be awaited.
186
- exports.awrap = function(arg) {
187
- return { __await: arg };
188
- };
189
-
190
- function AsyncIterator(generator, PromiseImpl) {
191
- function invoke(method, arg, resolve, reject) {
192
- var record = tryCatch(generator[method], generator, arg);
193
- if (record.type === "throw") {
194
- reject(record.arg);
195
- } else {
196
- var result = record.arg;
197
- var value = result.value;
198
- if (value &&
199
- typeof value === "object" &&
200
- hasOwn.call(value, "__await")) {
201
- return PromiseImpl.resolve(value.__await).then(function(value) {
202
- invoke("next", value, resolve, reject);
203
- }, function(err) {
204
- invoke("throw", err, resolve, reject);
205
- });
206
- }
207
-
208
- return PromiseImpl.resolve(value).then(function(unwrapped) {
209
- // When a yielded Promise is resolved, its final value becomes
210
- // the .value of the Promise<{value,done}> result for the
211
- // current iteration.
212
- result.value = unwrapped;
213
- resolve(result);
214
- }, function(error) {
215
- // If a rejected Promise was yielded, throw the rejection back
216
- // into the async generator function so it can be handled there.
217
- return invoke("throw", error, resolve, reject);
218
- });
219
- }
220
- }
221
-
222
- var previousPromise;
223
-
224
- function enqueue(method, arg) {
225
- function callInvokeWithMethodAndArg() {
226
- return new PromiseImpl(function(resolve, reject) {
227
- invoke(method, arg, resolve, reject);
228
- });
229
- }
230
-
231
- return previousPromise =
232
- // If enqueue has been called before, then we want to wait until
233
- // all previous Promises have been resolved before calling invoke,
234
- // so that results are always delivered in the correct order. If
235
- // enqueue has not been called before, then it is important to
236
- // call invoke immediately, without waiting on a callback to fire,
237
- // so that the async generator function has the opportunity to do
238
- // any necessary setup in a predictable way. This predictability
239
- // is why the Promise constructor synchronously invokes its
240
- // executor callback, and why async functions synchronously
241
- // execute code before the first await. Since we implement simple
242
- // async functions in terms of async generators, it is especially
243
- // important to get this right, even though it requires care.
244
- previousPromise ? previousPromise.then(
245
- callInvokeWithMethodAndArg,
246
- // Avoid propagating failures to Promises returned by later
247
- // invocations of the iterator.
248
- callInvokeWithMethodAndArg
249
- ) : callInvokeWithMethodAndArg();
250
- }
251
-
252
- // Define the unified helper method that is used to implement .next,
253
- // .throw, and .return (see defineIteratorMethods).
254
- this._invoke = enqueue;
255
- }
256
-
257
- defineIteratorMethods(AsyncIterator.prototype);
258
- define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
259
- return this;
260
- });
261
- exports.AsyncIterator = AsyncIterator;
262
-
263
- // Note that simple async functions are implemented on top of
264
- // AsyncIterator objects; they just return a Promise for the value of
265
- // the final result produced by the iterator.
266
- exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
267
- if (PromiseImpl === void 0) PromiseImpl = Promise;
268
-
269
- var iter = new AsyncIterator(
270
- wrap(innerFn, outerFn, self, tryLocsList),
271
- PromiseImpl
272
- );
273
-
274
- return exports.isGeneratorFunction(outerFn)
275
- ? iter // If outerFn is a generator, return the full iterator.
276
- : iter.next().then(function(result) {
277
- return result.done ? result.value : iter.next();
278
- });
279
- };
280
-
281
- function makeInvokeMethod(innerFn, self, context) {
282
- var state = GenStateSuspendedStart;
283
-
284
- return function invoke(method, arg) {
285
- if (state === GenStateExecuting) {
286
- throw new Error("Generator is already running");
287
- }
288
-
289
- if (state === GenStateCompleted) {
290
- if (method === "throw") {
291
- throw arg;
292
- }
293
-
294
- // Be forgiving, per 25.3.3.3.3 of the spec:
295
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
296
- return doneResult();
297
- }
298
-
299
- context.method = method;
300
- context.arg = arg;
301
-
302
- while (true) {
303
- var delegate = context.delegate;
304
- if (delegate) {
305
- var delegateResult = maybeInvokeDelegate(delegate, context);
306
- if (delegateResult) {
307
- if (delegateResult === ContinueSentinel) continue;
308
- return delegateResult;
309
- }
310
- }
311
-
312
- if (context.method === "next") {
313
- // Setting context._sent for legacy support of Babel's
314
- // function.sent implementation.
315
- context.sent = context._sent = context.arg;
316
-
317
- } else if (context.method === "throw") {
318
- if (state === GenStateSuspendedStart) {
319
- state = GenStateCompleted;
320
- throw context.arg;
321
- }
322
-
323
- context.dispatchException(context.arg);
324
-
325
- } else if (context.method === "return") {
326
- context.abrupt("return", context.arg);
327
- }
328
-
329
- state = GenStateExecuting;
330
-
331
- var record = tryCatch(innerFn, self, context);
332
- if (record.type === "normal") {
333
- // If an exception is thrown from innerFn, we leave state ===
334
- // GenStateExecuting and loop back for another invocation.
335
- state = context.done
336
- ? GenStateCompleted
337
- : GenStateSuspendedYield;
338
-
339
- if (record.arg === ContinueSentinel) {
340
- continue;
341
- }
342
-
343
- return {
344
- value: record.arg,
345
- done: context.done
346
- };
347
-
348
- } else if (record.type === "throw") {
349
- state = GenStateCompleted;
350
- // Dispatch the exception by looping back around to the
351
- // context.dispatchException(context.arg) call above.
352
- context.method = "throw";
353
- context.arg = record.arg;
354
- }
355
- }
356
- };
357
- }
358
-
359
- // Call delegate.iterator[context.method](context.arg) and handle the
360
- // result, either by returning a { value, done } result from the
361
- // delegate iterator, or by modifying context.method and context.arg,
362
- // setting context.delegate to null, and returning the ContinueSentinel.
363
- function maybeInvokeDelegate(delegate, context) {
364
- var method = delegate.iterator[context.method];
365
- if (method === undefined$1) {
366
- // A .throw or .return when the delegate iterator has no .throw
367
- // method always terminates the yield* loop.
368
- context.delegate = null;
369
-
370
- if (context.method === "throw") {
371
- // Note: ["return"] must be used for ES3 parsing compatibility.
372
- if (delegate.iterator["return"]) {
373
- // If the delegate iterator has a return method, give it a
374
- // chance to clean up.
375
- context.method = "return";
376
- context.arg = undefined$1;
377
- maybeInvokeDelegate(delegate, context);
378
-
379
- if (context.method === "throw") {
380
- // If maybeInvokeDelegate(context) changed context.method from
381
- // "return" to "throw", let that override the TypeError below.
382
- return ContinueSentinel;
383
- }
384
- }
385
-
386
- context.method = "throw";
387
- context.arg = new TypeError(
388
- "The iterator does not provide a 'throw' method");
389
- }
390
-
391
- return ContinueSentinel;
392
- }
393
-
394
- var record = tryCatch(method, delegate.iterator, context.arg);
395
-
396
- if (record.type === "throw") {
397
- context.method = "throw";
398
- context.arg = record.arg;
399
- context.delegate = null;
400
- return ContinueSentinel;
401
- }
402
-
403
- var info = record.arg;
404
-
405
- if (! info) {
406
- context.method = "throw";
407
- context.arg = new TypeError("iterator result is not an object");
408
- context.delegate = null;
409
- return ContinueSentinel;
410
- }
411
-
412
- if (info.done) {
413
- // Assign the result of the finished delegate to the temporary
414
- // variable specified by delegate.resultName (see delegateYield).
415
- context[delegate.resultName] = info.value;
416
-
417
- // Resume execution at the desired location (see delegateYield).
418
- context.next = delegate.nextLoc;
419
-
420
- // If context.method was "throw" but the delegate handled the
421
- // exception, let the outer generator proceed normally. If
422
- // context.method was "next", forget context.arg since it has been
423
- // "consumed" by the delegate iterator. If context.method was
424
- // "return", allow the original .return call to continue in the
425
- // outer generator.
426
- if (context.method !== "return") {
427
- context.method = "next";
428
- context.arg = undefined$1;
429
- }
430
-
431
- } else {
432
- // Re-yield the result returned by the delegate method.
433
- return info;
434
- }
435
-
436
- // The delegate iterator is finished, so forget it and continue with
437
- // the outer generator.
438
- context.delegate = null;
439
- return ContinueSentinel;
440
- }
441
-
442
- // Define Generator.prototype.{next,throw,return} in terms of the
443
- // unified ._invoke helper method.
444
- defineIteratorMethods(Gp);
445
-
446
- define(Gp, toStringTagSymbol, "Generator");
447
-
448
- // A Generator should always return itself as the iterator object when the
449
- // @@iterator function is called on it. Some browsers' implementations of the
450
- // iterator prototype chain incorrectly implement this, causing the Generator
451
- // object to not be returned from this call. This ensures that doesn't happen.
452
- // See https://github.com/facebook/regenerator/issues/274 for more details.
453
- define(Gp, iteratorSymbol, function() {
454
- return this;
455
- });
456
-
457
- define(Gp, "toString", function() {
458
- return "[object Generator]";
459
- });
460
-
461
- function pushTryEntry(locs) {
462
- var entry = { tryLoc: locs[0] };
463
-
464
- if (1 in locs) {
465
- entry.catchLoc = locs[1];
466
- }
467
-
468
- if (2 in locs) {
469
- entry.finallyLoc = locs[2];
470
- entry.afterLoc = locs[3];
471
- }
472
-
473
- this.tryEntries.push(entry);
474
- }
475
-
476
- function resetTryEntry(entry) {
477
- var record = entry.completion || {};
478
- record.type = "normal";
479
- delete record.arg;
480
- entry.completion = record;
481
- }
482
-
483
- function Context(tryLocsList) {
484
- // The root entry object (effectively a try statement without a catch
485
- // or a finally block) gives us a place to store values thrown from
486
- // locations where there is no enclosing try statement.
487
- this.tryEntries = [{ tryLoc: "root" }];
488
- tryLocsList.forEach(pushTryEntry, this);
489
- this.reset(true);
490
- }
491
-
492
- exports.keys = function(object) {
493
- var keys = [];
494
- for (var key in object) {
495
- keys.push(key);
496
- }
497
- keys.reverse();
498
-
499
- // Rather than returning an object with a next method, we keep
500
- // things simple and return the next function itself.
501
- return function next() {
502
- while (keys.length) {
503
- var key = keys.pop();
504
- if (key in object) {
505
- next.value = key;
506
- next.done = false;
507
- return next;
508
- }
509
- }
510
-
511
- // To avoid creating an additional object, we just hang the .value
512
- // and .done properties off the next function object itself. This
513
- // also ensures that the minifier will not anonymize the function.
514
- next.done = true;
515
- return next;
516
- };
517
- };
518
-
519
- function values(iterable) {
520
- if (iterable) {
521
- var iteratorMethod = iterable[iteratorSymbol];
522
- if (iteratorMethod) {
523
- return iteratorMethod.call(iterable);
524
- }
525
-
526
- if (typeof iterable.next === "function") {
527
- return iterable;
528
- }
529
-
530
- if (!isNaN(iterable.length)) {
531
- var i = -1, next = function next() {
532
- while (++i < iterable.length) {
533
- if (hasOwn.call(iterable, i)) {
534
- next.value = iterable[i];
535
- next.done = false;
536
- return next;
537
- }
538
- }
539
-
540
- next.value = undefined$1;
541
- next.done = true;
542
-
543
- return next;
544
- };
545
-
546
- return next.next = next;
547
- }
548
- }
549
-
550
- // Return an iterator with no values.
551
- return { next: doneResult };
552
- }
553
- exports.values = values;
554
-
555
- function doneResult() {
556
- return { value: undefined$1, done: true };
557
- }
558
-
559
- Context.prototype = {
560
- constructor: Context,
561
-
562
- reset: function(skipTempReset) {
563
- this.prev = 0;
564
- this.next = 0;
565
- // Resetting context._sent for legacy support of Babel's
566
- // function.sent implementation.
567
- this.sent = this._sent = undefined$1;
568
- this.done = false;
569
- this.delegate = null;
570
-
571
- this.method = "next";
572
- this.arg = undefined$1;
573
-
574
- this.tryEntries.forEach(resetTryEntry);
575
-
576
- if (!skipTempReset) {
577
- for (var name in this) {
578
- // Not sure about the optimal order of these conditions:
579
- if (name.charAt(0) === "t" &&
580
- hasOwn.call(this, name) &&
581
- !isNaN(+name.slice(1))) {
582
- this[name] = undefined$1;
583
- }
584
- }
585
- }
586
- },
587
-
588
- stop: function() {
589
- this.done = true;
590
-
591
- var rootEntry = this.tryEntries[0];
592
- var rootRecord = rootEntry.completion;
593
- if (rootRecord.type === "throw") {
594
- throw rootRecord.arg;
595
- }
596
-
597
- return this.rval;
598
- },
599
-
600
- dispatchException: function(exception) {
601
- if (this.done) {
602
- throw exception;
603
- }
604
-
605
- var context = this;
606
- function handle(loc, caught) {
607
- record.type = "throw";
608
- record.arg = exception;
609
- context.next = loc;
610
-
611
- if (caught) {
612
- // If the dispatched exception was caught by a catch block,
613
- // then let that catch block handle the exception normally.
614
- context.method = "next";
615
- context.arg = undefined$1;
616
- }
617
-
618
- return !! caught;
619
- }
620
-
621
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
622
- var entry = this.tryEntries[i];
623
- var record = entry.completion;
624
-
625
- if (entry.tryLoc === "root") {
626
- // Exception thrown outside of any try block that could handle
627
- // it, so set the completion value of the entire function to
628
- // throw the exception.
629
- return handle("end");
630
- }
631
-
632
- if (entry.tryLoc <= this.prev) {
633
- var hasCatch = hasOwn.call(entry, "catchLoc");
634
- var hasFinally = hasOwn.call(entry, "finallyLoc");
635
-
636
- if (hasCatch && hasFinally) {
637
- if (this.prev < entry.catchLoc) {
638
- return handle(entry.catchLoc, true);
639
- } else if (this.prev < entry.finallyLoc) {
640
- return handle(entry.finallyLoc);
641
- }
642
-
643
- } else if (hasCatch) {
644
- if (this.prev < entry.catchLoc) {
645
- return handle(entry.catchLoc, true);
646
- }
647
-
648
- } else if (hasFinally) {
649
- if (this.prev < entry.finallyLoc) {
650
- return handle(entry.finallyLoc);
651
- }
652
-
653
- } else {
654
- throw new Error("try statement without catch or finally");
655
- }
656
- }
657
- }
658
- },
659
-
660
- abrupt: function(type, arg) {
661
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
662
- var entry = this.tryEntries[i];
663
- if (entry.tryLoc <= this.prev &&
664
- hasOwn.call(entry, "finallyLoc") &&
665
- this.prev < entry.finallyLoc) {
666
- var finallyEntry = entry;
667
- break;
668
- }
669
- }
670
-
671
- if (finallyEntry &&
672
- (type === "break" ||
673
- type === "continue") &&
674
- finallyEntry.tryLoc <= arg &&
675
- arg <= finallyEntry.finallyLoc) {
676
- // Ignore the finally entry if control is not jumping to a
677
- // location outside the try/catch block.
678
- finallyEntry = null;
679
- }
680
-
681
- var record = finallyEntry ? finallyEntry.completion : {};
682
- record.type = type;
683
- record.arg = arg;
684
-
685
- if (finallyEntry) {
686
- this.method = "next";
687
- this.next = finallyEntry.finallyLoc;
688
- return ContinueSentinel;
689
- }
690
-
691
- return this.complete(record);
692
- },
693
-
694
- complete: function(record, afterLoc) {
695
- if (record.type === "throw") {
696
- throw record.arg;
697
- }
698
-
699
- if (record.type === "break" ||
700
- record.type === "continue") {
701
- this.next = record.arg;
702
- } else if (record.type === "return") {
703
- this.rval = this.arg = record.arg;
704
- this.method = "return";
705
- this.next = "end";
706
- } else if (record.type === "normal" && afterLoc) {
707
- this.next = afterLoc;
708
- }
709
-
710
- return ContinueSentinel;
711
- },
712
-
713
- finish: function(finallyLoc) {
714
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
715
- var entry = this.tryEntries[i];
716
- if (entry.finallyLoc === finallyLoc) {
717
- this.complete(entry.completion, entry.afterLoc);
718
- resetTryEntry(entry);
719
- return ContinueSentinel;
720
- }
721
- }
722
- },
723
-
724
- "catch": function(tryLoc) {
725
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
726
- var entry = this.tryEntries[i];
727
- if (entry.tryLoc === tryLoc) {
728
- var record = entry.completion;
729
- if (record.type === "throw") {
730
- var thrown = record.arg;
731
- resetTryEntry(entry);
732
- }
733
- return thrown;
734
- }
735
- }
736
-
737
- // The context.catch method must only be called with a location
738
- // argument that corresponds to a known catch block.
739
- throw new Error("illegal catch attempt");
740
- },
741
-
742
- delegateYield: function(iterable, resultName, nextLoc) {
743
- this.delegate = {
744
- iterator: values(iterable),
745
- resultName: resultName,
746
- nextLoc: nextLoc
747
- };
748
-
749
- if (this.method === "next") {
750
- // Deliberately forget the last sent value so that we don't
751
- // accidentally pass it on to the delegate.
752
- this.arg = undefined$1;
753
- }
754
-
755
- return ContinueSentinel;
756
- }
757
- };
758
-
759
- // Regardless of whether this script is executing as a CommonJS module
760
- // or not, return the runtime object so that we can declare the variable
761
- // regeneratorRuntime in the outer scope, which allows this module to be
762
- // injected easily by `bin/regenerator --include-runtime script.js`.
763
- return exports;
764
-
765
- }(
766
- // If this script is executing as a CommonJS module, use module.exports
767
- // as the regeneratorRuntime namespace. Otherwise create a new empty
768
- // object. Either way, the resulting object will be used to initialize
769
- // the regeneratorRuntime variable at the top of this file.
770
- module.exports
771
- ));
772
-
773
- try {
774
- regeneratorRuntime = runtime;
775
- } catch (accidentalStrictMode) {
776
- // This module should not be running in strict mode, so the above
777
- // assignment should always work unless something is misconfigured. Just
778
- // in case runtime.js accidentally runs in strict mode, in modern engines
779
- // we can explicitly access globalThis. In older engines we can escape
780
- // strict mode using a global Function call. This could conceivably fail
781
- // if a Content Security Policy forbids using Function, but in that case
782
- // the proper solution is to fix the accidental strict mode problem. If
783
- // you've misconfigured your bundler to force strict mode and applied a
784
- // CSP to forbid Function, and you're not willing to fix either of those
785
- // problems, please detail your unique predicament in a GitHub issue.
786
- if (typeof globalThis === "object") {
787
- globalThis.regeneratorRuntime = runtime;
788
- } else {
789
- Function("r", "regeneratorRuntime = r")(runtime);
790
- }
791
- }
792
- });
793
-
794
- var regenerator = runtime_1;
795
-
796
- var arrayWithHoles = createCommonjsModule(function (module) {
797
- function _arrayWithHoles(arr) {
798
- if (Array.isArray(arr)) return arr;
799
- }
800
-
801
- module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
802
- });
803
-
804
- unwrapExports(arrayWithHoles);
805
-
806
- var iterableToArrayLimit = createCommonjsModule(function (module) {
807
- function _iterableToArrayLimit(arr, i) {
808
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
809
-
810
- if (_i == null) return;
811
- var _arr = [];
812
- var _n = true;
813
- var _d = false;
814
-
815
- var _s, _e;
816
-
817
- try {
818
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
819
- _arr.push(_s.value);
820
-
821
- if (i && _arr.length === i) break;
822
- }
823
- } catch (err) {
824
- _d = true;
825
- _e = err;
826
- } finally {
827
- try {
828
- if (!_n && _i["return"] != null) _i["return"]();
829
- } finally {
830
- if (_d) throw _e;
831
- }
832
- }
833
-
834
- return _arr;
835
- }
836
-
837
- module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
838
- });
839
-
840
- unwrapExports(iterableToArrayLimit);
841
-
842
- var arrayLikeToArray = createCommonjsModule(function (module) {
843
- function _arrayLikeToArray(arr, len) {
844
- if (len == null || len > arr.length) len = arr.length;
845
-
846
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
847
- arr2[i] = arr[i];
848
- }
849
-
850
- return arr2;
851
- }
852
-
853
- module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
854
- });
855
-
856
- unwrapExports(arrayLikeToArray);
857
-
858
- var unsupportedIterableToArray = createCommonjsModule(function (module) {
859
- function _unsupportedIterableToArray(o, minLen) {
860
- if (!o) return;
861
- if (typeof o === "string") return arrayLikeToArray(o, minLen);
862
- var n = Object.prototype.toString.call(o).slice(8, -1);
863
- if (n === "Object" && o.constructor) n = o.constructor.name;
864
- if (n === "Map" || n === "Set") return Array.from(o);
865
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
866
- }
867
-
868
- module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
869
- });
870
-
871
- unwrapExports(unsupportedIterableToArray);
872
-
873
- var nonIterableRest = createCommonjsModule(function (module) {
874
- function _nonIterableRest() {
875
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
876
- }
877
-
878
- module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
879
- });
880
-
881
- unwrapExports(nonIterableRest);
882
-
883
- var slicedToArray = createCommonjsModule(function (module) {
884
- function _slicedToArray(arr, i) {
885
- return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
886
- }
887
-
888
- module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
889
- });
890
-
891
- unwrapExports(slicedToArray);
892
-
893
9
  var logger = createCommonjsModule(function (module, exports) {
894
10
 
895
11
  Object.defineProperty(exports, "__esModule", {
@@ -898,25 +14,39 @@ Object.defineProperty(exports, "__esModule", {
898
14
  exports.setLogger = setLogger;
899
15
  exports.proxyLogger = proxyLogger;
900
16
  exports.default = void 0;
901
- const _logger = {
902
- error(code, ...message) {
903
- console.error(`[next-auth][error][${code.toLowerCase()}]`, `\nhttps://next-auth.js.org/errors#${code.toLowerCase()}`, ...message);
17
+ var _logger = {
18
+ error(code) {
19
+ for (var _len = arguments.length, message = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
20
+ message[_key - 1] = arguments[_key];
21
+ }
22
+
23
+ console.error("[next-auth][error][".concat(code.toLowerCase(), "]"), "\nhttps://next-auth.js.org/errors#".concat(code.toLowerCase()), ...message);
904
24
  },
905
25
 
906
- warn(code, ...message) {
907
- console.warn(`[next-auth][warn][${code.toLowerCase()}]`, `\nhttps://next-auth.js.org/warnings#${code.toLowerCase()}`, ...message);
26
+ warn(code) {
27
+ for (var _len2 = arguments.length, message = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
28
+ message[_key2 - 1] = arguments[_key2];
29
+ }
30
+
31
+ console.warn("[next-auth][warn][".concat(code.toLowerCase(), "]"), "\nhttps://next-auth.js.org/warnings#".concat(code.toLowerCase()), ...message);
908
32
  },
909
33
 
910
- debug(code, ...message) {
34
+ debug(code) {
911
35
  var _process, _process$env;
912
36
 
913
37
  if (!((_process = process) !== null && _process !== void 0 && (_process$env = _process.env) !== null && _process$env !== void 0 && _process$env._NEXTAUTH_DEBUG)) return;
914
- console.log(`[next-auth][debug][${code.toLowerCase()}]`, ...message);
38
+
39
+ for (var _len3 = arguments.length, message = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
40
+ message[_key3 - 1] = arguments[_key3];
41
+ }
42
+
43
+ console.log("[next-auth][debug][".concat(code.toLowerCase(), "]"), ...message);
915
44
  }
916
45
 
917
46
  };
918
47
 
919
- function setLogger(newLogger = {}) {
48
+ function setLogger() {
49
+ var newLogger = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
920
50
  if (newLogger.error) _logger.error = newLogger.error;
921
51
  if (newLogger.warn) _logger.warn = newLogger.warn;
922
52
  if (newLogger.debug) _logger.debug = newLogger.debug;
@@ -925,20 +55,27 @@ function setLogger(newLogger = {}) {
925
55
  var _default = _logger;
926
56
  exports.default = _default;
927
57
 
928
- function proxyLogger(logger = _logger, basePath) {
58
+ function proxyLogger() {
59
+ var logger = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _logger;
60
+ var basePath = arguments.length > 1 ? arguments[1] : undefined;
61
+
929
62
  try {
930
- if (typeof window === "undefined") {
63
+ if (typeof window === 'undefined') {
931
64
  return logger;
932
65
  }
933
66
 
934
- const clientLogger = {};
67
+ var clientLogger = {};
68
+
69
+ var _loop = function _loop(level) {
70
+ clientLogger[level] = function (code) {
71
+ for (var _len4 = arguments.length, message = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
72
+ message[_key4 - 1] = arguments[_key4];
73
+ }
935
74
 
936
- for (const level in logger) {
937
- clientLogger[level] = (code, ...message) => {
938
75
  _logger[level](code, ...message);
939
76
 
940
- const url = `${basePath}/_log`;
941
- const body = new URLSearchParams({
77
+ var url = "".concat(basePath, "/_log");
78
+ var body = new URLSearchParams({
942
79
  level,
943
80
  code,
944
81
  message: JSON.stringify(message.map(m => {
@@ -959,13 +96,17 @@ function proxyLogger(logger = _logger, basePath) {
959
96
  }
960
97
 
961
98
  return fetch(url, {
962
- method: "POST",
99
+ method: 'POST',
963
100
  headers: {
964
- "Content-Type": "application/json"
101
+ 'Content-Type': 'application/json'
965
102
  },
966
103
  body
967
104
  });
968
105
  };
106
+ };
107
+
108
+ for (var level in logger) {
109
+ _loop(level);
969
110
  }
970
111
 
971
112
  return clientLogger;
@@ -987,18 +128,18 @@ Object.defineProperty(exports, "__esModule", {
987
128
  exports.default = parseUrl;
988
129
 
989
130
  function parseUrl(url) {
990
- const defaultHost = 'http://localhost:3000';
991
- const defaultPath = '/api/auth';
131
+ var defaultHost = 'http://localhost:3000';
132
+ var defaultPath = '/api/auth';
992
133
 
993
134
  if (!url) {
994
- url = `${defaultHost}${defaultPath}`;
135
+ url = "".concat(defaultHost).concat(defaultPath);
995
136
  }
996
137
 
997
- const protocol = url.startsWith('http:') ? 'http' : 'https';
138
+ var protocol = url.startsWith('http:') ? 'http' : 'https';
998
139
  url = url.replace(/^https?:\/\//, '').replace(/\/$/, '');
999
- const [_host, ..._path] = url.split('/');
1000
- const baseUrl = _host ? `${protocol}://${_host}` : defaultHost;
1001
- const basePath = _path.length > 0 ? `/${_path.join('/')}` : defaultPath;
140
+ var [_host, ..._path] = url.split('/');
141
+ var baseUrl = _host ? "".concat(protocol, "://").concat(_host) : defaultHost;
142
+ var basePath = _path.length > 0 ? "/".concat(_path.join('/')) : defaultPath;
1002
143
  return {
1003
144
  baseUrl,
1004
145
  basePath
@@ -1010,44 +151,39 @@ unwrapExports(parseUrl_1);
1010
151
 
1011
152
  var client$1 = createCommonjsModule(function (module, exports) {
1012
153
 
1013
-
1014
-
1015
-
1016
-
1017
154
  Object.defineProperty(exports, "__esModule", {
1018
155
  value: true
1019
156
  });
1020
157
  exports.useSession = useSession;
1021
- exports.session = exports.getSession = getSession;
1022
- exports.csrfToken = exports.getCsrfToken = getCsrfToken;
1023
- exports.providers = exports.getProviders = getProviders;
1024
- exports.signin = exports.signIn = signIn;
1025
- exports.signout = exports.signOut = signOut;
1026
- exports.options = exports.setOptions = setOptions;
158
+ exports.getSession = getSession;
159
+ exports.getProviders = getProviders;
160
+ exports.signIn = signIn;
161
+ exports.signOut = signOut;
162
+ exports.setOptions = setOptions;
1027
163
  exports.Provider = Provider;
1028
164
  exports.default = void 0;
1029
165
 
1030
- var _regenerator = interopRequireDefault(regenerator);
1031
166
 
1032
- var _defineProperty2 = interopRequireDefault(defineProperty);
1033
167
 
1034
- var _asyncToGenerator2 = interopRequireDefault(asyncToGenerator);
168
+ var _logger2 = _interopRequireWildcard(logger);
1035
169
 
1036
- var _slicedToArray2 = interopRequireDefault(slicedToArray);
170
+ var _parseUrl = _interopRequireDefault(parseUrl_1);
1037
171
 
172
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1038
173
 
174
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
1039
175
 
1040
- var _logger2 = _interopRequireWildcard(logger);
176
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
1041
177
 
1042
- var _parseUrl = interopRequireDefault(parseUrl_1);
178
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
1043
179
 
1044
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
180
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
1045
181
 
1046
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof_1(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
182
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1047
183
 
1048
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
184
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
1049
185
 
1050
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
186
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
1051
187
 
1052
188
  var __NEXTAUTH = {
1053
189
  baseUrl: (0, _parseUrl.default)(process.env.NEXTAUTH_URL || process.env.VERCEL_URL).baseUrl,
@@ -1060,21 +196,19 @@ var __NEXTAUTH = {
1060
196
  _clientSyncTimer: null,
1061
197
  _eventListenersAdded: false,
1062
198
  _clientSession: undefined,
1063
- _getSession: function _getSession() {}
199
+ _getSession: () => {}
1064
200
  };
1065
201
  var logger$1 = (0, _logger2.proxyLogger)(_logger2.default, __NEXTAUTH.basePath);
1066
202
  var broadcast = BroadcastChannel();
1067
203
 
1068
- if (typeof window !== "undefined" && !__NEXTAUTH._eventListenersAdded) {
204
+ if (typeof window !== 'undefined' && !__NEXTAUTH._eventListenersAdded) {
1069
205
  __NEXTAUTH._eventListenersAdded = true;
1070
- broadcast.receive(function () {
1071
- return __NEXTAUTH._getSession({
1072
- event: "storage"
1073
- });
1074
- });
1075
- document.addEventListener("visibilitychange", function () {
206
+ broadcast.receive(() => __NEXTAUTH._getSession({
207
+ event: 'storage'
208
+ }));
209
+ document.addEventListener('visibilitychange', () => {
1076
210
  !document.hidden && __NEXTAUTH._getSession({
1077
- event: "visibilitychange"
211
+ event: 'visibilitychange'
1078
212
  });
1079
213
  }, false);
1080
214
  }
@@ -1088,103 +222,50 @@ function useSession(session) {
1088
222
  }
1089
223
 
1090
224
  function _useSessionHook(session) {
1091
- var _useState = (0, React__default.useState)(session),
1092
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
1093
- data = _useState2[0],
1094
- setData = _useState2[1];
1095
-
1096
- var _useState3 = (0, React__default.useState)(!data),
1097
- _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
1098
- loading = _useState4[0],
1099
- setLoading = _useState4[1];
1100
-
1101
- (0, React__default.useEffect)(function () {
1102
- __NEXTAUTH._getSession = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee() {
1103
- var _ref2,
1104
- _ref2$event,
1105
- event,
1106
- triggredByEvent,
1107
- triggeredByStorageEvent,
1108
- clientMaxAge,
1109
- clientLastSync,
1110
- currentTime,
1111
- clientSession,
1112
- newClientSessionData,
1113
- _args = arguments;
1114
-
1115
- return _regenerator.default.wrap(function _callee$(_context) {
1116
- while (1) {
1117
- switch (_context.prev = _context.next) {
1118
- case 0:
1119
- _ref2 = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}, _ref2$event = _ref2.event, event = _ref2$event === void 0 ? null : _ref2$event;
1120
- _context.prev = 1;
1121
- triggredByEvent = event !== null;
1122
- triggeredByStorageEvent = event === "storage";
1123
- clientMaxAge = __NEXTAUTH.clientMaxAge;
1124
- clientLastSync = parseInt(__NEXTAUTH._clientLastSync);
1125
- currentTime = _now();
1126
- clientSession = __NEXTAUTH._clientSession;
1127
-
1128
- if (!(!triggeredByStorageEvent && clientSession !== undefined)) {
1129
- _context.next = 19;
1130
- break;
1131
- }
1132
-
1133
- if (!(clientMaxAge === 0 && triggredByEvent !== true)) {
1134
- _context.next = 13;
1135
- break;
1136
- }
1137
-
1138
- return _context.abrupt("return");
1139
-
1140
- case 13:
1141
- if (!(clientMaxAge > 0 && clientSession === null)) {
1142
- _context.next = 17;
1143
- break;
1144
- }
1145
-
1146
- return _context.abrupt("return");
1147
-
1148
- case 17:
1149
- if (!(clientMaxAge > 0 && currentTime < clientLastSync + clientMaxAge)) {
1150
- _context.next = 19;
1151
- break;
1152
- }
1153
-
1154
- return _context.abrupt("return");
1155
-
1156
- case 19:
1157
- if (clientSession === undefined) {
1158
- __NEXTAUTH._clientSession = null;
1159
- }
1160
-
1161
- __NEXTAUTH._clientLastSync = _now();
1162
- _context.next = 23;
1163
- return getSession({
1164
- triggerEvent: !triggeredByStorageEvent
1165
- });
1166
-
1167
- case 23:
1168
- newClientSessionData = _context.sent;
1169
- __NEXTAUTH._clientSession = newClientSessionData;
1170
- setData(newClientSessionData);
1171
- setLoading(false);
1172
- _context.next = 33;
1173
- break;
1174
-
1175
- case 29:
1176
- _context.prev = 29;
1177
- _context.t0 = _context["catch"](1);
1178
- logger$1.error("CLIENT_USE_SESSION_ERROR", _context.t0);
1179
- setLoading(false);
1180
-
1181
- case 33:
1182
- case "end":
1183
- return _context.stop();
225
+ var [data, setData] = (0, React__default.useState)(session);
226
+ var [loading, setLoading] = (0, React__default.useState)(!data);
227
+ (0, React__default.useEffect)(() => {
228
+ __NEXTAUTH._getSession = _asyncToGenerator(function* () {
229
+ var {
230
+ event = null
231
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
232
+
233
+ try {
234
+ var triggredByEvent = event !== null;
235
+ var triggeredByStorageEvent = event === 'storage';
236
+ var clientMaxAge = __NEXTAUTH.clientMaxAge;
237
+ var clientLastSync = parseInt(__NEXTAUTH._clientLastSync);
238
+
239
+ var currentTime = _now();
240
+
241
+ var clientSession = __NEXTAUTH._clientSession;
242
+
243
+ if (!triggeredByStorageEvent && clientSession !== undefined) {
244
+ if (clientMaxAge === 0 && triggredByEvent !== true) {
245
+ return;
246
+ } else if (clientMaxAge > 0 && clientSession === null) {
247
+ return;
248
+ } else if (clientMaxAge > 0 && currentTime < clientLastSync + clientMaxAge) {
249
+ return;
1184
250
  }
1185
251
  }
1186
- }, _callee, null, [[1, 29]]);
1187
- }));
252
+
253
+ if (clientSession === undefined) {
254
+ __NEXTAUTH._clientSession = null;
255
+ }
256
+
257
+ __NEXTAUTH._clientLastSync = _now();
258
+ var newClientSessionData = yield getSession({
259
+ triggerEvent: !triggeredByStorageEvent
260
+ });
261
+ __NEXTAUTH._clientSession = newClientSessionData;
262
+ setData(newClientSessionData);
263
+ setLoading(false);
264
+ } catch (error) {
265
+ logger$1.error('CLIENT_USE_SESSION_ERROR', error);
266
+ setLoading(false);
267
+ }
268
+ });
1188
269
 
1189
270
  __NEXTAUTH._getSession();
1190
271
  });
@@ -1196,38 +277,22 @@ function getSession(_x) {
1196
277
  }
1197
278
 
1198
279
  function _getSession2() {
1199
- _getSession2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee4(ctx) {
280
+ _getSession2 = _asyncToGenerator(function* (ctx) {
1200
281
  var _ctx$triggerEvent;
1201
282
 
1202
- var session;
1203
- return _regenerator.default.wrap(function _callee4$(_context4) {
1204
- while (1) {
1205
- switch (_context4.prev = _context4.next) {
1206
- case 0:
1207
- _context4.next = 2;
1208
- return _fetchData("session", ctx);
1209
-
1210
- case 2:
1211
- session = _context4.sent;
1212
-
1213
- if ((_ctx$triggerEvent = ctx === null || ctx === void 0 ? void 0 : ctx.triggerEvent) !== null && _ctx$triggerEvent !== void 0 ? _ctx$triggerEvent : true) {
1214
- broadcast.post({
1215
- event: "session",
1216
- data: {
1217
- trigger: "getSession"
1218
- }
1219
- });
1220
- }
283
+ var session = yield _fetchData('session', ctx);
1221
284
 
1222
- return _context4.abrupt("return", session);
1223
-
1224
- case 5:
1225
- case "end":
1226
- return _context4.stop();
285
+ if ((_ctx$triggerEvent = ctx === null || ctx === void 0 ? void 0 : ctx.triggerEvent) !== null && _ctx$triggerEvent !== void 0 ? _ctx$triggerEvent : true) {
286
+ broadcast.post({
287
+ event: 'session',
288
+ data: {
289
+ trigger: 'getSession'
1227
290
  }
1228
- }
1229
- }, _callee4);
1230
- }));
291
+ });
292
+ }
293
+
294
+ return session;
295
+ });
1231
296
  return _getSession2.apply(this, arguments);
1232
297
  }
1233
298
 
@@ -1236,50 +301,11 @@ function getCsrfToken(_x2) {
1236
301
  }
1237
302
 
1238
303
  function _getCsrfToken() {
1239
- _getCsrfToken = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee5(ctx) {
304
+ _getCsrfToken = _asyncToGenerator(function* (ctx) {
1240
305
  var _yield$_fetchData;
1241
306
 
1242
- return _regenerator.default.wrap(function _callee5$(_context5) {
1243
- while (1) {
1244
- switch (_context5.prev = _context5.next) {
1245
- case 0:
1246
- _context5.next = 2;
1247
- return _fetchData("csrf", ctx);
1248
-
1249
- case 2:
1250
- _context5.t1 = _yield$_fetchData = _context5.sent;
1251
- _context5.t0 = _context5.t1 === null;
1252
-
1253
- if (_context5.t0) {
1254
- _context5.next = 6;
1255
- break;
1256
- }
1257
-
1258
- _context5.t0 = _yield$_fetchData === void 0;
1259
-
1260
- case 6:
1261
- if (!_context5.t0) {
1262
- _context5.next = 10;
1263
- break;
1264
- }
1265
-
1266
- _context5.t2 = void 0;
1267
- _context5.next = 11;
1268
- break;
1269
-
1270
- case 10:
1271
- _context5.t2 = _yield$_fetchData.csrfToken;
1272
-
1273
- case 11:
1274
- return _context5.abrupt("return", _context5.t2);
1275
-
1276
- case 12:
1277
- case "end":
1278
- return _context5.stop();
1279
- }
1280
- }
1281
- }, _callee5);
1282
- }));
307
+ return (_yield$_fetchData = yield _fetchData('csrf', ctx)) === null || _yield$_fetchData === void 0 ? void 0 : _yield$_fetchData.csrfToken;
308
+ });
1283
309
  return _getCsrfToken.apply(this, arguments);
1284
310
  }
1285
311
 
@@ -1288,24 +314,9 @@ function getProviders() {
1288
314
  }
1289
315
 
1290
316
  function _getProviders() {
1291
- _getProviders = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee6() {
1292
- return _regenerator.default.wrap(function _callee6$(_context6) {
1293
- while (1) {
1294
- switch (_context6.prev = _context6.next) {
1295
- case 0:
1296
- _context6.next = 2;
1297
- return _fetchData("providers");
1298
-
1299
- case 2:
1300
- return _context6.abrupt("return", _context6.sent);
1301
-
1302
- case 3:
1303
- case "end":
1304
- return _context6.stop();
1305
- }
1306
- }
1307
- }, _callee6);
1308
- }));
317
+ _getProviders = _asyncToGenerator(function* () {
318
+ return _fetchData('providers');
319
+ });
1309
320
  return _getProviders.apply(this, arguments);
1310
321
  }
1311
322
 
@@ -1314,138 +325,68 @@ function signIn(_x3) {
1314
325
  }
1315
326
 
1316
327
  function _signIn() {
1317
- _signIn = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee7(provider) {
1318
- var options,
1319
- authorizationParams,
1320
- _options$callbackUrl,
328
+ _signIn = _asyncToGenerator(function* (provider) {
329
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
330
+ var authorizationParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
331
+ var {
332
+ callbackUrl = window.location,
333
+ redirect = true
334
+ } = options;
335
+
336
+ var baseUrl = _apiBaseUrl();
337
+
338
+ var providers = yield getProviders();
339
+
340
+ if (!(provider in providers)) {
341
+ window.location = "".concat(baseUrl, "/signin?callbackUrl=").concat(encodeURIComponent(callbackUrl));
342
+ return;
343
+ }
344
+
345
+ var isCredentials = providers[provider].type === 'credentials';
346
+ var isEmail = providers[provider].type === 'email';
347
+ var canRedirectBeDisabled = isCredentials || isEmail;
348
+ var signInUrl = isCredentials ? "".concat(baseUrl, "/callback/").concat(provider) : "".concat(baseUrl, "/signin/").concat(provider);
349
+ var fetchOptions = {
350
+ method: 'post',
351
+ headers: {
352
+ 'Content-Type': 'application/x-www-form-urlencoded'
353
+ },
354
+ body: new URLSearchParams(_objectSpread(_objectSpread({}, options), {}, {
355
+ csrfToken: yield getCsrfToken(),
1321
356
  callbackUrl,
1322
- _options$redirect,
1323
- redirect,
1324
- baseUrl,
1325
- providers,
1326
- isCredentials,
1327
- isEmail,
1328
- isSupportingReturn,
1329
- signInUrl,
1330
- _signInUrl,
1331
- res,
1332
- data,
1333
- _data$url,
1334
- url,
1335
- error,
1336
- _args7 = arguments;
1337
-
1338
- return _regenerator.default.wrap(function _callee7$(_context7) {
1339
- while (1) {
1340
- switch (_context7.prev = _context7.next) {
1341
- case 0:
1342
- options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
1343
- authorizationParams = _args7.length > 2 && _args7[2] !== undefined ? _args7[2] : {};
1344
- _options$callbackUrl = options.callbackUrl, callbackUrl = _options$callbackUrl === void 0 ? window.location.href : _options$callbackUrl, _options$redirect = options.redirect, redirect = _options$redirect === void 0 ? true : _options$redirect;
1345
- baseUrl = _apiBaseUrl();
1346
- _context7.next = 6;
1347
- return getProviders();
1348
-
1349
- case 6:
1350
- providers = _context7.sent;
1351
-
1352
- if (providers) {
1353
- _context7.next = 9;
1354
- break;
1355
- }
357
+ json: true
358
+ }))
359
+ };
1356
360
 
1357
- return _context7.abrupt("return", window.location.replace("".concat(baseUrl, "/error")));
361
+ var _signInUrl = "".concat(signInUrl, "?").concat(new URLSearchParams(authorizationParams));
1358
362
 
1359
- case 9:
1360
- if (provider in providers) {
1361
- _context7.next = 11;
1362
- break;
1363
- }
363
+ var res = yield fetch(_signInUrl, fetchOptions);
364
+ var data = yield res.json();
1364
365
 
1365
- return _context7.abrupt("return", window.location.replace("".concat(baseUrl, "/signin?callbackUrl=").concat(encodeURIComponent(callbackUrl))));
1366
-
1367
- case 11:
1368
- isCredentials = providers[provider].type === "credentials";
1369
- isEmail = providers[provider].type === "email";
1370
- isSupportingReturn = isCredentials || isEmail;
1371
- signInUrl = isCredentials ? "".concat(baseUrl, "/callback/").concat(provider) : "".concat(baseUrl, "/signin/").concat(provider);
1372
- _signInUrl = "".concat(signInUrl, "?").concat(new URLSearchParams(authorizationParams));
1373
- _context7.t0 = fetch;
1374
- _context7.t1 = _signInUrl;
1375
- _context7.t2 = {
1376
- "Content-Type": "application/x-www-form-urlencoded"
1377
- };
1378
- _context7.t3 = URLSearchParams;
1379
- _context7.t4 = _objectSpread;
1380
- _context7.t5 = _objectSpread({}, options);
1381
- _context7.t6 = {};
1382
- _context7.next = 25;
1383
- return getCsrfToken();
1384
-
1385
- case 25:
1386
- _context7.t7 = _context7.sent;
1387
- _context7.t8 = callbackUrl;
1388
- _context7.t9 = {
1389
- csrfToken: _context7.t7,
1390
- callbackUrl: _context7.t8,
1391
- json: true
1392
- };
1393
- _context7.t10 = (0, _context7.t4)(_context7.t5, _context7.t6, _context7.t9);
1394
- _context7.t11 = new _context7.t3(_context7.t10);
1395
- _context7.t12 = {
1396
- method: "post",
1397
- headers: _context7.t2,
1398
- body: _context7.t11
1399
- };
1400
- _context7.next = 33;
1401
- return (0, _context7.t0)(_context7.t1, _context7.t12);
1402
-
1403
- case 33:
1404
- res = _context7.sent;
1405
- _context7.next = 36;
1406
- return res.json();
1407
-
1408
- case 36:
1409
- data = _context7.sent;
1410
-
1411
- if (!(redirect || !isSupportingReturn)) {
1412
- _context7.next = 42;
1413
- break;
1414
- }
366
+ if (redirect || !canRedirectBeDisabled) {
367
+ var _data$url;
1415
368
 
1416
- url = (_data$url = data.url) !== null && _data$url !== void 0 ? _data$url : callbackUrl;
1417
- window.location.replace(url);
1418
- if (url.includes("#")) window.location.reload();
1419
- return _context7.abrupt("return");
369
+ var url = (_data$url = data.url) !== null && _data$url !== void 0 ? _data$url : callbackUrl;
370
+ window.location = url;
371
+ if (url.includes('#')) window.location.reload();
372
+ return;
373
+ }
1420
374
 
1421
- case 42:
1422
- error = new URL(data.url).searchParams.get("error");
375
+ var error = new URL(data.url).searchParams.get('error');
1423
376
 
1424
- if (!res.ok) {
1425
- _context7.next = 46;
1426
- break;
1427
- }
377
+ if (res.ok) {
378
+ yield __NEXTAUTH._getSession({
379
+ event: 'storage'
380
+ });
381
+ }
1428
382
 
1429
- _context7.next = 46;
1430
- return __NEXTAUTH._getSession({
1431
- event: "storage"
1432
- });
1433
-
1434
- case 46:
1435
- return _context7.abrupt("return", {
1436
- error: error,
1437
- status: res.status,
1438
- ok: res.ok,
1439
- url: error ? null : data.url
1440
- });
1441
-
1442
- case 47:
1443
- case "end":
1444
- return _context7.stop();
1445
- }
1446
- }
1447
- }, _callee7);
1448
- }));
383
+ return {
384
+ error,
385
+ status: res.status,
386
+ ok: res.ok,
387
+ url: error ? null : data.url
388
+ };
389
+ });
1449
390
  return _signIn.apply(this, arguments);
1450
391
  }
1451
392
 
@@ -1454,145 +395,86 @@ function signOut() {
1454
395
  }
1455
396
 
1456
397
  function _signOut() {
1457
- _signOut = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee8() {
1458
- var options,
1459
- _options$callbackUrl2,
398
+ _signOut = _asyncToGenerator(function* () {
399
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
400
+ var {
401
+ callbackUrl = window.location,
402
+ redirect = true
403
+ } = options;
404
+
405
+ var baseUrl = _apiBaseUrl();
406
+
407
+ var fetchOptions = {
408
+ method: 'post',
409
+ headers: {
410
+ 'Content-Type': 'application/x-www-form-urlencoded'
411
+ },
412
+ body: new URLSearchParams({
413
+ csrfToken: yield getCsrfToken(),
1460
414
  callbackUrl,
1461
- _options$redirect2,
1462
- redirect,
1463
- baseUrl,
1464
- fetchOptions,
1465
- res,
1466
- data,
1467
- _data$url2,
1468
- url,
1469
- _args8 = arguments;
1470
-
1471
- return _regenerator.default.wrap(function _callee8$(_context8) {
1472
- while (1) {
1473
- switch (_context8.prev = _context8.next) {
1474
- case 0:
1475
- options = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
1476
- _options$callbackUrl2 = options.callbackUrl, callbackUrl = _options$callbackUrl2 === void 0 ? window.location.href : _options$callbackUrl2, _options$redirect2 = options.redirect, redirect = _options$redirect2 === void 0 ? true : _options$redirect2;
1477
- baseUrl = _apiBaseUrl();
1478
- _context8.t0 = {
1479
- "Content-Type": "application/x-www-form-urlencoded"
1480
- };
1481
- _context8.t1 = URLSearchParams;
1482
- _context8.next = 7;
1483
- return getCsrfToken();
1484
-
1485
- case 7:
1486
- _context8.t2 = _context8.sent;
1487
- _context8.t3 = callbackUrl;
1488
- _context8.t4 = {
1489
- csrfToken: _context8.t2,
1490
- callbackUrl: _context8.t3,
1491
- json: true
1492
- };
1493
- _context8.t5 = new _context8.t1(_context8.t4);
1494
- fetchOptions = {
1495
- method: "post",
1496
- headers: _context8.t0,
1497
- body: _context8.t5
1498
- };
1499
- _context8.next = 14;
1500
- return fetch("".concat(baseUrl, "/signout"), fetchOptions);
1501
-
1502
- case 14:
1503
- res = _context8.sent;
1504
- _context8.next = 17;
1505
- return res.json();
1506
-
1507
- case 17:
1508
- data = _context8.sent;
1509
- broadcast.post({
1510
- event: "session",
1511
- data: {
1512
- trigger: "signout"
1513
- }
1514
- });
1515
-
1516
- if (!redirect) {
1517
- _context8.next = 24;
1518
- break;
1519
- }
1520
-
1521
- url = (_data$url2 = data.url) !== null && _data$url2 !== void 0 ? _data$url2 : callbackUrl;
1522
- window.location.replace(url);
1523
- if (url.includes("#")) window.location.reload();
1524
- return _context8.abrupt("return");
415
+ json: true
416
+ })
417
+ };
418
+ var res = yield fetch("".concat(baseUrl, "/signout"), fetchOptions);
419
+ var data = yield res.json();
420
+ broadcast.post({
421
+ event: 'session',
422
+ data: {
423
+ trigger: 'signout'
424
+ }
425
+ });
1525
426
 
1526
- case 24:
1527
- _context8.next = 26;
1528
- return __NEXTAUTH._getSession({
1529
- event: "storage"
1530
- });
427
+ if (redirect) {
428
+ var _data$url2;
1531
429
 
1532
- case 26:
1533
- return _context8.abrupt("return", data);
430
+ var url = (_data$url2 = data.url) !== null && _data$url2 !== void 0 ? _data$url2 : callbackUrl;
431
+ window.location = url;
432
+ if (url.includes('#')) window.location.reload();
433
+ return;
434
+ }
1534
435
 
1535
- case 27:
1536
- case "end":
1537
- return _context8.stop();
1538
- }
1539
- }
1540
- }, _callee8);
1541
- }));
436
+ yield __NEXTAUTH._getSession({
437
+ event: 'storage'
438
+ });
439
+ return data;
440
+ });
1542
441
  return _signOut.apply(this, arguments);
1543
442
  }
1544
443
 
1545
444
  function setOptions() {
1546
- var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1547
- baseUrl = _ref3.baseUrl,
1548
- basePath = _ref3.basePath,
1549
- clientMaxAge = _ref3.clientMaxAge,
1550
- keepAlive = _ref3.keepAlive;
1551
-
445
+ var {
446
+ baseUrl,
447
+ basePath,
448
+ clientMaxAge,
449
+ keepAlive
450
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1552
451
  if (baseUrl) __NEXTAUTH.baseUrl = baseUrl;
1553
452
  if (basePath) __NEXTAUTH.basePath = basePath;
1554
453
  if (clientMaxAge) __NEXTAUTH.clientMaxAge = clientMaxAge;
1555
454
 
1556
455
  if (keepAlive) {
1557
456
  __NEXTAUTH.keepAlive = keepAlive;
1558
- if (typeof window === "undefined") return;
457
+ if (typeof window === 'undefined') return;
1559
458
 
1560
459
  if (__NEXTAUTH._clientSyncTimer !== null) {
1561
460
  clearTimeout(__NEXTAUTH._clientSyncTimer);
1562
461
  }
1563
462
 
1564
- __NEXTAUTH._clientSyncTimer = setTimeout((0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2() {
1565
- return _regenerator.default.wrap(function _callee2$(_context2) {
1566
- while (1) {
1567
- switch (_context2.prev = _context2.next) {
1568
- case 0:
1569
- if (__NEXTAUTH._clientSession) {
1570
- _context2.next = 2;
1571
- break;
1572
- }
1573
-
1574
- return _context2.abrupt("return");
1575
-
1576
- case 2:
1577
- _context2.next = 4;
1578
- return __NEXTAUTH._getSession({
1579
- event: "timer"
1580
- });
1581
-
1582
- case 4:
1583
- case "end":
1584
- return _context2.stop();
1585
- }
1586
- }
1587
- }, _callee2);
1588
- })), keepAlive * 1000);
463
+ __NEXTAUTH._clientSyncTimer = setTimeout(_asyncToGenerator(function* () {
464
+ if (!__NEXTAUTH._clientSession) return;
465
+ yield __NEXTAUTH._getSession({
466
+ event: 'timer'
467
+ });
468
+ }), keepAlive * 1000);
1589
469
  }
1590
470
  }
1591
471
 
1592
- function Provider(_ref5) {
1593
- var children = _ref5.children,
1594
- session = _ref5.session,
1595
- options = _ref5.options;
472
+ function Provider(_ref3) {
473
+ var {
474
+ children,
475
+ session,
476
+ options
477
+ } = _ref3;
1596
478
  setOptions(options);
1597
479
  return (0, React__default.createElement)(SessionContext.Provider, {
1598
480
  value: useSession(session)
@@ -1604,74 +486,34 @@ function _fetchData(_x4) {
1604
486
  }
1605
487
 
1606
488
  function _fetchData2() {
1607
- _fetchData2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee9(path) {
1608
- var _ref7,
1609
- ctx,
1610
- _ref7$req,
1611
- req,
1612
- baseUrl,
1613
- options,
1614
- res,
1615
- data,
1616
- _args9 = arguments;
1617
-
1618
- return _regenerator.default.wrap(function _callee9$(_context9) {
1619
- while (1) {
1620
- switch (_context9.prev = _context9.next) {
1621
- case 0:
1622
- _ref7 = _args9.length > 1 && _args9[1] !== undefined ? _args9[1] : {}, ctx = _ref7.ctx, _ref7$req = _ref7.req, req = _ref7$req === void 0 ? ctx === null || ctx === void 0 ? void 0 : ctx.req : _ref7$req;
1623
- _context9.prev = 1;
1624
- _context9.next = 4;
1625
- return _apiBaseUrl();
1626
-
1627
- case 4:
1628
- baseUrl = _context9.sent;
1629
- options = req ? {
1630
- headers: {
1631
- cookie: req.headers.cookie
1632
- }
1633
- } : {};
1634
- _context9.next = 8;
1635
- return fetch("".concat(baseUrl, "/").concat(path), options);
1636
-
1637
- case 8:
1638
- res = _context9.sent;
1639
- _context9.next = 11;
1640
- return res.json();
1641
-
1642
- case 11:
1643
- data = _context9.sent;
1644
-
1645
- if (res.ok) {
1646
- _context9.next = 14;
1647
- break;
1648
- }
1649
-
1650
- throw data;
489
+ _fetchData2 = _asyncToGenerator(function* (path) {
490
+ var {
491
+ ctx,
492
+ req = ctx === null || ctx === void 0 ? void 0 : ctx.req
493
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1651
494
 
1652
- case 14:
1653
- return _context9.abrupt("return", Object.keys(data).length > 0 ? data : null);
1654
-
1655
- case 17:
1656
- _context9.prev = 17;
1657
- _context9.t0 = _context9["catch"](1);
1658
- logger$1.error("CLIENT_FETCH_ERROR", path, _context9.t0);
1659
- return _context9.abrupt("return", null);
1660
-
1661
- case 21:
1662
- case "end":
1663
- return _context9.stop();
495
+ try {
496
+ var baseUrl = yield _apiBaseUrl();
497
+ var options = req ? {
498
+ headers: {
499
+ cookie: req.headers.cookie
1664
500
  }
1665
- }
1666
- }, _callee9, null, [[1, 17]]);
1667
- }));
501
+ } : {};
502
+ var res = yield fetch("".concat(baseUrl, "/").concat(path), options);
503
+ var data = yield res.json();
504
+ return Object.keys(data).length > 0 ? data : null;
505
+ } catch (error) {
506
+ logger$1.error('CLIENT_FETCH_ERROR', path, error);
507
+ return null;
508
+ }
509
+ });
1668
510
  return _fetchData2.apply(this, arguments);
1669
511
  }
1670
512
 
1671
513
  function _apiBaseUrl() {
1672
- if (typeof window === "undefined") {
514
+ if (typeof window === 'undefined') {
1673
515
  if (!process.env.NEXTAUTH_URL) {
1674
- logger$1.warn("NEXTAUTH_URL", "NEXTAUTH_URL environment variable not set");
516
+ logger$1.warn('NEXTAUTH_URL', 'NEXTAUTH_URL environment variable not set');
1675
517
  }
1676
518
 
1677
519
  return "".concat(__NEXTAUTH.baseUrlServer).concat(__NEXTAUTH.basePathServer);
@@ -1685,68 +527,43 @@ function _now() {
1685
527
  }
1686
528
 
1687
529
  function BroadcastChannel() {
1688
- var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "nextauth.message";
530
+ var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'nextauth.message';
1689
531
  return {
1690
- receive: function receive(onReceive) {
1691
- if (typeof window === "undefined") return;
1692
- window.addEventListener("storage", function () {
1693
- var _ref6 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(event) {
1694
- var message;
1695
- return _regenerator.default.wrap(function _callee3$(_context3) {
1696
- while (1) {
1697
- switch (_context3.prev = _context3.next) {
1698
- case 0:
1699
- if (!(event.key !== name)) {
1700
- _context3.next = 2;
1701
- break;
1702
- }
1703
-
1704
- return _context3.abrupt("return");
1705
-
1706
- case 2:
1707
- message = JSON.parse(event.newValue);
1708
-
1709
- if (!((message === null || message === void 0 ? void 0 : message.event) !== "session" || !(message !== null && message !== void 0 && message.data))) {
1710
- _context3.next = 5;
1711
- break;
1712
- }
1713
-
1714
- return _context3.abrupt("return");
1715
-
1716
- case 5:
1717
- onReceive(message);
1718
-
1719
- case 6:
1720
- case "end":
1721
- return _context3.stop();
1722
- }
1723
- }
1724
- }, _callee3);
1725
- }));
532
+ receive(onReceive) {
533
+ if (typeof window === 'undefined') return;
534
+ window.addEventListener('storage', function () {
535
+ var _ref4 = _asyncToGenerator(function* (event) {
536
+ if (event.key !== name) return;
537
+ var message = JSON.parse(event.newValue);
538
+ if ((message === null || message === void 0 ? void 0 : message.event) !== 'session' || !(message !== null && message !== void 0 && message.data)) return;
539
+ onReceive(message);
540
+ });
1726
541
 
1727
542
  return function (_x5) {
1728
- return _ref6.apply(this, arguments);
543
+ return _ref4.apply(this, arguments);
1729
544
  };
1730
545
  }());
1731
546
  },
1732
- post: function post(message) {
1733
- if (typeof localStorage === "undefined") return;
547
+
548
+ post(message) {
549
+ if (typeof localStorage === 'undefined') return;
1734
550
  localStorage.setItem(name, JSON.stringify(_objectSpread(_objectSpread({}, message), {}, {
1735
551
  timestamp: _now()
1736
552
  })));
1737
553
  }
554
+
1738
555
  };
1739
556
  }
1740
557
 
1741
558
  var _default = {
1742
- getSession: getSession,
1743
- getCsrfToken: getCsrfToken,
1744
- getProviders: getProviders,
1745
- useSession: useSession,
1746
- signIn: signIn,
1747
- signOut: signOut,
1748
- Provider: Provider,
1749
- setOptions: setOptions,
559
+ getSession,
560
+ getCsrfToken,
561
+ getProviders,
562
+ useSession,
563
+ signIn,
564
+ signOut,
565
+ Provider,
566
+ setOptions,
1750
567
  options: setOptions,
1751
568
  session: getSession,
1752
569
  providers: getProviders,
@@ -1759,23 +576,16 @@ exports.default = _default;
1759
576
 
1760
577
  unwrapExports(client$1);
1761
578
  client$1.useSession;
1762
- client$1.session;
1763
579
  client$1.getSession;
1764
- client$1.csrfToken;
1765
- client$1.getCsrfToken;
1766
- client$1.providers;
1767
580
  client$1.getProviders;
1768
- client$1.signin;
1769
581
  client$1.signIn;
1770
- client$1.signout;
1771
582
  client$1.signOut;
1772
- client$1.options;
1773
583
  client$1.setOptions;
1774
584
  client$1.Provider;
1775
585
 
1776
586
  var client = client$1.default;
1777
587
 
1778
- var css = ".AuthWrapper-module_loginBox__3l-BE {\n margin-bottom: 2rem;\n width: 350px;\n max-width: 90vw;\n margin-left: auto;\n margin-right: auto;\n /* box-shadow: 2px 5px 12px rgba(0, 0, 0, 0.15); */\n background: #fff;\n z-index: 1;\n}\n.AuthWrapper-module_loginBox_title__12rGD {\n margin-bottom: 2rem;\n text-align: center;\n}\n.AuthWrapper-module_bar__1dafn {\n background: #eee;\n margin-left: unset;\n margin-right: unset;\n}\n.AuthWrapper-module_bar__1dafn:nth-child(1) {\n float: left;\n border-right: 1rem solid #fff;\n background: rgb(245, 245, 245);\n height: 10rem;\n width: 25%;\n margin-left: auto;\n margin-right: auto;\n margin-bottom: 2rem;\n}\n.AuthWrapper-module_bar__1dafn:nth-child(2n) {\n width: 97%;\n height: 1.5rem;\n margin-bottom: 0.25rem;\n}\n.AuthWrapper-module_bar__1dafn.AuthWrapper-module_bar__1dafn:nth-child(3n) {\n width: 96%;\n height: 1.5rem;\n margin-bottom: 1.5rem;\n}\n.AuthWrapper-module_bar__1dafn.AuthWrapper-module_bar__1dafn:nth-child(4n) {\n width: 72%;\n height: 1.5rem;\n margin-bottom: 0.25rem;\n}\n.AuthWrapper-module_bar__1dafn.AuthWrapper-module_bar__1dafn:nth-child(5n) {\n width: 88%;\n height: 1.5rem;\n margin-bottom: 0.25rem;\n}\n\n.AuthWrapper-module_iframe__2wDJW {\n margin-top: -3rem;\n border: none;\n width: 100%;\n height: 1900px;\n}";
588
+ var css = ".AuthWrapper-module_loginBox__3l-BE {\r\n margin-bottom: 2rem;\r\n width: 350px;\r\n max-width: 90vw;\r\n margin-left: auto;\r\n margin-right: auto;\r\n /* box-shadow: 2px 5px 12px rgba(0, 0, 0, 0.15); */\r\n background: #fff;\r\n z-index: 1;\r\n}\r\n.AuthWrapper-module_loginBox_title__12rGD {\r\n margin-bottom: 2rem;\r\n text-align: center;\r\n}\r\n.AuthWrapper-module_bar__1dafn {\r\n background: #eee;\r\n margin-left: unset;\r\n margin-right: unset;\r\n}\r\n.AuthWrapper-module_bar__1dafn:nth-child(1) {\r\n float: left;\r\n border-right: 1rem solid #fff;\r\n background: rgb(245, 245, 245);\r\n height: 10rem;\r\n width: 25%;\r\n margin-left: auto;\r\n margin-right: auto;\r\n margin-bottom: 2rem;\r\n}\r\n.AuthWrapper-module_bar__1dafn:nth-child(2n) {\r\n width: 97%;\r\n height: 1.5rem;\r\n margin-bottom: 0.25rem;\r\n}\r\n.AuthWrapper-module_bar__1dafn.AuthWrapper-module_bar__1dafn:nth-child(3n) {\r\n width: 96%;\r\n height: 1.5rem;\r\n margin-bottom: 1.5rem;\r\n}\r\n.AuthWrapper-module_bar__1dafn.AuthWrapper-module_bar__1dafn:nth-child(4n) {\r\n width: 72%;\r\n height: 1.5rem;\r\n margin-bottom: 0.25rem;\r\n}\r\n.AuthWrapper-module_bar__1dafn.AuthWrapper-module_bar__1dafn:nth-child(5n) {\r\n width: 88%;\r\n height: 1.5rem;\r\n margin-bottom: 0.25rem;\r\n}\r\n\r\n.AuthWrapper-module_iframe__2wDJW {\r\n margin-top: -3rem;\r\n border: none;\r\n width: 100%;\r\n height: 1900px;\r\n}";
1779
589
  var styles = { "loginBox": "AuthWrapper-module_loginBox__3l-BE", "loginBox_title": "AuthWrapper-module_loginBox_title__12rGD", "bar": "AuthWrapper-module_bar__1dafn", "iframe": "AuthWrapper-module_iframe__2wDJW" };
1780
590
  styleInject(css);
1781
591