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