@mjhls/mjh-framework 1.0.1073-issue-test-v2 → 1.0.1073
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/AD.js +6 -6
- package/dist/cjs/AD300x250.js +5 -6
- package/dist/cjs/AD300x250x600.js +5 -6
- package/dist/cjs/AD728x90.js +6 -7
- package/dist/cjs/ADFloatingFooter.js +8 -9
- package/dist/cjs/ADFooter.js +5 -5
- package/dist/cjs/ADGutter.js +8 -9
- package/dist/cjs/{ADInfeed-3a68b356.js → ADInfeed-0519664d.js} +6 -6
- package/dist/cjs/ADSkyscraper.js +8 -9
- package/dist/cjs/ADSponsoredResources.js +8 -9
- package/dist/cjs/ADWebcast.js +8 -9
- package/dist/cjs/ADWelcome.js +12 -13
- package/dist/cjs/{ADlgInfeed-d88a0250.js → ADlgInfeed-e544ac1c.js} +4 -4
- package/dist/cjs/AccordionPanel.js +17 -17
- package/dist/cjs/AdSlot.js +9 -10
- package/dist/cjs/AdSlotsProvider.js +5 -6
- package/dist/cjs/AlgoliaSearch.js +1409 -896
- package/dist/cjs/AlphabeticList.js +12 -12
- package/dist/cjs/ArticleCarousel.js +5 -5
- package/dist/cjs/ArticleProgramLandingPage.js +15 -16
- package/dist/cjs/ArticleSeriesLandingPage.js +11 -12
- package/dist/cjs/ArticleSeriesListing.js +29 -30
- package/dist/cjs/AuthWrapper.js +315 -1497
- package/dist/cjs/{AuthorComponent-39b37d84.js → AuthorComponent-7d00f6d5.js} +9 -9
- package/dist/cjs/{BlockContent-9ebd251f.js → BlockContent-96b44364.js} +18 -18
- package/dist/cjs/Breadcrumbs.js +17 -17
- package/dist/cjs/CEDeckSupabase.js +68 -69
- package/dist/cjs/CMEDeck.js +61 -62
- package/dist/cjs/Column1.js +6 -6
- package/dist/cjs/Column2.js +14 -14
- package/dist/cjs/Column3.js +26 -27
- package/dist/cjs/ConferenceArticleCard.js +27 -27
- package/dist/cjs/{ConferenceBanner-6c9e718a.js → ConferenceBanner-213003ce.js} +3 -3
- package/dist/cjs/ContentCardPaginated.js +50 -51
- package/dist/cjs/DeckContent.js +67 -68
- package/dist/cjs/DeckQueue.js +58 -59
- package/dist/cjs/DeckQueuePaginated.js +47 -48
- package/dist/cjs/{Dfp-9be904d5.js → Dfp-67646058.js} +17 -18
- package/dist/cjs/EventsDeck.js +107 -107
- package/dist/cjs/ExternalResources.js +35 -36
- package/dist/cjs/Feature.js +17 -17
- package/dist/cjs/ForbesHero.js +25 -25
- package/dist/cjs/GridContent.js +135 -136
- package/dist/cjs/GridContentPaginated.js +122 -123
- package/dist/cjs/GridHero.js +27 -27
- package/dist/cjs/GroupDeck.js +33 -33
- package/dist/cjs/HamMagazine.js +120 -120
- package/dist/cjs/Header.js +25 -25
- package/dist/cjs/HealthCareProfessionalModal.js +18 -18
- package/dist/cjs/Hero.js +6 -6
- package/dist/cjs/HighlightenVideo.js +13 -13
- package/dist/cjs/HorizontalArticleListing.js +29 -30
- package/dist/cjs/HorizontalHero.js +17 -17
- package/dist/cjs/{ImageSlider-294d3fc0.js → ImageSlider-62a43659.js} +221 -164
- package/dist/cjs/IssueContentDeck.js +49 -49
- package/dist/cjs/IssueDeck.js +48 -48
- package/dist/cjs/IssueLanding.js +50 -51
- package/dist/cjs/KMTracker.js +15 -15
- package/dist/cjs/LeftNav.js +17 -18
- package/dist/cjs/MasterDeck.js +47 -48
- package/dist/cjs/MasterDeckPaginated.js +37 -38
- package/dist/cjs/{MediaSeriesCard-1835d75a.js → MediaSeriesCard-a7e29435.js} +17 -17
- package/dist/cjs/MediaSeriesLanding.js +43 -44
- package/dist/cjs/MediaSeriesLandingPaginated.js +42 -43
- package/dist/cjs/NavDvm.js +57 -57
- package/dist/cjs/{NavFooter-fa5fae05.js → NavFooter-b7b16d48.js} +11 -11
- package/dist/cjs/NavMagazine.js +116 -116
- package/dist/cjs/NavNative.js +106 -106
- package/dist/cjs/OncliveHero.js +11 -11
- package/dist/cjs/OncliveLargeHero.js +50 -50
- package/dist/cjs/PageFilter.js +5 -5
- package/dist/cjs/{Pagination-2a3d0103.js → Pagination-6359861a.js} +13 -13
- package/dist/cjs/PartnerDetailListing.js +50 -52
- package/dist/cjs/PartnerDetailListingPaginated.js +49 -51
- package/dist/cjs/PdfDownload.js +4 -4
- package/dist/cjs/PixelTracking.js +9 -9
- package/dist/cjs/PodcastsLanding.js +23 -24
- package/dist/cjs/PopUpModal.js +9 -9
- package/dist/cjs/PtceDeck.js +13 -13
- package/dist/cjs/PubSection.js +14 -15
- package/dist/cjs/PubToc.js +4 -4
- package/dist/cjs/PublicationDeck.js +44 -44
- package/dist/cjs/{PublicationFeature-03de3225.js → PublicationFeature-e945bd55.js} +29 -29
- package/dist/cjs/PublicationLanding.js +101 -101
- package/dist/cjs/QueueDeckExpanded.js +246 -247
- package/dist/cjs/QueueDeckExpandedPaginated.js +223 -224
- package/dist/cjs/RecentNews.js +15 -15
- package/dist/cjs/RelatedContent.js +42 -42
- package/dist/cjs/RelatedTopicsDropdown.js +24 -24
- package/dist/cjs/RolesDeck.js +20 -20
- package/dist/cjs/Schema.js +1 -1
- package/dist/cjs/Search.js +6 -6
- package/dist/cjs/SeriesListingDeck.js +18 -19
- package/dist/cjs/{SeriesSlider-621d0cbb.js → SeriesSlider-edcb8e4b.js} +26 -26
- package/dist/cjs/SideFooter.js +20 -20
- package/dist/cjs/SocialIcons.js +6 -6
- package/dist/cjs/{SocialSearchComponent-f874175b.js → SocialSearchComponent-e9ec9c63.js} +28 -28
- package/dist/cjs/SocialShare.js +25 -25
- package/dist/cjs/TaxonomyCard.js +44 -44
- package/dist/cjs/TaxonomyDescription.js +12 -13
- package/dist/cjs/TemplateNormal.js +27 -28
- package/dist/cjs/ThumbnailCard.js +11 -11
- package/dist/cjs/{Tooltip-f075b7ef.js → Tooltip-980a1d1a.js} +493 -608
- package/dist/cjs/Ustream.js +9 -9
- package/dist/cjs/VerticalHero.js +10 -10
- package/dist/cjs/VideoProgramLandingPage.js +29 -30
- package/dist/cjs/VideoSeriesCard.js +14 -14
- package/dist/cjs/VideoSeriesFilter.js +5 -5
- package/dist/cjs/VideoSeriesLandingPage.js +11 -12
- package/dist/cjs/VideoSeriesListing.js +46 -47
- package/dist/cjs/View.js +238 -239
- package/dist/cjs/YahooHero.js +23 -23
- package/dist/cjs/YoutubeGroup.js +37 -37
- package/dist/cjs/{brightcove-react-player-loader.es-a195642e.js → brightcove-react-player-loader.es-4c7825a1.js} +2 -2
- package/dist/cjs/{entities-df1aed86.js → entities-3f9d0f2f.js} +0 -4
- package/dist/cjs/getQuery.js +1 -1
- package/dist/cjs/getSerializers.js +7 -8
- package/dist/cjs/{getTargeting-5b954783.js → getTargeting-45ffbee8.js} +9 -9
- package/dist/cjs/getTargeting.js +1 -1
- package/dist/cjs/iconBase-be4097c0.js +2 -4
- package/dist/cjs/{index-ee8ef012.js → index-43275e6f.js} +485 -485
- package/dist/cjs/{index-eadd5035.js → index-65621b6c.js} +5 -5
- package/dist/cjs/{index-fc2f1ca2.js → index-7435b964.js} +471 -6
- package/dist/cjs/{index-50be6759.js → index-8041a4eb.js} +9 -15
- package/dist/cjs/{index-f86bb269.js → index-96c331fd.js} +53 -52
- package/dist/cjs/{index.es-f3e47207.js → index.es-1ab8dda7.js} +4 -4
- package/dist/cjs/{index.esm-f51609ab.js → index.esm-2ea9e9ff.js} +14 -14
- package/dist/cjs/index.js +103 -106
- package/dist/cjs/{main-1ec1de84.js → main-47be4f9f.js} +13 -13
- package/dist/cjs/{react-social-icons-af932527.js → react-social-icons-2c5c389a.js} +7 -7
- package/dist/cjs/ustream-api-3819e4aa.js +1 -1
- package/dist/cjs/{visibility-sensor-eb2c5b69.js → visibility-sensor-56020df6.js} +1 -1
- package/dist/esm/AD.js +1 -1
- package/dist/esm/AD300x250.js +1 -2
- package/dist/esm/AD300x250x600.js +1 -2
- package/dist/esm/AD728x90.js +1 -2
- package/dist/esm/ADFloatingFooter.js +1 -2
- package/dist/esm/ADGutter.js +1 -2
- package/dist/esm/ADSkyscraper.js +1 -2
- package/dist/esm/ADSponsoredResources.js +1 -2
- package/dist/esm/ADWebcast.js +1 -2
- package/dist/esm/ADWelcome.js +1 -2
- package/dist/esm/AdSlot.js +1 -2
- package/dist/esm/AdSlotsProvider.js +1 -2
- package/dist/esm/AlgoliaSearch.js +1026 -513
- package/dist/esm/ArticleProgramLandingPage.js +3 -4
- package/dist/esm/ArticleSeriesLandingPage.js +3 -4
- package/dist/esm/ArticleSeriesListing.js +1 -2
- package/dist/esm/AuthWrapper.js +288 -1470
- package/dist/esm/CEDeckSupabase.js +2 -3
- package/dist/esm/CMEDeck.js +1 -2
- package/dist/esm/Column3.js +1 -2
- package/dist/esm/ConferenceArticleCard.js +15 -15
- package/dist/esm/ContentCardPaginated.js +4 -5
- package/dist/esm/DeckContent.js +11 -12
- package/dist/esm/DeckQueue.js +2 -3
- package/dist/esm/DeckQueuePaginated.js +3 -4
- package/dist/esm/{Dfp-102f0beb.js → Dfp-cf85d203.js} +1 -2
- package/dist/esm/EventsDeck.js +18 -18
- package/dist/esm/ExternalResources.js +4 -5
- package/dist/esm/GridContent.js +4 -5
- package/dist/esm/GridContentPaginated.js +5 -6
- package/dist/esm/GridHero.js +1 -1
- package/dist/esm/HamMagazine.js +9 -9
- package/dist/esm/HealthCareProfessionalModal.js +1 -1
- package/dist/esm/Hero.js +1 -1
- package/dist/esm/HorizontalArticleListing.js +3 -4
- package/dist/esm/{ImageSlider-497e9c88.js → ImageSlider-aea3a615.js} +67 -10
- package/dist/esm/IssueLanding.js +34 -35
- package/dist/esm/KMTracker.js +15 -15
- package/dist/esm/LeftNav.js +1 -2
- package/dist/esm/MasterDeck.js +11 -12
- package/dist/esm/MasterDeckPaginated.js +12 -13
- package/dist/esm/{MediaSeriesCard-a7084d7c.js → MediaSeriesCard-b47e2393.js} +2 -2
- package/dist/esm/MediaSeriesLanding.js +13 -14
- package/dist/esm/MediaSeriesLandingPaginated.js +14 -15
- package/dist/esm/NavMagazine.js +10 -10
- package/dist/esm/NavNative.js +9 -9
- package/dist/esm/OncliveLargeHero.js +1 -1
- package/dist/esm/{Pagination-dc30727b.js → Pagination-9fe9f61d.js} +1 -1
- package/dist/esm/PartnerDetailListing.js +6 -8
- package/dist/esm/PartnerDetailListingPaginated.js +7 -9
- package/dist/esm/PodcastsLanding.js +6 -7
- package/dist/esm/PubSection.js +4 -5
- package/dist/esm/PublicationLanding.js +26 -26
- package/dist/esm/QueueDeckExpanded.js +4 -5
- package/dist/esm/QueueDeckExpandedPaginated.js +5 -6
- package/dist/esm/RelatedContent.js +28 -28
- package/dist/esm/RelatedTopicsDropdown.js +10 -10
- package/dist/esm/SeriesListingDeck.js +2 -3
- package/dist/esm/{SeriesSlider-07be99e0.js → SeriesSlider-2e83e861.js} +4 -4
- package/dist/esm/SideFooter.js +2 -2
- package/dist/esm/TaxonomyDescription.js +3 -4
- package/dist/esm/TemplateNormal.js +1 -2
- package/dist/esm/ThumbnailCard.js +1 -1
- package/dist/esm/{Tooltip-95655b44.js → Tooltip-51957f7c.js} +55 -170
- package/dist/esm/VideoProgramLandingPage.js +3 -4
- package/dist/esm/VideoSeriesCard.js +1 -1
- package/dist/esm/VideoSeriesLandingPage.js +3 -4
- package/dist/esm/VideoSeriesListing.js +1 -2
- package/dist/esm/View.js +7 -8
- package/dist/esm/YahooHero.js +1 -1
- package/dist/esm/YoutubeGroup.js +4 -4
- package/dist/esm/{entities-6d9154b4.js → entities-932b50cf.js} +0 -4
- package/dist/esm/getQuery.js +1 -1
- package/dist/esm/getSerializers.js +3 -4
- package/dist/esm/{getTargeting-5a281334.js → getTargeting-a569a9cc.js} +9 -9
- package/dist/esm/getTargeting.js +1 -1
- package/dist/esm/{index-79cfd25c.js → index-30a6257d.js} +53 -52
- package/dist/esm/{index-f0fc23eb.js → index-5cc7b406.js} +466 -1
- package/dist/esm/{index-98ca9cec.js → index-67e1773f.js} +9 -15
- package/dist/esm/{index-57eb68ee.js → index-983ef4ad.js} +2 -2
- package/dist/esm/index.js +10 -13
- package/package.json +116 -116
- package/dist/cjs/defineProperty-e0fb52c5.js +0 -73
- package/dist/cjs/events-1b438fe7.js +0 -469
- package/dist/cjs/typeof-1358762e.js +0 -33
- package/dist/esm/defineProperty-23a8f8cd.js +0 -68
- package/dist/esm/events-6c3a7a63.js +0 -467
- package/dist/esm/typeof-2f07d0e8.js +0 -30
- /package/dist/esm/{ADInfeed-74cc728c.js → ADInfeed-c3f5613e.js} +0 -0
- /package/dist/esm/{ADlgInfeed-b6217567.js → ADlgInfeed-2b148f3f.js} +0 -0
package/dist/esm/AuthWrapper.js
CHANGED
|
@@ -1,887 +1,11 @@
|
|
|
1
1
|
import { _ as _slicedToArray } from './slicedToArray-6ebcbfea.js';
|
|
2
2
|
import { c as createCommonjsModule, u as unwrapExports } from './_commonjsHelpers-0c4b6f40.js';
|
|
3
|
-
import { a as _typeof_1 } from './typeof-2f07d0e8.js';
|
|
4
|
-
import { d as defineProperty, b as asyncToGenerator } from './defineProperty-23a8f8cd.js';
|
|
5
3
|
import React__default, { useState, useEffect } from 'react';
|
|
6
4
|
import { Form } from 'react-bootstrap';
|
|
7
5
|
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
8
6
|
import './web.dom.iterable-ab4dea5c.js';
|
|
9
7
|
import './core.get-iterator-method-ea258bb1.js';
|
|
10
8
|
|
|
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
|
-
|
|
885
9
|
var logger = createCommonjsModule(function (module, exports) {
|
|
886
10
|
|
|
887
11
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -890,25 +14,39 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
890
14
|
exports.setLogger = setLogger;
|
|
891
15
|
exports.proxyLogger = proxyLogger;
|
|
892
16
|
exports.default = void 0;
|
|
893
|
-
|
|
894
|
-
error(code
|
|
895
|
-
|
|
17
|
+
var _logger = {
|
|
18
|
+
error(code) {
|
|
19
|
+
for (var _len = arguments.length, message = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
20
|
+
message[_key - 1] = arguments[_key];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
console.error("[next-auth][error][".concat(code.toLowerCase(), "]"), "\nhttps://next-auth.js.org/errors#".concat(code.toLowerCase()), ...message);
|
|
896
24
|
},
|
|
897
25
|
|
|
898
|
-
warn(code
|
|
899
|
-
|
|
26
|
+
warn(code) {
|
|
27
|
+
for (var _len2 = arguments.length, message = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
28
|
+
message[_key2 - 1] = arguments[_key2];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
console.warn("[next-auth][warn][".concat(code.toLowerCase(), "]"), "\nhttps://next-auth.js.org/warnings#".concat(code.toLowerCase()), ...message);
|
|
900
32
|
},
|
|
901
33
|
|
|
902
|
-
debug(code
|
|
34
|
+
debug(code) {
|
|
903
35
|
var _process, _process$env;
|
|
904
36
|
|
|
905
37
|
if (!((_process = process) !== null && _process !== void 0 && (_process$env = _process.env) !== null && _process$env !== void 0 && _process$env._NEXTAUTH_DEBUG)) return;
|
|
906
|
-
|
|
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);
|
|
907
44
|
}
|
|
908
45
|
|
|
909
46
|
};
|
|
910
47
|
|
|
911
|
-
function setLogger(
|
|
48
|
+
function setLogger() {
|
|
49
|
+
var newLogger = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
912
50
|
if (newLogger.error) _logger.error = newLogger.error;
|
|
913
51
|
if (newLogger.warn) _logger.warn = newLogger.warn;
|
|
914
52
|
if (newLogger.debug) _logger.debug = newLogger.debug;
|
|
@@ -917,20 +55,27 @@ function setLogger(newLogger = {}) {
|
|
|
917
55
|
var _default = _logger;
|
|
918
56
|
exports.default = _default;
|
|
919
57
|
|
|
920
|
-
function proxyLogger(
|
|
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
|
+
|
|
921
62
|
try {
|
|
922
|
-
if (typeof window ===
|
|
63
|
+
if (typeof window === 'undefined') {
|
|
923
64
|
return logger;
|
|
924
65
|
}
|
|
925
66
|
|
|
926
|
-
|
|
67
|
+
var clientLogger = {};
|
|
68
|
+
|
|
69
|
+
var _loop = function _loop(level) {
|
|
70
|
+
clientLogger[level] = function (code) {
|
|
71
|
+
for (var _len4 = arguments.length, message = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
|
72
|
+
message[_key4 - 1] = arguments[_key4];
|
|
73
|
+
}
|
|
927
74
|
|
|
928
|
-
for (const level in logger) {
|
|
929
|
-
clientLogger[level] = (code, ...message) => {
|
|
930
75
|
_logger[level](code, ...message);
|
|
931
76
|
|
|
932
|
-
|
|
933
|
-
|
|
77
|
+
var url = "".concat(basePath, "/_log");
|
|
78
|
+
var body = new URLSearchParams({
|
|
934
79
|
level,
|
|
935
80
|
code,
|
|
936
81
|
message: JSON.stringify(message.map(m => {
|
|
@@ -951,13 +96,17 @@ function proxyLogger(logger = _logger, basePath) {
|
|
|
951
96
|
}
|
|
952
97
|
|
|
953
98
|
return fetch(url, {
|
|
954
|
-
method:
|
|
99
|
+
method: 'POST',
|
|
955
100
|
headers: {
|
|
956
|
-
|
|
101
|
+
'Content-Type': 'application/json'
|
|
957
102
|
},
|
|
958
103
|
body
|
|
959
104
|
});
|
|
960
105
|
};
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
for (var level in logger) {
|
|
109
|
+
_loop(level);
|
|
961
110
|
}
|
|
962
111
|
|
|
963
112
|
return clientLogger;
|
|
@@ -979,18 +128,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
979
128
|
exports.default = parseUrl;
|
|
980
129
|
|
|
981
130
|
function parseUrl(url) {
|
|
982
|
-
|
|
983
|
-
|
|
131
|
+
var defaultHost = 'http://localhost:3000';
|
|
132
|
+
var defaultPath = '/api/auth';
|
|
984
133
|
|
|
985
134
|
if (!url) {
|
|
986
|
-
url =
|
|
135
|
+
url = "".concat(defaultHost).concat(defaultPath);
|
|
987
136
|
}
|
|
988
137
|
|
|
989
|
-
|
|
138
|
+
var protocol = url.startsWith('http:') ? 'http' : 'https';
|
|
990
139
|
url = url.replace(/^https?:\/\//, '').replace(/\/$/, '');
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
140
|
+
var [_host, ..._path] = url.split('/');
|
|
141
|
+
var baseUrl = _host ? "".concat(protocol, "://").concat(_host) : defaultHost;
|
|
142
|
+
var basePath = _path.length > 0 ? "/".concat(_path.join('/')) : defaultPath;
|
|
994
143
|
return {
|
|
995
144
|
baseUrl,
|
|
996
145
|
basePath
|
|
@@ -1002,44 +151,39 @@ unwrapExports(parseUrl_1);
|
|
|
1002
151
|
|
|
1003
152
|
var client$1 = createCommonjsModule(function (module, exports) {
|
|
1004
153
|
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
154
|
Object.defineProperty(exports, "__esModule", {
|
|
1010
155
|
value: true
|
|
1011
156
|
});
|
|
1012
157
|
exports.useSession = useSession;
|
|
1013
|
-
exports.
|
|
1014
|
-
exports.
|
|
1015
|
-
exports.
|
|
1016
|
-
exports.
|
|
1017
|
-
exports.
|
|
1018
|
-
exports.options = exports.setOptions = setOptions;
|
|
158
|
+
exports.getSession = getSession;
|
|
159
|
+
exports.getProviders = getProviders;
|
|
160
|
+
exports.signIn = signIn;
|
|
161
|
+
exports.signOut = signOut;
|
|
162
|
+
exports.setOptions = setOptions;
|
|
1019
163
|
exports.Provider = Provider;
|
|
1020
164
|
exports.default = void 0;
|
|
1021
165
|
|
|
1022
|
-
var _regenerator = interopRequireDefault(regenerator);
|
|
1023
166
|
|
|
1024
|
-
var _defineProperty2 = interopRequireDefault(defineProperty);
|
|
1025
167
|
|
|
1026
|
-
var
|
|
168
|
+
var _logger2 = _interopRequireWildcard(logger);
|
|
1027
169
|
|
|
1028
|
-
var
|
|
170
|
+
var _parseUrl = _interopRequireDefault(parseUrl_1);
|
|
1029
171
|
|
|
172
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1030
173
|
|
|
174
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
1031
175
|
|
|
1032
|
-
var
|
|
176
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
1033
177
|
|
|
1034
|
-
var
|
|
178
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
1035
179
|
|
|
1036
|
-
function
|
|
180
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
1037
181
|
|
|
1038
|
-
function
|
|
182
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1039
183
|
|
|
1040
|
-
function
|
|
184
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
1041
185
|
|
|
1042
|
-
function
|
|
186
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
1043
187
|
|
|
1044
188
|
var __NEXTAUTH = {
|
|
1045
189
|
baseUrl: (0, _parseUrl.default)(process.env.NEXTAUTH_URL || process.env.VERCEL_URL).baseUrl,
|
|
@@ -1052,21 +196,19 @@ var __NEXTAUTH = {
|
|
|
1052
196
|
_clientSyncTimer: null,
|
|
1053
197
|
_eventListenersAdded: false,
|
|
1054
198
|
_clientSession: undefined,
|
|
1055
|
-
_getSession:
|
|
199
|
+
_getSession: () => {}
|
|
1056
200
|
};
|
|
1057
201
|
var logger$1 = (0, _logger2.proxyLogger)(_logger2.default, __NEXTAUTH.basePath);
|
|
1058
202
|
var broadcast = BroadcastChannel();
|
|
1059
203
|
|
|
1060
|
-
if (typeof window !==
|
|
204
|
+
if (typeof window !== 'undefined' && !__NEXTAUTH._eventListenersAdded) {
|
|
1061
205
|
__NEXTAUTH._eventListenersAdded = true;
|
|
1062
|
-
broadcast.receive(
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
});
|
|
1067
|
-
document.addEventListener("visibilitychange", function () {
|
|
206
|
+
broadcast.receive(() => __NEXTAUTH._getSession({
|
|
207
|
+
event: 'storage'
|
|
208
|
+
}));
|
|
209
|
+
document.addEventListener('visibilitychange', () => {
|
|
1068
210
|
!document.hidden && __NEXTAUTH._getSession({
|
|
1069
|
-
event:
|
|
211
|
+
event: 'visibilitychange'
|
|
1070
212
|
});
|
|
1071
213
|
}, false);
|
|
1072
214
|
}
|
|
@@ -1080,103 +222,50 @@ function useSession(session) {
|
|
|
1080
222
|
}
|
|
1081
223
|
|
|
1082
224
|
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();
|
|
225
|
+
var [data, setData] = (0, React__default.useState)(session);
|
|
226
|
+
var [loading, setLoading] = (0, React__default.useState)(!data);
|
|
227
|
+
(0, React__default.useEffect)(() => {
|
|
228
|
+
__NEXTAUTH._getSession = _asyncToGenerator(function* () {
|
|
229
|
+
var {
|
|
230
|
+
event = null
|
|
231
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
232
|
+
|
|
233
|
+
try {
|
|
234
|
+
var triggredByEvent = event !== null;
|
|
235
|
+
var triggeredByStorageEvent = event === 'storage';
|
|
236
|
+
var clientMaxAge = __NEXTAUTH.clientMaxAge;
|
|
237
|
+
var clientLastSync = parseInt(__NEXTAUTH._clientLastSync);
|
|
238
|
+
|
|
239
|
+
var currentTime = _now();
|
|
240
|
+
|
|
241
|
+
var clientSession = __NEXTAUTH._clientSession;
|
|
242
|
+
|
|
243
|
+
if (!triggeredByStorageEvent && clientSession !== undefined) {
|
|
244
|
+
if (clientMaxAge === 0 && triggredByEvent !== true) {
|
|
245
|
+
return;
|
|
246
|
+
} else if (clientMaxAge > 0 && clientSession === null) {
|
|
247
|
+
return;
|
|
248
|
+
} else if (clientMaxAge > 0 && currentTime < clientLastSync + clientMaxAge) {
|
|
249
|
+
return;
|
|
1176
250
|
}
|
|
1177
251
|
}
|
|
1178
|
-
|
|
1179
|
-
|
|
252
|
+
|
|
253
|
+
if (clientSession === undefined) {
|
|
254
|
+
__NEXTAUTH._clientSession = null;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
__NEXTAUTH._clientLastSync = _now();
|
|
258
|
+
var newClientSessionData = yield getSession({
|
|
259
|
+
triggerEvent: !triggeredByStorageEvent
|
|
260
|
+
});
|
|
261
|
+
__NEXTAUTH._clientSession = newClientSessionData;
|
|
262
|
+
setData(newClientSessionData);
|
|
263
|
+
setLoading(false);
|
|
264
|
+
} catch (error) {
|
|
265
|
+
logger$1.error('CLIENT_USE_SESSION_ERROR', error);
|
|
266
|
+
setLoading(false);
|
|
267
|
+
}
|
|
268
|
+
});
|
|
1180
269
|
|
|
1181
270
|
__NEXTAUTH._getSession();
|
|
1182
271
|
});
|
|
@@ -1188,38 +277,22 @@ function getSession(_x) {
|
|
|
1188
277
|
}
|
|
1189
278
|
|
|
1190
279
|
function _getSession2() {
|
|
1191
|
-
_getSession2 = (
|
|
280
|
+
_getSession2 = _asyncToGenerator(function* (ctx) {
|
|
1192
281
|
var _ctx$triggerEvent;
|
|
1193
282
|
|
|
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);
|
|
283
|
+
var session = yield _fetchData('session', ctx);
|
|
1215
284
|
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
285
|
+
if ((_ctx$triggerEvent = ctx === null || ctx === void 0 ? void 0 : ctx.triggerEvent) !== null && _ctx$triggerEvent !== void 0 ? _ctx$triggerEvent : true) {
|
|
286
|
+
broadcast.post({
|
|
287
|
+
event: 'session',
|
|
288
|
+
data: {
|
|
289
|
+
trigger: 'getSession'
|
|
1219
290
|
}
|
|
1220
|
-
}
|
|
1221
|
-
}
|
|
1222
|
-
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
return session;
|
|
295
|
+
});
|
|
1223
296
|
return _getSession2.apply(this, arguments);
|
|
1224
297
|
}
|
|
1225
298
|
|
|
@@ -1228,50 +301,11 @@ function getCsrfToken(_x2) {
|
|
|
1228
301
|
}
|
|
1229
302
|
|
|
1230
303
|
function _getCsrfToken() {
|
|
1231
|
-
_getCsrfToken = (
|
|
304
|
+
_getCsrfToken = _asyncToGenerator(function* (ctx) {
|
|
1232
305
|
var _yield$_fetchData;
|
|
1233
306
|
|
|
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
|
-
}));
|
|
307
|
+
return (_yield$_fetchData = yield _fetchData('csrf', ctx)) === null || _yield$_fetchData === void 0 ? void 0 : _yield$_fetchData.csrfToken;
|
|
308
|
+
});
|
|
1275
309
|
return _getCsrfToken.apply(this, arguments);
|
|
1276
310
|
}
|
|
1277
311
|
|
|
@@ -1280,24 +314,9 @@ function getProviders() {
|
|
|
1280
314
|
}
|
|
1281
315
|
|
|
1282
316
|
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
|
-
}));
|
|
317
|
+
_getProviders = _asyncToGenerator(function* () {
|
|
318
|
+
return _fetchData('providers');
|
|
319
|
+
});
|
|
1301
320
|
return _getProviders.apply(this, arguments);
|
|
1302
321
|
}
|
|
1303
322
|
|
|
@@ -1306,138 +325,68 @@ function signIn(_x3) {
|
|
|
1306
325
|
}
|
|
1307
326
|
|
|
1308
327
|
function _signIn() {
|
|
1309
|
-
_signIn = (
|
|
1310
|
-
var options
|
|
1311
|
-
|
|
1312
|
-
|
|
328
|
+
_signIn = _asyncToGenerator(function* (provider) {
|
|
329
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
330
|
+
var authorizationParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
331
|
+
var {
|
|
332
|
+
callbackUrl = window.location,
|
|
333
|
+
redirect = true
|
|
334
|
+
} = options;
|
|
335
|
+
|
|
336
|
+
var baseUrl = _apiBaseUrl();
|
|
337
|
+
|
|
338
|
+
var providers = yield getProviders();
|
|
339
|
+
|
|
340
|
+
if (!(provider in providers)) {
|
|
341
|
+
window.location = "".concat(baseUrl, "/signin?callbackUrl=").concat(encodeURIComponent(callbackUrl));
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
var isCredentials = providers[provider].type === 'credentials';
|
|
346
|
+
var isEmail = providers[provider].type === 'email';
|
|
347
|
+
var canRedirectBeDisabled = isCredentials || isEmail;
|
|
348
|
+
var signInUrl = isCredentials ? "".concat(baseUrl, "/callback/").concat(provider) : "".concat(baseUrl, "/signin/").concat(provider);
|
|
349
|
+
var fetchOptions = {
|
|
350
|
+
method: 'post',
|
|
351
|
+
headers: {
|
|
352
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
353
|
+
},
|
|
354
|
+
body: new URLSearchParams(_objectSpread(_objectSpread({}, options), {}, {
|
|
355
|
+
csrfToken: yield getCsrfToken(),
|
|
1313
356
|
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
|
-
}
|
|
357
|
+
json: true
|
|
358
|
+
}))
|
|
359
|
+
};
|
|
1348
360
|
|
|
1349
|
-
|
|
361
|
+
var _signInUrl = "".concat(signInUrl, "?").concat(new URLSearchParams(authorizationParams));
|
|
1350
362
|
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
_context7.next = 11;
|
|
1354
|
-
break;
|
|
1355
|
-
}
|
|
363
|
+
var res = yield fetch(_signInUrl, fetchOptions);
|
|
364
|
+
var data = yield res.json();
|
|
1356
365
|
|
|
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
|
-
}
|
|
366
|
+
if (redirect || !canRedirectBeDisabled) {
|
|
367
|
+
var _data$url;
|
|
1407
368
|
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
369
|
+
var url = (_data$url = data.url) !== null && _data$url !== void 0 ? _data$url : callbackUrl;
|
|
370
|
+
window.location = url;
|
|
371
|
+
if (url.includes('#')) window.location.reload();
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
1412
374
|
|
|
1413
|
-
|
|
1414
|
-
error = new URL(data.url).searchParams.get("error");
|
|
375
|
+
var error = new URL(data.url).searchParams.get('error');
|
|
1415
376
|
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
377
|
+
if (res.ok) {
|
|
378
|
+
yield __NEXTAUTH._getSession({
|
|
379
|
+
event: 'storage'
|
|
380
|
+
});
|
|
381
|
+
}
|
|
1420
382
|
|
|
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
|
-
}));
|
|
383
|
+
return {
|
|
384
|
+
error,
|
|
385
|
+
status: res.status,
|
|
386
|
+
ok: res.ok,
|
|
387
|
+
url: error ? null : data.url
|
|
388
|
+
};
|
|
389
|
+
});
|
|
1441
390
|
return _signIn.apply(this, arguments);
|
|
1442
391
|
}
|
|
1443
392
|
|
|
@@ -1446,145 +395,86 @@ function signOut() {
|
|
|
1446
395
|
}
|
|
1447
396
|
|
|
1448
397
|
function _signOut() {
|
|
1449
|
-
_signOut = (
|
|
1450
|
-
var options
|
|
1451
|
-
|
|
398
|
+
_signOut = _asyncToGenerator(function* () {
|
|
399
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
400
|
+
var {
|
|
401
|
+
callbackUrl = window.location,
|
|
402
|
+
redirect = true
|
|
403
|
+
} = options;
|
|
404
|
+
|
|
405
|
+
var baseUrl = _apiBaseUrl();
|
|
406
|
+
|
|
407
|
+
var fetchOptions = {
|
|
408
|
+
method: 'post',
|
|
409
|
+
headers: {
|
|
410
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
411
|
+
},
|
|
412
|
+
body: new URLSearchParams({
|
|
413
|
+
csrfToken: yield getCsrfToken(),
|
|
1452
414
|
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");
|
|
415
|
+
json: true
|
|
416
|
+
})
|
|
417
|
+
};
|
|
418
|
+
var res = yield fetch("".concat(baseUrl, "/signout"), fetchOptions);
|
|
419
|
+
var data = yield res.json();
|
|
420
|
+
broadcast.post({
|
|
421
|
+
event: 'session',
|
|
422
|
+
data: {
|
|
423
|
+
trigger: 'signout'
|
|
424
|
+
}
|
|
425
|
+
});
|
|
1517
426
|
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
return __NEXTAUTH._getSession({
|
|
1521
|
-
event: "storage"
|
|
1522
|
-
});
|
|
427
|
+
if (redirect) {
|
|
428
|
+
var _data$url2;
|
|
1523
429
|
|
|
1524
|
-
|
|
1525
|
-
|
|
430
|
+
var url = (_data$url2 = data.url) !== null && _data$url2 !== void 0 ? _data$url2 : callbackUrl;
|
|
431
|
+
window.location = url;
|
|
432
|
+
if (url.includes('#')) window.location.reload();
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
1526
435
|
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
}, _callee8);
|
|
1533
|
-
}));
|
|
436
|
+
yield __NEXTAUTH._getSession({
|
|
437
|
+
event: 'storage'
|
|
438
|
+
});
|
|
439
|
+
return data;
|
|
440
|
+
});
|
|
1534
441
|
return _signOut.apply(this, arguments);
|
|
1535
442
|
}
|
|
1536
443
|
|
|
1537
444
|
function setOptions() {
|
|
1538
|
-
var
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
445
|
+
var {
|
|
446
|
+
baseUrl,
|
|
447
|
+
basePath,
|
|
448
|
+
clientMaxAge,
|
|
449
|
+
keepAlive
|
|
450
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1544
451
|
if (baseUrl) __NEXTAUTH.baseUrl = baseUrl;
|
|
1545
452
|
if (basePath) __NEXTAUTH.basePath = basePath;
|
|
1546
453
|
if (clientMaxAge) __NEXTAUTH.clientMaxAge = clientMaxAge;
|
|
1547
454
|
|
|
1548
455
|
if (keepAlive) {
|
|
1549
456
|
__NEXTAUTH.keepAlive = keepAlive;
|
|
1550
|
-
if (typeof window ===
|
|
457
|
+
if (typeof window === 'undefined') return;
|
|
1551
458
|
|
|
1552
459
|
if (__NEXTAUTH._clientSyncTimer !== null) {
|
|
1553
460
|
clearTimeout(__NEXTAUTH._clientSyncTimer);
|
|
1554
461
|
}
|
|
1555
462
|
|
|
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);
|
|
463
|
+
__NEXTAUTH._clientSyncTimer = setTimeout(_asyncToGenerator(function* () {
|
|
464
|
+
if (!__NEXTAUTH._clientSession) return;
|
|
465
|
+
yield __NEXTAUTH._getSession({
|
|
466
|
+
event: 'timer'
|
|
467
|
+
});
|
|
468
|
+
}), keepAlive * 1000);
|
|
1581
469
|
}
|
|
1582
470
|
}
|
|
1583
471
|
|
|
1584
|
-
function Provider(
|
|
1585
|
-
var
|
|
1586
|
-
|
|
1587
|
-
|
|
472
|
+
function Provider(_ref3) {
|
|
473
|
+
var {
|
|
474
|
+
children,
|
|
475
|
+
session,
|
|
476
|
+
options
|
|
477
|
+
} = _ref3;
|
|
1588
478
|
setOptions(options);
|
|
1589
479
|
return (0, React__default.createElement)(SessionContext.Provider, {
|
|
1590
480
|
value: useSession(session)
|
|
@@ -1596,74 +486,34 @@ function _fetchData(_x4) {
|
|
|
1596
486
|
}
|
|
1597
487
|
|
|
1598
488
|
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;
|
|
489
|
+
_fetchData2 = _asyncToGenerator(function* (path) {
|
|
490
|
+
var {
|
|
491
|
+
ctx,
|
|
492
|
+
req = ctx === null || ctx === void 0 ? void 0 : ctx.req
|
|
493
|
+
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1643
494
|
|
|
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();
|
|
495
|
+
try {
|
|
496
|
+
var baseUrl = yield _apiBaseUrl();
|
|
497
|
+
var options = req ? {
|
|
498
|
+
headers: {
|
|
499
|
+
cookie: req.headers.cookie
|
|
1656
500
|
}
|
|
1657
|
-
}
|
|
1658
|
-
|
|
1659
|
-
|
|
501
|
+
} : {};
|
|
502
|
+
var res = yield fetch("".concat(baseUrl, "/").concat(path), options);
|
|
503
|
+
var data = yield res.json();
|
|
504
|
+
return Object.keys(data).length > 0 ? data : null;
|
|
505
|
+
} catch (error) {
|
|
506
|
+
logger$1.error('CLIENT_FETCH_ERROR', path, error);
|
|
507
|
+
return null;
|
|
508
|
+
}
|
|
509
|
+
});
|
|
1660
510
|
return _fetchData2.apply(this, arguments);
|
|
1661
511
|
}
|
|
1662
512
|
|
|
1663
513
|
function _apiBaseUrl() {
|
|
1664
|
-
if (typeof window ===
|
|
514
|
+
if (typeof window === 'undefined') {
|
|
1665
515
|
if (!process.env.NEXTAUTH_URL) {
|
|
1666
|
-
logger$1.warn(
|
|
516
|
+
logger$1.warn('NEXTAUTH_URL', 'NEXTAUTH_URL environment variable not set');
|
|
1667
517
|
}
|
|
1668
518
|
|
|
1669
519
|
return "".concat(__NEXTAUTH.baseUrlServer).concat(__NEXTAUTH.basePathServer);
|
|
@@ -1677,68 +527,43 @@ function _now() {
|
|
|
1677
527
|
}
|
|
1678
528
|
|
|
1679
529
|
function BroadcastChannel() {
|
|
1680
|
-
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] :
|
|
530
|
+
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'nextauth.message';
|
|
1681
531
|
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
|
-
}));
|
|
532
|
+
receive(onReceive) {
|
|
533
|
+
if (typeof window === 'undefined') return;
|
|
534
|
+
window.addEventListener('storage', function () {
|
|
535
|
+
var _ref4 = _asyncToGenerator(function* (event) {
|
|
536
|
+
if (event.key !== name) return;
|
|
537
|
+
var message = JSON.parse(event.newValue);
|
|
538
|
+
if ((message === null || message === void 0 ? void 0 : message.event) !== 'session' || !(message !== null && message !== void 0 && message.data)) return;
|
|
539
|
+
onReceive(message);
|
|
540
|
+
});
|
|
1718
541
|
|
|
1719
542
|
return function (_x5) {
|
|
1720
|
-
return
|
|
543
|
+
return _ref4.apply(this, arguments);
|
|
1721
544
|
};
|
|
1722
545
|
}());
|
|
1723
546
|
},
|
|
1724
|
-
|
|
1725
|
-
|
|
547
|
+
|
|
548
|
+
post(message) {
|
|
549
|
+
if (typeof localStorage === 'undefined') return;
|
|
1726
550
|
localStorage.setItem(name, JSON.stringify(_objectSpread(_objectSpread({}, message), {}, {
|
|
1727
551
|
timestamp: _now()
|
|
1728
552
|
})));
|
|
1729
553
|
}
|
|
554
|
+
|
|
1730
555
|
};
|
|
1731
556
|
}
|
|
1732
557
|
|
|
1733
558
|
var _default = {
|
|
1734
|
-
getSession
|
|
1735
|
-
getCsrfToken
|
|
1736
|
-
getProviders
|
|
1737
|
-
useSession
|
|
1738
|
-
signIn
|
|
1739
|
-
signOut
|
|
1740
|
-
Provider
|
|
1741
|
-
setOptions
|
|
559
|
+
getSession,
|
|
560
|
+
getCsrfToken,
|
|
561
|
+
getProviders,
|
|
562
|
+
useSession,
|
|
563
|
+
signIn,
|
|
564
|
+
signOut,
|
|
565
|
+
Provider,
|
|
566
|
+
setOptions,
|
|
1742
567
|
options: setOptions,
|
|
1743
568
|
session: getSession,
|
|
1744
569
|
providers: getProviders,
|
|
@@ -1751,23 +576,16 @@ exports.default = _default;
|
|
|
1751
576
|
|
|
1752
577
|
unwrapExports(client$1);
|
|
1753
578
|
client$1.useSession;
|
|
1754
|
-
client$1.session;
|
|
1755
579
|
client$1.getSession;
|
|
1756
|
-
client$1.csrfToken;
|
|
1757
|
-
client$1.getCsrfToken;
|
|
1758
|
-
client$1.providers;
|
|
1759
580
|
client$1.getProviders;
|
|
1760
|
-
client$1.signin;
|
|
1761
581
|
client$1.signIn;
|
|
1762
|
-
client$1.signout;
|
|
1763
582
|
client$1.signOut;
|
|
1764
|
-
client$1.options;
|
|
1765
583
|
client$1.setOptions;
|
|
1766
584
|
client$1.Provider;
|
|
1767
585
|
|
|
1768
586
|
var client = client$1.default;
|
|
1769
587
|
|
|
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}";
|
|
588
|
+
var css = ".AuthWrapper-module_loginBox__3l-BE {\r\n margin-bottom: 2rem;\r\n width: 350px;\r\n max-width: 90vw;\r\n margin-left: auto;\r\n margin-right: auto;\r\n /* box-shadow: 2px 5px 12px rgba(0, 0, 0, 0.15); */\r\n background: #fff;\r\n z-index: 1;\r\n}\r\n.AuthWrapper-module_loginBox_title__12rGD {\r\n margin-bottom: 2rem;\r\n text-align: center;\r\n}\r\n.AuthWrapper-module_bar__1dafn {\r\n background: #eee;\r\n margin-left: unset;\r\n margin-right: unset;\r\n}\r\n.AuthWrapper-module_bar__1dafn:nth-child(1) {\r\n float: left;\r\n border-right: 1rem solid #fff;\r\n background: rgb(245, 245, 245);\r\n height: 10rem;\r\n width: 25%;\r\n margin-left: auto;\r\n margin-right: auto;\r\n margin-bottom: 2rem;\r\n}\r\n.AuthWrapper-module_bar__1dafn:nth-child(2n) {\r\n width: 97%;\r\n height: 1.5rem;\r\n margin-bottom: 0.25rem;\r\n}\r\n.AuthWrapper-module_bar__1dafn.AuthWrapper-module_bar__1dafn:nth-child(3n) {\r\n width: 96%;\r\n height: 1.5rem;\r\n margin-bottom: 1.5rem;\r\n}\r\n.AuthWrapper-module_bar__1dafn.AuthWrapper-module_bar__1dafn:nth-child(4n) {\r\n width: 72%;\r\n height: 1.5rem;\r\n margin-bottom: 0.25rem;\r\n}\r\n.AuthWrapper-module_bar__1dafn.AuthWrapper-module_bar__1dafn:nth-child(5n) {\r\n width: 88%;\r\n height: 1.5rem;\r\n margin-bottom: 0.25rem;\r\n}\r\n\r\n.AuthWrapper-module_iframe__2wDJW {\r\n margin-top: -3rem;\r\n border: none;\r\n width: 100%;\r\n height: 1900px;\r\n}";
|
|
1771
589
|
var styles = { "loginBox": "AuthWrapper-module_loginBox__3l-BE", "loginBox_title": "AuthWrapper-module_loginBox_title__12rGD", "bar": "AuthWrapper-module_bar__1dafn", "iframe": "AuthWrapper-module_iframe__2wDJW" };
|
|
1772
590
|
styleInject(css);
|
|
1773
591
|
|