@mjhls/mjh-framework 1.0.985-article-abstract-v1 → 1.0.985
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/dist/cjs/AD.js +1 -1
- package/dist/cjs/AD300x250.js +1 -2
- package/dist/cjs/AD300x250x600.js +1 -2
- package/dist/cjs/AD728x90.js +1 -2
- package/dist/cjs/ADFloatingFooter.js +1 -2
- package/dist/cjs/ADGutter.js +1 -2
- package/dist/cjs/ADSkyscraper.js +1 -2
- package/dist/cjs/ADSponsoredResources.js +1 -2
- package/dist/cjs/ADWebcast.js +1 -2
- package/dist/cjs/ADWelcome.js +1 -2
- package/dist/cjs/AdSlot.js +1 -2
- package/dist/cjs/AdSlotsProvider.js +1 -2
- package/dist/cjs/AlgoliaSearch.js +18 -14281
- package/dist/cjs/ArticleCarousel.js +1 -1
- package/dist/cjs/ArticleProgramLandingPage.js +6 -7
- package/dist/cjs/ArticleSeriesLandingPage.js +4 -5
- package/dist/cjs/ArticleSeriesListing.js +2 -3
- package/dist/cjs/Auth.js +3 -3
- package/dist/cjs/AuthWrapper.js +293 -1469
- package/dist/cjs/{BlockContent-9ebd251f.js → BlockContent-36e54d77.js} +1 -1
- package/dist/cjs/CMEDeck.js +1 -2
- package/dist/cjs/Column3.js +1 -2
- package/dist/cjs/ConferenceArticleCard.js +1 -1
- package/dist/cjs/ContentCardPaginated.js +6 -6
- package/dist/cjs/DeckContent.js +4 -5
- package/dist/cjs/DeckQueue.js +3 -4
- package/dist/cjs/DeckQueuePaginated.js +5 -5
- package/dist/cjs/{Dfp-9be904d5.js → Dfp-94f8ccdf.js} +1 -2
- package/dist/cjs/ExternalResources.js +6 -7
- package/dist/cjs/Feature.js +1 -1
- package/dist/cjs/ForbesHero.js +1 -1
- package/dist/cjs/GridContent.js +6 -7
- package/dist/cjs/GridContentPaginated.js +8 -8
- package/dist/cjs/GridHero.js +2 -2
- package/dist/cjs/GroupDeck.js +1 -1
- package/dist/cjs/Hero.js +2 -2
- package/dist/cjs/HorizontalArticleListing.js +6 -7
- package/dist/cjs/HorizontalHero.js +1 -1
- package/dist/cjs/ImageSlider-a7fb6218.js +182 -0
- package/dist/cjs/IssueContentDeck.js +1 -1
- package/dist/cjs/IssueDeck.js +1 -1
- package/dist/cjs/IssueLanding.js +8 -9
- package/dist/cjs/LeftNav.js +1 -2
- package/dist/cjs/MasterDeck.js +4 -5
- package/dist/cjs/MasterDeckPaginated.js +5 -5
- package/dist/cjs/{MediaSeriesCard-84fa20f4.js → MediaSeriesCard-64f3487c.js} +390 -393
- package/dist/cjs/MediaSeriesLanding.js +10 -12
- package/dist/cjs/MediaSeriesLandingPaginated.js +12 -13
- package/dist/cjs/OncliveHero.js +1 -1
- package/dist/cjs/OncliveLargeHero.js +2 -2
- package/dist/cjs/Pagination-1e0d5f1d.js +90 -0
- package/dist/cjs/PartnerDetailListing.js +12 -13
- package/dist/cjs/PartnerDetailListingPaginated.js +14 -14
- package/dist/cjs/PubSection.js +5 -6
- package/dist/cjs/PublicationDeck.js +1 -1
- package/dist/cjs/PublicationLanding.js +0 -4
- package/dist/cjs/QueueDeckExpanded.js +5 -6
- package/dist/cjs/QueueDeckExpandedPaginated.js +7 -7
- package/dist/cjs/RelatedContent.js +1 -1
- package/dist/cjs/Schema.js +1 -1
- package/dist/cjs/SeriesListingDeck.js +3 -4
- package/dist/cjs/TaxonomyCard.js +2 -2
- package/dist/cjs/TaxonomyDescription.js +6 -7
- package/dist/cjs/TemplateNormal.js +1 -2
- package/dist/cjs/ThumbnailCard.js +2 -2
- package/dist/cjs/VerticalHero.js +1 -1
- package/dist/cjs/VideoProgramLandingPage.js +6 -7
- package/dist/cjs/VideoSeriesCard.js +1 -1
- package/dist/cjs/VideoSeriesLandingPage.js +4 -5
- package/dist/cjs/VideoSeriesListing.js +2 -3
- package/dist/cjs/View.js +11 -31
- package/dist/cjs/YahooHero.js +2 -2
- package/dist/cjs/YoutubeGroup.js +1 -1
- package/dist/cjs/{entities-df1aed86.js → entities-3f9d0f2f.js} +0 -4
- package/dist/cjs/getRelatedArticle.js +2 -2
- package/dist/cjs/getSerializers.js +6 -7
- package/dist/cjs/{index-fc2f1ca2.js → index-0e4427c8.js} +467 -2
- package/dist/cjs/{index-7f3d9184.js → index-803853cf.js} +4 -4
- package/dist/cjs/{index-d48b231c.js → index-efca863c.js} +5 -5
- package/dist/cjs/index.js +14 -15
- package/dist/cjs/urlFor.js +1 -1
- package/dist/cjs/{util-93a37fd0.js → util-6f784d85.js} +0 -11
- package/dist/esm/AD.js +1 -1
- package/dist/esm/AD300x250.js +8 -9
- package/dist/esm/AD300x250x600.js +8 -9
- package/dist/esm/AD728x90.js +8 -9
- package/dist/esm/ADFloatingFooter.js +8 -9
- package/dist/esm/ADFooter.js +3 -3
- package/dist/esm/ADGutter.js +8 -9
- package/dist/esm/{ADInfeed-6d1fc6bf.js → ADInfeed-f684cac9.js} +1 -1
- package/dist/esm/ADSkyscraper.js +8 -9
- package/dist/esm/ADSponsoredResources.js +8 -9
- package/dist/esm/ADWebcast.js +8 -9
- package/dist/esm/ADWelcome.js +8 -9
- package/dist/esm/{ADlgInfeed-dc36c928.js → ADlgInfeed-8c438cee.js} +1 -1
- package/dist/esm/AccordionPanel.js +3 -3
- package/dist/esm/AdSlot.js +8 -9
- package/dist/esm/AdSlotsProvider.js +6 -7
- package/dist/esm/AlgoliaSearch.js +18 -14281
- package/dist/esm/AlphabeticList.js +6 -6
- package/dist/esm/ArticleCarousel.js +5 -5
- package/dist/esm/ArticleProgramLandingPage.js +21 -22
- package/dist/esm/ArticleSeriesLandingPage.js +17 -18
- package/dist/esm/ArticleSeriesListing.js +11 -12
- package/dist/esm/Auth.js +11 -11
- package/dist/esm/AuthWrapper.js +290 -1466
- package/dist/esm/{AuthorComponent-11adff02.js → AuthorComponent-defe68b6.js} +1 -1
- package/dist/esm/Beam.js +5 -5
- package/dist/esm/{BlockContent-1e73bd2c.js → BlockContent-c99c9a8d.js} +1 -1
- package/dist/esm/Breadcrumbs.js +3 -3
- package/dist/esm/CMEDeck.js +8 -9
- package/dist/esm/Column2.js +6 -6
- package/dist/esm/Column3.js +10 -11
- package/dist/esm/ConferenceArticleCard.js +4 -4
- package/dist/esm/ContentCardPaginated.js +19 -19
- package/dist/esm/DeckContent.js +17 -18
- package/dist/esm/DeckQueue.js +14 -15
- package/dist/esm/DeckQueuePaginated.js +17 -17
- package/dist/esm/{Dfp-102f0beb.js → Dfp-4b99f79d.js} +4 -5
- package/dist/esm/EventsDeck.js +10 -10
- package/dist/esm/ExternalResources.js +21 -22
- package/dist/esm/Feature.js +4 -4
- package/dist/esm/ForbesHero.js +5 -5
- package/dist/esm/GridContent.js +20 -21
- package/dist/esm/GridContentPaginated.js +22 -22
- package/dist/esm/GridHero.js +6 -6
- package/dist/esm/GroupDeck.js +6 -6
- package/dist/esm/HamMagazine.js +6 -6
- package/dist/esm/Hero.js +5 -5
- package/dist/esm/HorizontalArticleListing.js +21 -22
- package/dist/esm/HorizontalHero.js +4 -4
- package/dist/esm/ImageSlider-eab2fe41.js +176 -0
- package/dist/esm/IssueContentDeck.js +5 -5
- package/dist/esm/IssueDeck.js +7 -7
- package/dist/esm/IssueLanding.js +24 -25
- package/dist/esm/LeftNav.js +8 -9
- package/dist/esm/MasterDeck.js +17 -18
- package/dist/esm/MasterDeckPaginated.js +18 -18
- package/dist/esm/{MediaSeriesCard-22059712.js → MediaSeriesCard-a484aaa6.js} +106 -109
- package/dist/esm/MediaSeriesLanding.js +25 -27
- package/dist/esm/MediaSeriesLandingPaginated.js +27 -28
- package/dist/esm/NavDvm.js +5 -5
- package/dist/esm/NavMagazine.js +6 -6
- package/dist/esm/NavNative.js +5 -5
- package/dist/esm/OncliveHero.js +4 -4
- package/dist/esm/OncliveLargeHero.js +6 -6
- package/dist/esm/PageFilter.js +3 -3
- package/dist/esm/Pagination-cd21f8c2.js +82 -0
- package/dist/esm/PartnerDetailListing.js +27 -28
- package/dist/esm/PartnerDetailListingPaginated.js +29 -29
- package/dist/esm/PixelTracking.js +3 -3
- package/dist/esm/PopUpModal.js +3 -3
- package/dist/esm/PtceDeck.js +7 -7
- package/dist/esm/PubSection.js +14 -15
- package/dist/esm/PubToc.js +5 -5
- package/dist/esm/PublicationDeck.js +4 -4
- package/dist/esm/PublicationLanding.js +9 -13
- package/dist/esm/QueueDeckExpanded.js +14 -15
- package/dist/esm/QueueDeckExpandedPaginated.js +16 -16
- package/dist/esm/RelatedContent.js +4 -4
- package/dist/esm/Schema.js +8 -8
- package/dist/esm/Search.js +3 -3
- package/dist/esm/Segment.js +4 -4
- package/dist/esm/SeriesListingDeck.js +9 -10
- package/dist/esm/{SeriesSlider-e495571f.js → SeriesSlider-609f9d94.js} +1 -1
- package/dist/esm/SideFooter.js +6 -6
- package/dist/esm/{SocialSearchComponent-4b56cd8c.js → SocialSearchComponent-1d8a9f59.js} +1 -1
- package/dist/esm/TaxonomyCard.js +6 -6
- package/dist/esm/TaxonomyDescription.js +21 -22
- package/dist/esm/TemplateNormal.js +11 -12
- package/dist/esm/ThumbnailCard.js +5 -5
- package/dist/esm/Ustream.js +6 -6
- package/dist/esm/VerticalHero.js +4 -4
- package/dist/esm/VideoProgramLandingPage.js +21 -22
- package/dist/esm/VideoSeriesCard.js +6 -6
- package/dist/esm/VideoSeriesFilter.js +5 -5
- package/dist/esm/VideoSeriesLandingPage.js +17 -18
- package/dist/esm/VideoSeriesListing.js +11 -12
- package/dist/esm/View.js +27 -48
- package/dist/esm/YahooHero.js +6 -6
- package/dist/esm/YoutubeGroup.js +4 -4
- package/dist/esm/{_is-array-8d21b9e3.js → _is-array-893ab020.js} +1 -1
- package/dist/esm/{_iter-detect-98db3b07.js → _iter-detect-f089461c.js} +1 -1
- package/dist/esm/{_object-sap-7cee6f84.js → _object-sap-169d6272.js} +1 -1
- package/dist/esm/{_object-to-array-2300e51b.js → _object-to-array-50a6b9a3.js} +1 -1
- package/dist/esm/{asyncToGenerator-958ef5fc.js → asyncToGenerator-9716ae8d.js} +3 -3
- package/dist/esm/{core.get-iterator-method-ea258bb1.js → core.get-iterator-method-e903ff31.js} +1 -1
- package/dist/esm/{define-property-5f1bda73.js → define-property-99e66838.js} +1 -1
- package/dist/esm/{defineProperty-8c30428f.js → defineProperty-8fa0bc8d.js} +1 -1
- package/dist/esm/{entities-6d9154b4.js → entities-932b50cf.js} +0 -4
- package/dist/esm/{extends-6d8e3924.js → extends-dc6a71fd.js} +1 -1
- package/dist/esm/faundadb.js +4 -4
- package/dist/esm/getPtceActivities.js +4 -4
- package/dist/esm/getRelatedArticle.js +7 -7
- package/dist/esm/getRootDocGroup.js +4 -4
- package/dist/esm/getSerializers.js +21 -22
- package/dist/esm/{getTargeting-04d979c9.js → getTargeting-0cdf8983.js} +2 -2
- package/dist/esm/getTargeting.js +5 -5
- package/dist/esm/{index-3f5c03b2.js → index-0dbff1d1.js} +5 -5
- package/dist/esm/{index-f0fc23eb.js → index-5cc7b406.js} +466 -1
- package/dist/esm/{index-1df13f26.js → index-f9d13c55.js} +14 -14
- package/dist/esm/index.js +34 -35
- package/dist/esm/{inherits-a6ba2ec4.js → inherits-8a801a18.js} +4 -4
- package/dist/esm/{keys-31dcdb31.js → keys-425c8ab0.js} +2 -2
- package/dist/esm/{slicedToArray-6ebcbfea.js → slicedToArray-ca2c8b8d.js} +2 -2
- package/dist/esm/{stringify-2b084bee.js → stringify-c21932b3.js} +1 -1
- package/dist/esm/{toConsumableArray-f7074d7c.js → toConsumableArray-7b1c0e23.js} +2 -2
- package/dist/esm/{typeof-e9fc0c5d.js → typeof-83d9eb10.js} +3 -3
- package/dist/esm/urlFor.js +4 -4
- package/dist/esm/{urlForFile-b69adffc.js → urlForFile-413f5ddb.js} +1 -1
- package/dist/esm/{ustream-api-d3714624.js → ustream-api-41166338.js} +4 -4
- package/dist/esm/{util-8ed16d48.js → util-3ab476bf.js} +0 -11
- package/dist/esm/{web.dom.iterable-ab4dea5c.js → web.dom.iterable-fdf034f5.js} +1 -1
- package/package.json +1 -1
- package/dist/cjs/ImageSlider-6c00b878.js +0 -2813
- package/dist/cjs/Pagination-2a3d0103.js +0 -97
- package/dist/cjs/defineProperty-e0fb52c5.js +0 -73
- package/dist/cjs/events-1b438fe7.js +0 -469
- package/dist/cjs/index-50be6759.js +0 -105
- package/dist/cjs/typeof-1358762e.js +0 -33
- package/dist/esm/ImageSlider-f84174cb.js +0 -2804
- package/dist/esm/Pagination-dc30727b.js +0 -90
- package/dist/esm/defineProperty-23a8f8cd.js +0 -68
- package/dist/esm/events-6c3a7a63.js +0 -467
- package/dist/esm/index-98ca9cec.js +0 -100
- package/dist/esm/typeof-2f07d0e8.js +0 -30
- /package/dist/cjs/{ADInfeed-81006615.js → ADInfeed-cf54cb8a.js} +0 -0
- /package/dist/cjs/{ADlgInfeed-0db07099.js → ADlgInfeed-d06624d8.js} +0 -0
- /package/dist/cjs/{PublicationFeature-5ccf9b13.js → PublicationFeature-be5f3503.js} +0 -0
- /package/dist/cjs/{SeriesSlider-74546d19.js → SeriesSlider-b94f1dd5.js} +0 -0
- /package/dist/esm/{PublicationFeature-d88e76b9.js → PublicationFeature-03500094.js} +0 -0
package/dist/cjs/AuthWrapper.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var slicedToArray
|
|
3
|
+
var slicedToArray = require('./slicedToArray-067dd3bc.js');
|
|
4
4
|
var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
|
|
5
|
-
var _typeof = require('./typeof-1358762e.js');
|
|
6
|
-
var defineProperty = require('./defineProperty-e0fb52c5.js');
|
|
7
5
|
var React = require('react');
|
|
8
6
|
var reactBootstrap = require('react-bootstrap');
|
|
9
7
|
var styleInject_es = require('./style-inject.es-dcee06b6.js');
|
|
@@ -14,874 +12,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
14
12
|
|
|
15
13
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
14
|
|
|
17
|
-
var interopRequireDefault = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
18
|
-
function _interopRequireDefault(obj) {
|
|
19
|
-
return obj && obj.__esModule ? obj : {
|
|
20
|
-
"default": obj
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
module.exports = _interopRequireDefault;
|
|
25
|
-
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
_commonjsHelpers.unwrapExports(interopRequireDefault);
|
|
29
|
-
|
|
30
|
-
var runtime_1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
31
|
-
/**
|
|
32
|
-
* Copyright (c) 2014-present, Facebook, Inc.
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the MIT license found in the
|
|
35
|
-
* LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
var runtime = (function (exports) {
|
|
39
|
-
|
|
40
|
-
var Op = Object.prototype;
|
|
41
|
-
var hasOwn = Op.hasOwnProperty;
|
|
42
|
-
var undefined$1; // More compressible than void 0.
|
|
43
|
-
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
|
44
|
-
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
|
45
|
-
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
|
46
|
-
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
47
|
-
|
|
48
|
-
function define(obj, key, value) {
|
|
49
|
-
Object.defineProperty(obj, key, {
|
|
50
|
-
value: value,
|
|
51
|
-
enumerable: true,
|
|
52
|
-
configurable: true,
|
|
53
|
-
writable: true
|
|
54
|
-
});
|
|
55
|
-
return obj[key];
|
|
56
|
-
}
|
|
57
|
-
try {
|
|
58
|
-
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
59
|
-
define({}, "");
|
|
60
|
-
} catch (err) {
|
|
61
|
-
define = function(obj, key, value) {
|
|
62
|
-
return obj[key] = value;
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
67
|
-
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
|
68
|
-
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
|
69
|
-
var generator = Object.create(protoGenerator.prototype);
|
|
70
|
-
var context = new Context(tryLocsList || []);
|
|
71
|
-
|
|
72
|
-
// The ._invoke method unifies the implementations of the .next,
|
|
73
|
-
// .throw, and .return methods.
|
|
74
|
-
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
75
|
-
|
|
76
|
-
return generator;
|
|
77
|
-
}
|
|
78
|
-
exports.wrap = wrap;
|
|
79
|
-
|
|
80
|
-
// Try/catch helper to minimize deoptimizations. Returns a completion
|
|
81
|
-
// record like context.tryEntries[i].completion. This interface could
|
|
82
|
-
// have been (and was previously) designed to take a closure to be
|
|
83
|
-
// invoked without arguments, but in all the cases we care about we
|
|
84
|
-
// already have an existing method we want to call, so there's no need
|
|
85
|
-
// to create a new function object. We can even get away with assuming
|
|
86
|
-
// the method takes exactly one argument, since that happens to be true
|
|
87
|
-
// in every case, so we don't have to touch the arguments object. The
|
|
88
|
-
// only additional allocation required is the completion record, which
|
|
89
|
-
// has a stable shape and so hopefully should be cheap to allocate.
|
|
90
|
-
function tryCatch(fn, obj, arg) {
|
|
91
|
-
try {
|
|
92
|
-
return { type: "normal", arg: fn.call(obj, arg) };
|
|
93
|
-
} catch (err) {
|
|
94
|
-
return { type: "throw", arg: err };
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
var GenStateSuspendedStart = "suspendedStart";
|
|
99
|
-
var GenStateSuspendedYield = "suspendedYield";
|
|
100
|
-
var GenStateExecuting = "executing";
|
|
101
|
-
var GenStateCompleted = "completed";
|
|
102
|
-
|
|
103
|
-
// Returning this object from the innerFn has the same effect as
|
|
104
|
-
// breaking out of the dispatch switch statement.
|
|
105
|
-
var ContinueSentinel = {};
|
|
106
|
-
|
|
107
|
-
// Dummy constructor functions that we use as the .constructor and
|
|
108
|
-
// .constructor.prototype properties for functions that return Generator
|
|
109
|
-
// objects. For full spec compliance, you may wish to configure your
|
|
110
|
-
// minifier not to mangle the names of these two functions.
|
|
111
|
-
function Generator() {}
|
|
112
|
-
function GeneratorFunction() {}
|
|
113
|
-
function GeneratorFunctionPrototype() {}
|
|
114
|
-
|
|
115
|
-
// This is a polyfill for %IteratorPrototype% for environments that
|
|
116
|
-
// don't natively support it.
|
|
117
|
-
var IteratorPrototype = {};
|
|
118
|
-
IteratorPrototype[iteratorSymbol] = function () {
|
|
119
|
-
return this;
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
var getProto = Object.getPrototypeOf;
|
|
123
|
-
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
124
|
-
if (NativeIteratorPrototype &&
|
|
125
|
-
NativeIteratorPrototype !== Op &&
|
|
126
|
-
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
|
127
|
-
// This environment has a native %IteratorPrototype%; use it instead
|
|
128
|
-
// of the polyfill.
|
|
129
|
-
IteratorPrototype = NativeIteratorPrototype;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
var Gp = GeneratorFunctionPrototype.prototype =
|
|
133
|
-
Generator.prototype = Object.create(IteratorPrototype);
|
|
134
|
-
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
|
135
|
-
GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
|
136
|
-
GeneratorFunction.displayName = define(
|
|
137
|
-
GeneratorFunctionPrototype,
|
|
138
|
-
toStringTagSymbol,
|
|
139
|
-
"GeneratorFunction"
|
|
140
|
-
);
|
|
141
|
-
|
|
142
|
-
// Helper for defining the .next, .throw, and .return methods of the
|
|
143
|
-
// Iterator interface in terms of a single ._invoke method.
|
|
144
|
-
function defineIteratorMethods(prototype) {
|
|
145
|
-
["next", "throw", "return"].forEach(function(method) {
|
|
146
|
-
define(prototype, method, function(arg) {
|
|
147
|
-
return this._invoke(method, arg);
|
|
148
|
-
});
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
exports.isGeneratorFunction = function(genFun) {
|
|
153
|
-
var ctor = typeof genFun === "function" && genFun.constructor;
|
|
154
|
-
return ctor
|
|
155
|
-
? ctor === GeneratorFunction ||
|
|
156
|
-
// For the native GeneratorFunction constructor, the best we can
|
|
157
|
-
// do is to check its .name property.
|
|
158
|
-
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
|
159
|
-
: false;
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
exports.mark = function(genFun) {
|
|
163
|
-
if (Object.setPrototypeOf) {
|
|
164
|
-
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
|
165
|
-
} else {
|
|
166
|
-
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
167
|
-
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
|
168
|
-
}
|
|
169
|
-
genFun.prototype = Object.create(Gp);
|
|
170
|
-
return genFun;
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
// Within the body of any async function, `await x` is transformed to
|
|
174
|
-
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
|
175
|
-
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
|
176
|
-
// meant to be awaited.
|
|
177
|
-
exports.awrap = function(arg) {
|
|
178
|
-
return { __await: arg };
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
function AsyncIterator(generator, PromiseImpl) {
|
|
182
|
-
function invoke(method, arg, resolve, reject) {
|
|
183
|
-
var record = tryCatch(generator[method], generator, arg);
|
|
184
|
-
if (record.type === "throw") {
|
|
185
|
-
reject(record.arg);
|
|
186
|
-
} else {
|
|
187
|
-
var result = record.arg;
|
|
188
|
-
var value = result.value;
|
|
189
|
-
if (value &&
|
|
190
|
-
typeof value === "object" &&
|
|
191
|
-
hasOwn.call(value, "__await")) {
|
|
192
|
-
return PromiseImpl.resolve(value.__await).then(function(value) {
|
|
193
|
-
invoke("next", value, resolve, reject);
|
|
194
|
-
}, function(err) {
|
|
195
|
-
invoke("throw", err, resolve, reject);
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
|
200
|
-
// When a yielded Promise is resolved, its final value becomes
|
|
201
|
-
// the .value of the Promise<{value,done}> result for the
|
|
202
|
-
// current iteration.
|
|
203
|
-
result.value = unwrapped;
|
|
204
|
-
resolve(result);
|
|
205
|
-
}, function(error) {
|
|
206
|
-
// If a rejected Promise was yielded, throw the rejection back
|
|
207
|
-
// into the async generator function so it can be handled there.
|
|
208
|
-
return invoke("throw", error, resolve, reject);
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
var previousPromise;
|
|
214
|
-
|
|
215
|
-
function enqueue(method, arg) {
|
|
216
|
-
function callInvokeWithMethodAndArg() {
|
|
217
|
-
return new PromiseImpl(function(resolve, reject) {
|
|
218
|
-
invoke(method, arg, resolve, reject);
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
return previousPromise =
|
|
223
|
-
// If enqueue has been called before, then we want to wait until
|
|
224
|
-
// all previous Promises have been resolved before calling invoke,
|
|
225
|
-
// so that results are always delivered in the correct order. If
|
|
226
|
-
// enqueue has not been called before, then it is important to
|
|
227
|
-
// call invoke immediately, without waiting on a callback to fire,
|
|
228
|
-
// so that the async generator function has the opportunity to do
|
|
229
|
-
// any necessary setup in a predictable way. This predictability
|
|
230
|
-
// is why the Promise constructor synchronously invokes its
|
|
231
|
-
// executor callback, and why async functions synchronously
|
|
232
|
-
// execute code before the first await. Since we implement simple
|
|
233
|
-
// async functions in terms of async generators, it is especially
|
|
234
|
-
// important to get this right, even though it requires care.
|
|
235
|
-
previousPromise ? previousPromise.then(
|
|
236
|
-
callInvokeWithMethodAndArg,
|
|
237
|
-
// Avoid propagating failures to Promises returned by later
|
|
238
|
-
// invocations of the iterator.
|
|
239
|
-
callInvokeWithMethodAndArg
|
|
240
|
-
) : callInvokeWithMethodAndArg();
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
// Define the unified helper method that is used to implement .next,
|
|
244
|
-
// .throw, and .return (see defineIteratorMethods).
|
|
245
|
-
this._invoke = enqueue;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
defineIteratorMethods(AsyncIterator.prototype);
|
|
249
|
-
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
|
250
|
-
return this;
|
|
251
|
-
};
|
|
252
|
-
exports.AsyncIterator = AsyncIterator;
|
|
253
|
-
|
|
254
|
-
// Note that simple async functions are implemented on top of
|
|
255
|
-
// AsyncIterator objects; they just return a Promise for the value of
|
|
256
|
-
// the final result produced by the iterator.
|
|
257
|
-
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
258
|
-
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
259
|
-
|
|
260
|
-
var iter = new AsyncIterator(
|
|
261
|
-
wrap(innerFn, outerFn, self, tryLocsList),
|
|
262
|
-
PromiseImpl
|
|
263
|
-
);
|
|
264
|
-
|
|
265
|
-
return exports.isGeneratorFunction(outerFn)
|
|
266
|
-
? iter // If outerFn is a generator, return the full iterator.
|
|
267
|
-
: iter.next().then(function(result) {
|
|
268
|
-
return result.done ? result.value : iter.next();
|
|
269
|
-
});
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
function makeInvokeMethod(innerFn, self, context) {
|
|
273
|
-
var state = GenStateSuspendedStart;
|
|
274
|
-
|
|
275
|
-
return function invoke(method, arg) {
|
|
276
|
-
if (state === GenStateExecuting) {
|
|
277
|
-
throw new Error("Generator is already running");
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
if (state === GenStateCompleted) {
|
|
281
|
-
if (method === "throw") {
|
|
282
|
-
throw arg;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
// Be forgiving, per 25.3.3.3.3 of the spec:
|
|
286
|
-
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
287
|
-
return doneResult();
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
context.method = method;
|
|
291
|
-
context.arg = arg;
|
|
292
|
-
|
|
293
|
-
while (true) {
|
|
294
|
-
var delegate = context.delegate;
|
|
295
|
-
if (delegate) {
|
|
296
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
297
|
-
if (delegateResult) {
|
|
298
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
299
|
-
return delegateResult;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
if (context.method === "next") {
|
|
304
|
-
// Setting context._sent for legacy support of Babel's
|
|
305
|
-
// function.sent implementation.
|
|
306
|
-
context.sent = context._sent = context.arg;
|
|
307
|
-
|
|
308
|
-
} else if (context.method === "throw") {
|
|
309
|
-
if (state === GenStateSuspendedStart) {
|
|
310
|
-
state = GenStateCompleted;
|
|
311
|
-
throw context.arg;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
context.dispatchException(context.arg);
|
|
315
|
-
|
|
316
|
-
} else if (context.method === "return") {
|
|
317
|
-
context.abrupt("return", context.arg);
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
state = GenStateExecuting;
|
|
321
|
-
|
|
322
|
-
var record = tryCatch(innerFn, self, context);
|
|
323
|
-
if (record.type === "normal") {
|
|
324
|
-
// If an exception is thrown from innerFn, we leave state ===
|
|
325
|
-
// GenStateExecuting and loop back for another invocation.
|
|
326
|
-
state = context.done
|
|
327
|
-
? GenStateCompleted
|
|
328
|
-
: GenStateSuspendedYield;
|
|
329
|
-
|
|
330
|
-
if (record.arg === ContinueSentinel) {
|
|
331
|
-
continue;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
return {
|
|
335
|
-
value: record.arg,
|
|
336
|
-
done: context.done
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
} else if (record.type === "throw") {
|
|
340
|
-
state = GenStateCompleted;
|
|
341
|
-
// Dispatch the exception by looping back around to the
|
|
342
|
-
// context.dispatchException(context.arg) call above.
|
|
343
|
-
context.method = "throw";
|
|
344
|
-
context.arg = record.arg;
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
};
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
// Call delegate.iterator[context.method](context.arg) and handle the
|
|
351
|
-
// result, either by returning a { value, done } result from the
|
|
352
|
-
// delegate iterator, or by modifying context.method and context.arg,
|
|
353
|
-
// setting context.delegate to null, and returning the ContinueSentinel.
|
|
354
|
-
function maybeInvokeDelegate(delegate, context) {
|
|
355
|
-
var method = delegate.iterator[context.method];
|
|
356
|
-
if (method === undefined$1) {
|
|
357
|
-
// A .throw or .return when the delegate iterator has no .throw
|
|
358
|
-
// method always terminates the yield* loop.
|
|
359
|
-
context.delegate = null;
|
|
360
|
-
|
|
361
|
-
if (context.method === "throw") {
|
|
362
|
-
// Note: ["return"] must be used for ES3 parsing compatibility.
|
|
363
|
-
if (delegate.iterator["return"]) {
|
|
364
|
-
// If the delegate iterator has a return method, give it a
|
|
365
|
-
// chance to clean up.
|
|
366
|
-
context.method = "return";
|
|
367
|
-
context.arg = undefined$1;
|
|
368
|
-
maybeInvokeDelegate(delegate, context);
|
|
369
|
-
|
|
370
|
-
if (context.method === "throw") {
|
|
371
|
-
// If maybeInvokeDelegate(context) changed context.method from
|
|
372
|
-
// "return" to "throw", let that override the TypeError below.
|
|
373
|
-
return ContinueSentinel;
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
context.method = "throw";
|
|
378
|
-
context.arg = new TypeError(
|
|
379
|
-
"The iterator does not provide a 'throw' method");
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
return ContinueSentinel;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
386
|
-
|
|
387
|
-
if (record.type === "throw") {
|
|
388
|
-
context.method = "throw";
|
|
389
|
-
context.arg = record.arg;
|
|
390
|
-
context.delegate = null;
|
|
391
|
-
return ContinueSentinel;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
var info = record.arg;
|
|
395
|
-
|
|
396
|
-
if (! info) {
|
|
397
|
-
context.method = "throw";
|
|
398
|
-
context.arg = new TypeError("iterator result is not an object");
|
|
399
|
-
context.delegate = null;
|
|
400
|
-
return ContinueSentinel;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
if (info.done) {
|
|
404
|
-
// Assign the result of the finished delegate to the temporary
|
|
405
|
-
// variable specified by delegate.resultName (see delegateYield).
|
|
406
|
-
context[delegate.resultName] = info.value;
|
|
407
|
-
|
|
408
|
-
// Resume execution at the desired location (see delegateYield).
|
|
409
|
-
context.next = delegate.nextLoc;
|
|
410
|
-
|
|
411
|
-
// If context.method was "throw" but the delegate handled the
|
|
412
|
-
// exception, let the outer generator proceed normally. If
|
|
413
|
-
// context.method was "next", forget context.arg since it has been
|
|
414
|
-
// "consumed" by the delegate iterator. If context.method was
|
|
415
|
-
// "return", allow the original .return call to continue in the
|
|
416
|
-
// outer generator.
|
|
417
|
-
if (context.method !== "return") {
|
|
418
|
-
context.method = "next";
|
|
419
|
-
context.arg = undefined$1;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
} else {
|
|
423
|
-
// Re-yield the result returned by the delegate method.
|
|
424
|
-
return info;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
// The delegate iterator is finished, so forget it and continue with
|
|
428
|
-
// the outer generator.
|
|
429
|
-
context.delegate = null;
|
|
430
|
-
return ContinueSentinel;
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
// Define Generator.prototype.{next,throw,return} in terms of the
|
|
434
|
-
// unified ._invoke helper method.
|
|
435
|
-
defineIteratorMethods(Gp);
|
|
436
|
-
|
|
437
|
-
define(Gp, toStringTagSymbol, "Generator");
|
|
438
|
-
|
|
439
|
-
// A Generator should always return itself as the iterator object when the
|
|
440
|
-
// @@iterator function is called on it. Some browsers' implementations of the
|
|
441
|
-
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
442
|
-
// object to not be returned from this call. This ensures that doesn't happen.
|
|
443
|
-
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
444
|
-
Gp[iteratorSymbol] = function() {
|
|
445
|
-
return this;
|
|
446
|
-
};
|
|
447
|
-
|
|
448
|
-
Gp.toString = function() {
|
|
449
|
-
return "[object Generator]";
|
|
450
|
-
};
|
|
451
|
-
|
|
452
|
-
function pushTryEntry(locs) {
|
|
453
|
-
var entry = { tryLoc: locs[0] };
|
|
454
|
-
|
|
455
|
-
if (1 in locs) {
|
|
456
|
-
entry.catchLoc = locs[1];
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
if (2 in locs) {
|
|
460
|
-
entry.finallyLoc = locs[2];
|
|
461
|
-
entry.afterLoc = locs[3];
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
this.tryEntries.push(entry);
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
function resetTryEntry(entry) {
|
|
468
|
-
var record = entry.completion || {};
|
|
469
|
-
record.type = "normal";
|
|
470
|
-
delete record.arg;
|
|
471
|
-
entry.completion = record;
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
function Context(tryLocsList) {
|
|
475
|
-
// The root entry object (effectively a try statement without a catch
|
|
476
|
-
// or a finally block) gives us a place to store values thrown from
|
|
477
|
-
// locations where there is no enclosing try statement.
|
|
478
|
-
this.tryEntries = [{ tryLoc: "root" }];
|
|
479
|
-
tryLocsList.forEach(pushTryEntry, this);
|
|
480
|
-
this.reset(true);
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
exports.keys = function(object) {
|
|
484
|
-
var keys = [];
|
|
485
|
-
for (var key in object) {
|
|
486
|
-
keys.push(key);
|
|
487
|
-
}
|
|
488
|
-
keys.reverse();
|
|
489
|
-
|
|
490
|
-
// Rather than returning an object with a next method, we keep
|
|
491
|
-
// things simple and return the next function itself.
|
|
492
|
-
return function next() {
|
|
493
|
-
while (keys.length) {
|
|
494
|
-
var key = keys.pop();
|
|
495
|
-
if (key in object) {
|
|
496
|
-
next.value = key;
|
|
497
|
-
next.done = false;
|
|
498
|
-
return next;
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
// To avoid creating an additional object, we just hang the .value
|
|
503
|
-
// and .done properties off the next function object itself. This
|
|
504
|
-
// also ensures that the minifier will not anonymize the function.
|
|
505
|
-
next.done = true;
|
|
506
|
-
return next;
|
|
507
|
-
};
|
|
508
|
-
};
|
|
509
|
-
|
|
510
|
-
function values(iterable) {
|
|
511
|
-
if (iterable) {
|
|
512
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
513
|
-
if (iteratorMethod) {
|
|
514
|
-
return iteratorMethod.call(iterable);
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
if (typeof iterable.next === "function") {
|
|
518
|
-
return iterable;
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
if (!isNaN(iterable.length)) {
|
|
522
|
-
var i = -1, next = function next() {
|
|
523
|
-
while (++i < iterable.length) {
|
|
524
|
-
if (hasOwn.call(iterable, i)) {
|
|
525
|
-
next.value = iterable[i];
|
|
526
|
-
next.done = false;
|
|
527
|
-
return next;
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
next.value = undefined$1;
|
|
532
|
-
next.done = true;
|
|
533
|
-
|
|
534
|
-
return next;
|
|
535
|
-
};
|
|
536
|
-
|
|
537
|
-
return next.next = next;
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
// Return an iterator with no values.
|
|
542
|
-
return { next: doneResult };
|
|
543
|
-
}
|
|
544
|
-
exports.values = values;
|
|
545
|
-
|
|
546
|
-
function doneResult() {
|
|
547
|
-
return { value: undefined$1, done: true };
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
Context.prototype = {
|
|
551
|
-
constructor: Context,
|
|
552
|
-
|
|
553
|
-
reset: function(skipTempReset) {
|
|
554
|
-
this.prev = 0;
|
|
555
|
-
this.next = 0;
|
|
556
|
-
// Resetting context._sent for legacy support of Babel's
|
|
557
|
-
// function.sent implementation.
|
|
558
|
-
this.sent = this._sent = undefined$1;
|
|
559
|
-
this.done = false;
|
|
560
|
-
this.delegate = null;
|
|
561
|
-
|
|
562
|
-
this.method = "next";
|
|
563
|
-
this.arg = undefined$1;
|
|
564
|
-
|
|
565
|
-
this.tryEntries.forEach(resetTryEntry);
|
|
566
|
-
|
|
567
|
-
if (!skipTempReset) {
|
|
568
|
-
for (var name in this) {
|
|
569
|
-
// Not sure about the optimal order of these conditions:
|
|
570
|
-
if (name.charAt(0) === "t" &&
|
|
571
|
-
hasOwn.call(this, name) &&
|
|
572
|
-
!isNaN(+name.slice(1))) {
|
|
573
|
-
this[name] = undefined$1;
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
},
|
|
578
|
-
|
|
579
|
-
stop: function() {
|
|
580
|
-
this.done = true;
|
|
581
|
-
|
|
582
|
-
var rootEntry = this.tryEntries[0];
|
|
583
|
-
var rootRecord = rootEntry.completion;
|
|
584
|
-
if (rootRecord.type === "throw") {
|
|
585
|
-
throw rootRecord.arg;
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
return this.rval;
|
|
589
|
-
},
|
|
590
|
-
|
|
591
|
-
dispatchException: function(exception) {
|
|
592
|
-
if (this.done) {
|
|
593
|
-
throw exception;
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
var context = this;
|
|
597
|
-
function handle(loc, caught) {
|
|
598
|
-
record.type = "throw";
|
|
599
|
-
record.arg = exception;
|
|
600
|
-
context.next = loc;
|
|
601
|
-
|
|
602
|
-
if (caught) {
|
|
603
|
-
// If the dispatched exception was caught by a catch block,
|
|
604
|
-
// then let that catch block handle the exception normally.
|
|
605
|
-
context.method = "next";
|
|
606
|
-
context.arg = undefined$1;
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
return !! caught;
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
613
|
-
var entry = this.tryEntries[i];
|
|
614
|
-
var record = entry.completion;
|
|
615
|
-
|
|
616
|
-
if (entry.tryLoc === "root") {
|
|
617
|
-
// Exception thrown outside of any try block that could handle
|
|
618
|
-
// it, so set the completion value of the entire function to
|
|
619
|
-
// throw the exception.
|
|
620
|
-
return handle("end");
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
if (entry.tryLoc <= this.prev) {
|
|
624
|
-
var hasCatch = hasOwn.call(entry, "catchLoc");
|
|
625
|
-
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
626
|
-
|
|
627
|
-
if (hasCatch && hasFinally) {
|
|
628
|
-
if (this.prev < entry.catchLoc) {
|
|
629
|
-
return handle(entry.catchLoc, true);
|
|
630
|
-
} else if (this.prev < entry.finallyLoc) {
|
|
631
|
-
return handle(entry.finallyLoc);
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
} else if (hasCatch) {
|
|
635
|
-
if (this.prev < entry.catchLoc) {
|
|
636
|
-
return handle(entry.catchLoc, true);
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
} else if (hasFinally) {
|
|
640
|
-
if (this.prev < entry.finallyLoc) {
|
|
641
|
-
return handle(entry.finallyLoc);
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
} else {
|
|
645
|
-
throw new Error("try statement without catch or finally");
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
},
|
|
650
|
-
|
|
651
|
-
abrupt: function(type, arg) {
|
|
652
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
653
|
-
var entry = this.tryEntries[i];
|
|
654
|
-
if (entry.tryLoc <= this.prev &&
|
|
655
|
-
hasOwn.call(entry, "finallyLoc") &&
|
|
656
|
-
this.prev < entry.finallyLoc) {
|
|
657
|
-
var finallyEntry = entry;
|
|
658
|
-
break;
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
if (finallyEntry &&
|
|
663
|
-
(type === "break" ||
|
|
664
|
-
type === "continue") &&
|
|
665
|
-
finallyEntry.tryLoc <= arg &&
|
|
666
|
-
arg <= finallyEntry.finallyLoc) {
|
|
667
|
-
// Ignore the finally entry if control is not jumping to a
|
|
668
|
-
// location outside the try/catch block.
|
|
669
|
-
finallyEntry = null;
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
var record = finallyEntry ? finallyEntry.completion : {};
|
|
673
|
-
record.type = type;
|
|
674
|
-
record.arg = arg;
|
|
675
|
-
|
|
676
|
-
if (finallyEntry) {
|
|
677
|
-
this.method = "next";
|
|
678
|
-
this.next = finallyEntry.finallyLoc;
|
|
679
|
-
return ContinueSentinel;
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
return this.complete(record);
|
|
683
|
-
},
|
|
684
|
-
|
|
685
|
-
complete: function(record, afterLoc) {
|
|
686
|
-
if (record.type === "throw") {
|
|
687
|
-
throw record.arg;
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
if (record.type === "break" ||
|
|
691
|
-
record.type === "continue") {
|
|
692
|
-
this.next = record.arg;
|
|
693
|
-
} else if (record.type === "return") {
|
|
694
|
-
this.rval = this.arg = record.arg;
|
|
695
|
-
this.method = "return";
|
|
696
|
-
this.next = "end";
|
|
697
|
-
} else if (record.type === "normal" && afterLoc) {
|
|
698
|
-
this.next = afterLoc;
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
return ContinueSentinel;
|
|
702
|
-
},
|
|
703
|
-
|
|
704
|
-
finish: function(finallyLoc) {
|
|
705
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
706
|
-
var entry = this.tryEntries[i];
|
|
707
|
-
if (entry.finallyLoc === finallyLoc) {
|
|
708
|
-
this.complete(entry.completion, entry.afterLoc);
|
|
709
|
-
resetTryEntry(entry);
|
|
710
|
-
return ContinueSentinel;
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
},
|
|
714
|
-
|
|
715
|
-
"catch": function(tryLoc) {
|
|
716
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
717
|
-
var entry = this.tryEntries[i];
|
|
718
|
-
if (entry.tryLoc === tryLoc) {
|
|
719
|
-
var record = entry.completion;
|
|
720
|
-
if (record.type === "throw") {
|
|
721
|
-
var thrown = record.arg;
|
|
722
|
-
resetTryEntry(entry);
|
|
723
|
-
}
|
|
724
|
-
return thrown;
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
// The context.catch method must only be called with a location
|
|
729
|
-
// argument that corresponds to a known catch block.
|
|
730
|
-
throw new Error("illegal catch attempt");
|
|
731
|
-
},
|
|
732
|
-
|
|
733
|
-
delegateYield: function(iterable, resultName, nextLoc) {
|
|
734
|
-
this.delegate = {
|
|
735
|
-
iterator: values(iterable),
|
|
736
|
-
resultName: resultName,
|
|
737
|
-
nextLoc: nextLoc
|
|
738
|
-
};
|
|
739
|
-
|
|
740
|
-
if (this.method === "next") {
|
|
741
|
-
// Deliberately forget the last sent value so that we don't
|
|
742
|
-
// accidentally pass it on to the delegate.
|
|
743
|
-
this.arg = undefined$1;
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
return ContinueSentinel;
|
|
747
|
-
}
|
|
748
|
-
};
|
|
749
|
-
|
|
750
|
-
// Regardless of whether this script is executing as a CommonJS module
|
|
751
|
-
// or not, return the runtime object so that we can declare the variable
|
|
752
|
-
// regeneratorRuntime in the outer scope, which allows this module to be
|
|
753
|
-
// injected easily by `bin/regenerator --include-runtime script.js`.
|
|
754
|
-
return exports;
|
|
755
|
-
|
|
756
|
-
}(
|
|
757
|
-
// If this script is executing as a CommonJS module, use module.exports
|
|
758
|
-
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
|
759
|
-
// object. Either way, the resulting object will be used to initialize
|
|
760
|
-
// the regeneratorRuntime variable at the top of this file.
|
|
761
|
-
module.exports
|
|
762
|
-
));
|
|
763
|
-
|
|
764
|
-
try {
|
|
765
|
-
regeneratorRuntime = runtime;
|
|
766
|
-
} catch (accidentalStrictMode) {
|
|
767
|
-
// This module should not be running in strict mode, so the above
|
|
768
|
-
// assignment should always work unless something is misconfigured. Just
|
|
769
|
-
// in case runtime.js accidentally runs in strict mode, we can escape
|
|
770
|
-
// strict mode using a global Function call. This could conceivably fail
|
|
771
|
-
// if a Content Security Policy forbids using Function, but in that case
|
|
772
|
-
// the proper solution is to fix the accidental strict mode problem. If
|
|
773
|
-
// you've misconfigured your bundler to force strict mode and applied a
|
|
774
|
-
// CSP to forbid Function, and you're not willing to fix either of those
|
|
775
|
-
// problems, please detail your unique predicament in a GitHub issue.
|
|
776
|
-
Function("r", "regeneratorRuntime = r")(runtime);
|
|
777
|
-
}
|
|
778
|
-
});
|
|
779
|
-
|
|
780
|
-
var regenerator = runtime_1;
|
|
781
|
-
|
|
782
|
-
var arrayWithHoles = _commonjsHelpers.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
|
-
_commonjsHelpers.unwrapExports(arrayWithHoles);
|
|
792
|
-
|
|
793
|
-
var iterableToArrayLimit = _commonjsHelpers.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
|
-
_commonjsHelpers.unwrapExports(iterableToArrayLimit);
|
|
829
|
-
|
|
830
|
-
var arrayLikeToArray = _commonjsHelpers.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
|
-
_commonjsHelpers.unwrapExports(arrayLikeToArray);
|
|
846
|
-
|
|
847
|
-
var unsupportedIterableToArray = _commonjsHelpers.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
|
-
_commonjsHelpers.unwrapExports(unsupportedIterableToArray);
|
|
862
|
-
|
|
863
|
-
var nonIterableRest = _commonjsHelpers.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
|
-
_commonjsHelpers.unwrapExports(nonIterableRest);
|
|
873
|
-
|
|
874
|
-
var slicedToArray = _commonjsHelpers.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
|
-
_commonjsHelpers.unwrapExports(slicedToArray);
|
|
884
|
-
|
|
885
15
|
var logger = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
886
16
|
|
|
887
17
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -890,25 +20,39 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
890
20
|
exports.setLogger = setLogger;
|
|
891
21
|
exports.proxyLogger = proxyLogger;
|
|
892
22
|
exports.default = void 0;
|
|
893
|
-
|
|
894
|
-
error(code
|
|
895
|
-
|
|
23
|
+
var _logger = {
|
|
24
|
+
error(code) {
|
|
25
|
+
for (var _len = arguments.length, message = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
26
|
+
message[_key - 1] = arguments[_key];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
console.error("[next-auth][error][".concat(code.toLowerCase(), "]"), "\nhttps://next-auth.js.org/errors#".concat(code.toLowerCase()), ...message);
|
|
896
30
|
},
|
|
897
31
|
|
|
898
|
-
warn(code
|
|
899
|
-
|
|
32
|
+
warn(code) {
|
|
33
|
+
for (var _len2 = arguments.length, message = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
34
|
+
message[_key2 - 1] = arguments[_key2];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
console.warn("[next-auth][warn][".concat(code.toLowerCase(), "]"), "\nhttps://next-auth.js.org/warnings#".concat(code.toLowerCase()), ...message);
|
|
900
38
|
},
|
|
901
39
|
|
|
902
|
-
debug(code
|
|
40
|
+
debug(code) {
|
|
903
41
|
var _process, _process$env;
|
|
904
42
|
|
|
905
43
|
if (!((_process = process) !== null && _process !== void 0 && (_process$env = _process.env) !== null && _process$env !== void 0 && _process$env._NEXTAUTH_DEBUG)) return;
|
|
906
|
-
|
|
44
|
+
|
|
45
|
+
for (var _len3 = arguments.length, message = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
46
|
+
message[_key3 - 1] = arguments[_key3];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
console.log("[next-auth][debug][".concat(code.toLowerCase(), "]"), ...message);
|
|
907
50
|
}
|
|
908
51
|
|
|
909
52
|
};
|
|
910
53
|
|
|
911
|
-
function setLogger(
|
|
54
|
+
function setLogger() {
|
|
55
|
+
var newLogger = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
912
56
|
if (newLogger.error) _logger.error = newLogger.error;
|
|
913
57
|
if (newLogger.warn) _logger.warn = newLogger.warn;
|
|
914
58
|
if (newLogger.debug) _logger.debug = newLogger.debug;
|
|
@@ -917,20 +61,27 @@ function setLogger(newLogger = {}) {
|
|
|
917
61
|
var _default = _logger;
|
|
918
62
|
exports.default = _default;
|
|
919
63
|
|
|
920
|
-
function proxyLogger(
|
|
64
|
+
function proxyLogger() {
|
|
65
|
+
var logger = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _logger;
|
|
66
|
+
var basePath = arguments.length > 1 ? arguments[1] : undefined;
|
|
67
|
+
|
|
921
68
|
try {
|
|
922
|
-
if (typeof window ===
|
|
69
|
+
if (typeof window === 'undefined') {
|
|
923
70
|
return logger;
|
|
924
71
|
}
|
|
925
72
|
|
|
926
|
-
|
|
73
|
+
var clientLogger = {};
|
|
74
|
+
|
|
75
|
+
var _loop = function _loop(level) {
|
|
76
|
+
clientLogger[level] = function (code) {
|
|
77
|
+
for (var _len4 = arguments.length, message = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
|
78
|
+
message[_key4 - 1] = arguments[_key4];
|
|
79
|
+
}
|
|
927
80
|
|
|
928
|
-
for (const level in logger) {
|
|
929
|
-
clientLogger[level] = (code, ...message) => {
|
|
930
81
|
_logger[level](code, ...message);
|
|
931
82
|
|
|
932
|
-
|
|
933
|
-
|
|
83
|
+
var url = "".concat(basePath, "/_log");
|
|
84
|
+
var body = new URLSearchParams({
|
|
934
85
|
level,
|
|
935
86
|
code,
|
|
936
87
|
message: JSON.stringify(message.map(m => {
|
|
@@ -951,13 +102,17 @@ function proxyLogger(logger = _logger, basePath) {
|
|
|
951
102
|
}
|
|
952
103
|
|
|
953
104
|
return fetch(url, {
|
|
954
|
-
method:
|
|
105
|
+
method: 'POST',
|
|
955
106
|
headers: {
|
|
956
|
-
|
|
107
|
+
'Content-Type': 'application/json'
|
|
957
108
|
},
|
|
958
109
|
body
|
|
959
110
|
});
|
|
960
111
|
};
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
for (var level in logger) {
|
|
115
|
+
_loop(level);
|
|
961
116
|
}
|
|
962
117
|
|
|
963
118
|
return clientLogger;
|
|
@@ -979,18 +134,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
979
134
|
exports.default = parseUrl;
|
|
980
135
|
|
|
981
136
|
function parseUrl(url) {
|
|
982
|
-
|
|
983
|
-
|
|
137
|
+
var defaultHost = 'http://localhost:3000';
|
|
138
|
+
var defaultPath = '/api/auth';
|
|
984
139
|
|
|
985
140
|
if (!url) {
|
|
986
|
-
url =
|
|
141
|
+
url = "".concat(defaultHost).concat(defaultPath);
|
|
987
142
|
}
|
|
988
143
|
|
|
989
|
-
|
|
144
|
+
var protocol = url.startsWith('http:') ? 'http' : 'https';
|
|
990
145
|
url = url.replace(/^https?:\/\//, '').replace(/\/$/, '');
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
146
|
+
var [_host, ..._path] = url.split('/');
|
|
147
|
+
var baseUrl = _host ? "".concat(protocol, "://").concat(_host) : defaultHost;
|
|
148
|
+
var basePath = _path.length > 0 ? "/".concat(_path.join('/')) : defaultPath;
|
|
994
149
|
return {
|
|
995
150
|
baseUrl,
|
|
996
151
|
basePath
|
|
@@ -1002,44 +157,39 @@ _commonjsHelpers.unwrapExports(parseUrl_1);
|
|
|
1002
157
|
|
|
1003
158
|
var client$1 = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
1004
159
|
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
160
|
Object.defineProperty(exports, "__esModule", {
|
|
1010
161
|
value: true
|
|
1011
162
|
});
|
|
1012
163
|
exports.useSession = useSession;
|
|
1013
|
-
exports.
|
|
1014
|
-
exports.
|
|
1015
|
-
exports.
|
|
1016
|
-
exports.
|
|
1017
|
-
exports.
|
|
1018
|
-
exports.options = exports.setOptions = setOptions;
|
|
164
|
+
exports.getSession = getSession;
|
|
165
|
+
exports.getProviders = getProviders;
|
|
166
|
+
exports.signIn = signIn;
|
|
167
|
+
exports.signOut = signOut;
|
|
168
|
+
exports.setOptions = setOptions;
|
|
1019
169
|
exports.Provider = Provider;
|
|
1020
170
|
exports.default = void 0;
|
|
1021
171
|
|
|
1022
|
-
var _regenerator = interopRequireDefault(regenerator);
|
|
1023
172
|
|
|
1024
|
-
var _defineProperty2 = interopRequireDefault(defineProperty.defineProperty);
|
|
1025
173
|
|
|
1026
|
-
var
|
|
174
|
+
var _logger2 = _interopRequireWildcard(logger);
|
|
1027
175
|
|
|
1028
|
-
var
|
|
176
|
+
var _parseUrl = _interopRequireDefault(parseUrl_1);
|
|
1029
177
|
|
|
178
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1030
179
|
|
|
180
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
1031
181
|
|
|
1032
|
-
var
|
|
182
|
+
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; }
|
|
1033
183
|
|
|
1034
|
-
var
|
|
184
|
+
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; }
|
|
1035
185
|
|
|
1036
|
-
function
|
|
186
|
+
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; }
|
|
1037
187
|
|
|
1038
|
-
function
|
|
188
|
+
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; }
|
|
1039
189
|
|
|
1040
|
-
function
|
|
190
|
+
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); } }
|
|
1041
191
|
|
|
1042
|
-
function
|
|
192
|
+
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); }); }; }
|
|
1043
193
|
|
|
1044
194
|
var __NEXTAUTH = {
|
|
1045
195
|
baseUrl: (0, _parseUrl.default)(process.env.NEXTAUTH_URL || process.env.VERCEL_URL).baseUrl,
|
|
@@ -1052,21 +202,19 @@ var __NEXTAUTH = {
|
|
|
1052
202
|
_clientSyncTimer: null,
|
|
1053
203
|
_eventListenersAdded: false,
|
|
1054
204
|
_clientSession: undefined,
|
|
1055
|
-
_getSession:
|
|
205
|
+
_getSession: () => {}
|
|
1056
206
|
};
|
|
1057
207
|
var logger$1 = (0, _logger2.proxyLogger)(_logger2.default, __NEXTAUTH.basePath);
|
|
1058
208
|
var broadcast = BroadcastChannel();
|
|
1059
209
|
|
|
1060
|
-
if (typeof window !==
|
|
210
|
+
if (typeof window !== 'undefined' && !__NEXTAUTH._eventListenersAdded) {
|
|
1061
211
|
__NEXTAUTH._eventListenersAdded = true;
|
|
1062
|
-
broadcast.receive(
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
});
|
|
1067
|
-
document.addEventListener("visibilitychange", function () {
|
|
212
|
+
broadcast.receive(() => __NEXTAUTH._getSession({
|
|
213
|
+
event: 'storage'
|
|
214
|
+
}));
|
|
215
|
+
document.addEventListener('visibilitychange', () => {
|
|
1068
216
|
!document.hidden && __NEXTAUTH._getSession({
|
|
1069
|
-
event:
|
|
217
|
+
event: 'visibilitychange'
|
|
1070
218
|
});
|
|
1071
219
|
}, false);
|
|
1072
220
|
}
|
|
@@ -1080,103 +228,50 @@ function useSession(session) {
|
|
|
1080
228
|
}
|
|
1081
229
|
|
|
1082
230
|
function _useSessionHook(session) {
|
|
1083
|
-
var
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
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();
|
|
231
|
+
var [data, setData] = (0, React__default['default'].useState)(session);
|
|
232
|
+
var [loading, setLoading] = (0, React__default['default'].useState)(!data);
|
|
233
|
+
(0, React__default['default'].useEffect)(() => {
|
|
234
|
+
__NEXTAUTH._getSession = _asyncToGenerator(function* () {
|
|
235
|
+
var {
|
|
236
|
+
event = null
|
|
237
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
238
|
+
|
|
239
|
+
try {
|
|
240
|
+
var triggredByEvent = event !== null;
|
|
241
|
+
var triggeredByStorageEvent = event === 'storage';
|
|
242
|
+
var clientMaxAge = __NEXTAUTH.clientMaxAge;
|
|
243
|
+
var clientLastSync = parseInt(__NEXTAUTH._clientLastSync);
|
|
244
|
+
|
|
245
|
+
var currentTime = _now();
|
|
246
|
+
|
|
247
|
+
var clientSession = __NEXTAUTH._clientSession;
|
|
248
|
+
|
|
249
|
+
if (!triggeredByStorageEvent && clientSession !== undefined) {
|
|
250
|
+
if (clientMaxAge === 0 && triggredByEvent !== true) {
|
|
251
|
+
return;
|
|
252
|
+
} else if (clientMaxAge > 0 && clientSession === null) {
|
|
253
|
+
return;
|
|
254
|
+
} else if (clientMaxAge > 0 && currentTime < clientLastSync + clientMaxAge) {
|
|
255
|
+
return;
|
|
1176
256
|
}
|
|
1177
257
|
}
|
|
1178
|
-
|
|
1179
|
-
|
|
258
|
+
|
|
259
|
+
if (clientSession === undefined) {
|
|
260
|
+
__NEXTAUTH._clientSession = null;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
__NEXTAUTH._clientLastSync = _now();
|
|
264
|
+
var newClientSessionData = yield getSession({
|
|
265
|
+
triggerEvent: !triggeredByStorageEvent
|
|
266
|
+
});
|
|
267
|
+
__NEXTAUTH._clientSession = newClientSessionData;
|
|
268
|
+
setData(newClientSessionData);
|
|
269
|
+
setLoading(false);
|
|
270
|
+
} catch (error) {
|
|
271
|
+
logger$1.error('CLIENT_USE_SESSION_ERROR', error);
|
|
272
|
+
setLoading(false);
|
|
273
|
+
}
|
|
274
|
+
});
|
|
1180
275
|
|
|
1181
276
|
__NEXTAUTH._getSession();
|
|
1182
277
|
});
|
|
@@ -1188,38 +283,22 @@ function getSession(_x) {
|
|
|
1188
283
|
}
|
|
1189
284
|
|
|
1190
285
|
function _getSession2() {
|
|
1191
|
-
_getSession2 = (
|
|
286
|
+
_getSession2 = _asyncToGenerator(function* (ctx) {
|
|
1192
287
|
var _ctx$triggerEvent;
|
|
1193
288
|
|
|
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
|
-
}
|
|
1213
|
-
|
|
1214
|
-
return _context4.abrupt("return", session);
|
|
289
|
+
var session = yield _fetchData('session', ctx);
|
|
1215
290
|
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
291
|
+
if ((_ctx$triggerEvent = ctx === null || ctx === void 0 ? void 0 : ctx.triggerEvent) !== null && _ctx$triggerEvent !== void 0 ? _ctx$triggerEvent : true) {
|
|
292
|
+
broadcast.post({
|
|
293
|
+
event: 'session',
|
|
294
|
+
data: {
|
|
295
|
+
trigger: 'getSession'
|
|
1219
296
|
}
|
|
1220
|
-
}
|
|
1221
|
-
}
|
|
1222
|
-
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
return session;
|
|
301
|
+
});
|
|
1223
302
|
return _getSession2.apply(this, arguments);
|
|
1224
303
|
}
|
|
1225
304
|
|
|
@@ -1228,50 +307,11 @@ function getCsrfToken(_x2) {
|
|
|
1228
307
|
}
|
|
1229
308
|
|
|
1230
309
|
function _getCsrfToken() {
|
|
1231
|
-
_getCsrfToken = (
|
|
310
|
+
_getCsrfToken = _asyncToGenerator(function* (ctx) {
|
|
1232
311
|
var _yield$_fetchData;
|
|
1233
312
|
|
|
1234
|
-
return
|
|
1235
|
-
|
|
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
|
-
}));
|
|
313
|
+
return (_yield$_fetchData = yield _fetchData('csrf', ctx)) === null || _yield$_fetchData === void 0 ? void 0 : _yield$_fetchData.csrfToken;
|
|
314
|
+
});
|
|
1275
315
|
return _getCsrfToken.apply(this, arguments);
|
|
1276
316
|
}
|
|
1277
317
|
|
|
@@ -1280,24 +320,9 @@ function getProviders() {
|
|
|
1280
320
|
}
|
|
1281
321
|
|
|
1282
322
|
function _getProviders() {
|
|
1283
|
-
_getProviders = (
|
|
1284
|
-
return
|
|
1285
|
-
|
|
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
|
-
}));
|
|
323
|
+
_getProviders = _asyncToGenerator(function* () {
|
|
324
|
+
return _fetchData('providers');
|
|
325
|
+
});
|
|
1301
326
|
return _getProviders.apply(this, arguments);
|
|
1302
327
|
}
|
|
1303
328
|
|
|
@@ -1306,138 +331,68 @@ function signIn(_x3) {
|
|
|
1306
331
|
}
|
|
1307
332
|
|
|
1308
333
|
function _signIn() {
|
|
1309
|
-
_signIn = (
|
|
1310
|
-
var options
|
|
1311
|
-
|
|
1312
|
-
|
|
334
|
+
_signIn = _asyncToGenerator(function* (provider) {
|
|
335
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
336
|
+
var authorizationParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
337
|
+
var {
|
|
338
|
+
callbackUrl = window.location,
|
|
339
|
+
redirect = true
|
|
340
|
+
} = options;
|
|
341
|
+
|
|
342
|
+
var baseUrl = _apiBaseUrl();
|
|
343
|
+
|
|
344
|
+
var providers = yield getProviders();
|
|
345
|
+
|
|
346
|
+
if (!(provider in providers)) {
|
|
347
|
+
window.location = "".concat(baseUrl, "/signin?callbackUrl=").concat(encodeURIComponent(callbackUrl));
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
var isCredentials = providers[provider].type === 'credentials';
|
|
352
|
+
var isEmail = providers[provider].type === 'email';
|
|
353
|
+
var canRedirectBeDisabled = isCredentials || isEmail;
|
|
354
|
+
var signInUrl = isCredentials ? "".concat(baseUrl, "/callback/").concat(provider) : "".concat(baseUrl, "/signin/").concat(provider);
|
|
355
|
+
var fetchOptions = {
|
|
356
|
+
method: 'post',
|
|
357
|
+
headers: {
|
|
358
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
359
|
+
},
|
|
360
|
+
body: new URLSearchParams(_objectSpread(_objectSpread({}, options), {}, {
|
|
361
|
+
csrfToken: yield getCsrfToken(),
|
|
1313
362
|
callbackUrl,
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
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
|
-
}
|
|
363
|
+
json: true
|
|
364
|
+
}))
|
|
365
|
+
};
|
|
1348
366
|
|
|
1349
|
-
|
|
367
|
+
var _signInUrl = "".concat(signInUrl, "?").concat(new URLSearchParams(authorizationParams));
|
|
1350
368
|
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
_context7.next = 11;
|
|
1354
|
-
break;
|
|
1355
|
-
}
|
|
369
|
+
var res = yield fetch(_signInUrl, fetchOptions);
|
|
370
|
+
var data = yield res.json();
|
|
1356
371
|
|
|
1357
|
-
|
|
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
|
-
}
|
|
372
|
+
if (redirect || !canRedirectBeDisabled) {
|
|
373
|
+
var _data$url;
|
|
1407
374
|
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
375
|
+
var url = (_data$url = data.url) !== null && _data$url !== void 0 ? _data$url : callbackUrl;
|
|
376
|
+
window.location = url;
|
|
377
|
+
if (url.includes('#')) window.location.reload();
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
1412
380
|
|
|
1413
|
-
|
|
1414
|
-
error = new URL(data.url).searchParams.get("error");
|
|
381
|
+
var error = new URL(data.url).searchParams.get('error');
|
|
1415
382
|
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
383
|
+
if (res.ok) {
|
|
384
|
+
yield __NEXTAUTH._getSession({
|
|
385
|
+
event: 'storage'
|
|
386
|
+
});
|
|
387
|
+
}
|
|
1420
388
|
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
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
|
-
}));
|
|
389
|
+
return {
|
|
390
|
+
error,
|
|
391
|
+
status: res.status,
|
|
392
|
+
ok: res.ok,
|
|
393
|
+
url: error ? null : data.url
|
|
394
|
+
};
|
|
395
|
+
});
|
|
1441
396
|
return _signIn.apply(this, arguments);
|
|
1442
397
|
}
|
|
1443
398
|
|
|
@@ -1446,145 +401,86 @@ function signOut() {
|
|
|
1446
401
|
}
|
|
1447
402
|
|
|
1448
403
|
function _signOut() {
|
|
1449
|
-
_signOut = (
|
|
1450
|
-
var options
|
|
1451
|
-
|
|
404
|
+
_signOut = _asyncToGenerator(function* () {
|
|
405
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
406
|
+
var {
|
|
407
|
+
callbackUrl = window.location,
|
|
408
|
+
redirect = true
|
|
409
|
+
} = options;
|
|
410
|
+
|
|
411
|
+
var baseUrl = _apiBaseUrl();
|
|
412
|
+
|
|
413
|
+
var fetchOptions = {
|
|
414
|
+
method: 'post',
|
|
415
|
+
headers: {
|
|
416
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
417
|
+
},
|
|
418
|
+
body: new URLSearchParams({
|
|
419
|
+
csrfToken: yield getCsrfToken(),
|
|
1452
420
|
callbackUrl,
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
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
|
-
}
|
|
1512
|
-
|
|
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");
|
|
421
|
+
json: true
|
|
422
|
+
})
|
|
423
|
+
};
|
|
424
|
+
var res = yield fetch("".concat(baseUrl, "/signout"), fetchOptions);
|
|
425
|
+
var data = yield res.json();
|
|
426
|
+
broadcast.post({
|
|
427
|
+
event: 'session',
|
|
428
|
+
data: {
|
|
429
|
+
trigger: 'signout'
|
|
430
|
+
}
|
|
431
|
+
});
|
|
1517
432
|
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
return __NEXTAUTH._getSession({
|
|
1521
|
-
event: "storage"
|
|
1522
|
-
});
|
|
433
|
+
if (redirect) {
|
|
434
|
+
var _data$url2;
|
|
1523
435
|
|
|
1524
|
-
|
|
1525
|
-
|
|
436
|
+
var url = (_data$url2 = data.url) !== null && _data$url2 !== void 0 ? _data$url2 : callbackUrl;
|
|
437
|
+
window.location = url;
|
|
438
|
+
if (url.includes('#')) window.location.reload();
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
1526
441
|
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
}, _callee8);
|
|
1533
|
-
}));
|
|
442
|
+
yield __NEXTAUTH._getSession({
|
|
443
|
+
event: 'storage'
|
|
444
|
+
});
|
|
445
|
+
return data;
|
|
446
|
+
});
|
|
1534
447
|
return _signOut.apply(this, arguments);
|
|
1535
448
|
}
|
|
1536
449
|
|
|
1537
450
|
function setOptions() {
|
|
1538
|
-
var
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
451
|
+
var {
|
|
452
|
+
baseUrl,
|
|
453
|
+
basePath,
|
|
454
|
+
clientMaxAge,
|
|
455
|
+
keepAlive
|
|
456
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1544
457
|
if (baseUrl) __NEXTAUTH.baseUrl = baseUrl;
|
|
1545
458
|
if (basePath) __NEXTAUTH.basePath = basePath;
|
|
1546
459
|
if (clientMaxAge) __NEXTAUTH.clientMaxAge = clientMaxAge;
|
|
1547
460
|
|
|
1548
461
|
if (keepAlive) {
|
|
1549
462
|
__NEXTAUTH.keepAlive = keepAlive;
|
|
1550
|
-
if (typeof window ===
|
|
463
|
+
if (typeof window === 'undefined') return;
|
|
1551
464
|
|
|
1552
465
|
if (__NEXTAUTH._clientSyncTimer !== null) {
|
|
1553
466
|
clearTimeout(__NEXTAUTH._clientSyncTimer);
|
|
1554
467
|
}
|
|
1555
468
|
|
|
1556
|
-
__NEXTAUTH._clientSyncTimer = setTimeout((
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
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
|
+
__NEXTAUTH._clientSyncTimer = setTimeout(_asyncToGenerator(function* () {
|
|
470
|
+
if (!__NEXTAUTH._clientSession) return;
|
|
471
|
+
yield __NEXTAUTH._getSession({
|
|
472
|
+
event: 'timer'
|
|
473
|
+
});
|
|
474
|
+
}), keepAlive * 1000);
|
|
1581
475
|
}
|
|
1582
476
|
}
|
|
1583
477
|
|
|
1584
|
-
function Provider(
|
|
1585
|
-
var
|
|
1586
|
-
|
|
1587
|
-
|
|
478
|
+
function Provider(_ref3) {
|
|
479
|
+
var {
|
|
480
|
+
children,
|
|
481
|
+
session,
|
|
482
|
+
options
|
|
483
|
+
} = _ref3;
|
|
1588
484
|
setOptions(options);
|
|
1589
485
|
return (0, React__default['default'].createElement)(SessionContext.Provider, {
|
|
1590
486
|
value: useSession(session)
|
|
@@ -1596,74 +492,34 @@ function _fetchData(_x4) {
|
|
|
1596
492
|
}
|
|
1597
493
|
|
|
1598
494
|
function _fetchData2() {
|
|
1599
|
-
_fetchData2 = (
|
|
1600
|
-
var
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
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
|
-
}
|
|
1641
|
-
|
|
1642
|
-
throw data;
|
|
495
|
+
_fetchData2 = _asyncToGenerator(function* (path) {
|
|
496
|
+
var {
|
|
497
|
+
ctx,
|
|
498
|
+
req = ctx === null || ctx === void 0 ? void 0 : ctx.req
|
|
499
|
+
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1643
500
|
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
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();
|
|
501
|
+
try {
|
|
502
|
+
var baseUrl = yield _apiBaseUrl();
|
|
503
|
+
var options = req ? {
|
|
504
|
+
headers: {
|
|
505
|
+
cookie: req.headers.cookie
|
|
1656
506
|
}
|
|
1657
|
-
}
|
|
1658
|
-
|
|
1659
|
-
|
|
507
|
+
} : {};
|
|
508
|
+
var res = yield fetch("".concat(baseUrl, "/").concat(path), options);
|
|
509
|
+
var data = yield res.json();
|
|
510
|
+
return Object.keys(data).length > 0 ? data : null;
|
|
511
|
+
} catch (error) {
|
|
512
|
+
logger$1.error('CLIENT_FETCH_ERROR', path, error);
|
|
513
|
+
return null;
|
|
514
|
+
}
|
|
515
|
+
});
|
|
1660
516
|
return _fetchData2.apply(this, arguments);
|
|
1661
517
|
}
|
|
1662
518
|
|
|
1663
519
|
function _apiBaseUrl() {
|
|
1664
|
-
if (typeof window ===
|
|
520
|
+
if (typeof window === 'undefined') {
|
|
1665
521
|
if (!process.env.NEXTAUTH_URL) {
|
|
1666
|
-
logger$1.warn(
|
|
522
|
+
logger$1.warn('NEXTAUTH_URL', 'NEXTAUTH_URL environment variable not set');
|
|
1667
523
|
}
|
|
1668
524
|
|
|
1669
525
|
return "".concat(__NEXTAUTH.baseUrlServer).concat(__NEXTAUTH.basePathServer);
|
|
@@ -1677,68 +533,43 @@ function _now() {
|
|
|
1677
533
|
}
|
|
1678
534
|
|
|
1679
535
|
function BroadcastChannel() {
|
|
1680
|
-
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] :
|
|
536
|
+
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'nextauth.message';
|
|
1681
537
|
return {
|
|
1682
|
-
receive
|
|
1683
|
-
if (typeof window ===
|
|
1684
|
-
window.addEventListener(
|
|
1685
|
-
var
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
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
|
-
}));
|
|
538
|
+
receive(onReceive) {
|
|
539
|
+
if (typeof window === 'undefined') return;
|
|
540
|
+
window.addEventListener('storage', function () {
|
|
541
|
+
var _ref4 = _asyncToGenerator(function* (event) {
|
|
542
|
+
if (event.key !== name) return;
|
|
543
|
+
var message = JSON.parse(event.newValue);
|
|
544
|
+
if ((message === null || message === void 0 ? void 0 : message.event) !== 'session' || !(message !== null && message !== void 0 && message.data)) return;
|
|
545
|
+
onReceive(message);
|
|
546
|
+
});
|
|
1718
547
|
|
|
1719
548
|
return function (_x5) {
|
|
1720
|
-
return
|
|
549
|
+
return _ref4.apply(this, arguments);
|
|
1721
550
|
};
|
|
1722
551
|
}());
|
|
1723
552
|
},
|
|
1724
|
-
|
|
1725
|
-
|
|
553
|
+
|
|
554
|
+
post(message) {
|
|
555
|
+
if (typeof localStorage === 'undefined') return;
|
|
1726
556
|
localStorage.setItem(name, JSON.stringify(_objectSpread(_objectSpread({}, message), {}, {
|
|
1727
557
|
timestamp: _now()
|
|
1728
558
|
})));
|
|
1729
559
|
}
|
|
560
|
+
|
|
1730
561
|
};
|
|
1731
562
|
}
|
|
1732
563
|
|
|
1733
564
|
var _default = {
|
|
1734
|
-
getSession
|
|
1735
|
-
getCsrfToken
|
|
1736
|
-
getProviders
|
|
1737
|
-
useSession
|
|
1738
|
-
signIn
|
|
1739
|
-
signOut
|
|
1740
|
-
Provider
|
|
1741
|
-
setOptions
|
|
565
|
+
getSession,
|
|
566
|
+
getCsrfToken,
|
|
567
|
+
getProviders,
|
|
568
|
+
useSession,
|
|
569
|
+
signIn,
|
|
570
|
+
signOut,
|
|
571
|
+
Provider,
|
|
572
|
+
setOptions,
|
|
1742
573
|
options: setOptions,
|
|
1743
574
|
session: getSession,
|
|
1744
575
|
providers: getProviders,
|
|
@@ -1751,17 +582,10 @@ exports.default = _default;
|
|
|
1751
582
|
|
|
1752
583
|
_commonjsHelpers.unwrapExports(client$1);
|
|
1753
584
|
client$1.useSession;
|
|
1754
|
-
client$1.session;
|
|
1755
585
|
client$1.getSession;
|
|
1756
|
-
client$1.csrfToken;
|
|
1757
|
-
client$1.getCsrfToken;
|
|
1758
|
-
client$1.providers;
|
|
1759
586
|
client$1.getProviders;
|
|
1760
|
-
client$1.signin;
|
|
1761
587
|
client$1.signIn;
|
|
1762
|
-
client$1.signout;
|
|
1763
588
|
client$1.signOut;
|
|
1764
|
-
client$1.options;
|
|
1765
589
|
client$1.setOptions;
|
|
1766
590
|
client$1.Provider;
|
|
1767
591
|
|
|
@@ -1778,27 +602,27 @@ var AuthWrapper = function AuthWrapper(_ref) {
|
|
|
1778
602
|
formUrl = _ref$formUrl === undefined ? '' : _ref$formUrl;
|
|
1779
603
|
|
|
1780
604
|
var _nextAuth$useSession = client.useSession(),
|
|
1781
|
-
_nextAuth$useSession2 = slicedToArray
|
|
605
|
+
_nextAuth$useSession2 = slicedToArray._slicedToArray(_nextAuth$useSession, 2),
|
|
1782
606
|
session = _nextAuth$useSession2[0],
|
|
1783
607
|
loading = _nextAuth$useSession2[1];
|
|
1784
608
|
|
|
1785
609
|
var _useState = React.useState(null),
|
|
1786
|
-
_useState2 = slicedToArray
|
|
610
|
+
_useState2 = slicedToArray._slicedToArray(_useState, 2),
|
|
1787
611
|
callbackUrl = _useState2[0],
|
|
1788
612
|
setCallbackUrl = _useState2[1];
|
|
1789
613
|
|
|
1790
614
|
var _useState3 = React.useState(),
|
|
1791
|
-
_useState4 = slicedToArray
|
|
615
|
+
_useState4 = slicedToArray._slicedToArray(_useState3, 2),
|
|
1792
616
|
email = _useState4[0],
|
|
1793
617
|
setEmail = _useState4[1];
|
|
1794
618
|
|
|
1795
619
|
var _useState5 = React.useState(false),
|
|
1796
|
-
_useState6 = slicedToArray
|
|
620
|
+
_useState6 = slicedToArray._slicedToArray(_useState5, 2),
|
|
1797
621
|
showForm = _useState6[0],
|
|
1798
622
|
setShowForm = _useState6[1];
|
|
1799
623
|
|
|
1800
624
|
var _useState7 = React.useState(),
|
|
1801
|
-
_useState8 = slicedToArray
|
|
625
|
+
_useState8 = slicedToArray._slicedToArray(_useState7, 2),
|
|
1802
626
|
password = _useState8[0],
|
|
1803
627
|
setPassword = _useState8[1];
|
|
1804
628
|
|