@mjhls/mjh-framework 1.0.840-beta.1 → 1.0.840-seomanager-v1
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 +10 -9
- package/dist/cjs/AD300x250.js +31 -30
- package/dist/cjs/AD300x250x600.js +31 -30
- package/dist/cjs/AD728x90.js +34 -33
- package/dist/cjs/ADFloatingFooter.js +33 -32
- package/dist/cjs/ADFooter.js +15 -14
- package/dist/cjs/ADGutter.js +33 -32
- package/dist/cjs/{ADInfeed-8d621d3c.js → ADInfeed-859820d9.js} +15 -13
- package/dist/cjs/ADSkyscraper.js +33 -32
- package/dist/cjs/ADSponsoredResources.js +33 -32
- package/dist/cjs/ADWebcast.js +33 -32
- package/dist/cjs/ADWelcome.js +34 -33
- package/dist/cjs/{ADlgInfeed-0e26bccb.js → ADlgInfeed-da3a36a6.js} +11 -10
- package/dist/cjs/AccordionPanel.js +31 -29
- package/dist/cjs/AdSlot.js +36 -35
- package/dist/cjs/AdSlotsProvider.js +21 -916
- package/dist/cjs/AlgoliaSearch.js +1371 -1276
- package/dist/cjs/AlphabeticList.js +26 -25
- package/dist/cjs/ArticleCarousel.js +24 -23
- package/dist/cjs/ArticleProgramLandingPage.js +63 -62
- package/dist/cjs/ArticleSeriesLandingPage.js +43 -42
- package/dist/cjs/ArticleSeriesListing.js +62 -61
- package/dist/cjs/Auth.js +686 -462
- package/dist/cjs/AuthWrapper.js +1739 -423
- package/dist/cjs/{AuthorComponent-bb831b74.js → AuthorComponent-c21aac7f.js} +14 -13
- package/dist/cjs/Beam.js +8 -8
- package/dist/cjs/{BlockContent-091a991f.js → BlockContent-36e54d77.js} +56 -55
- package/dist/cjs/Breadcrumbs.js +29 -27
- package/dist/cjs/CMEDeck.js +83 -83
- package/dist/cjs/Column1.js +14 -11
- package/dist/cjs/Column2.js +36 -33
- package/dist/cjs/Column3.js +62 -59
- package/dist/cjs/ConferenceArticleCard.js +38 -37
- package/dist/cjs/ConferenceBanner-6c9e718a.js +24 -0
- package/dist/cjs/DeckContent.js +107 -103
- package/dist/cjs/DeckQueue.js +94 -90
- package/dist/cjs/{Dfp-26baccf1.js → Dfp-93399f8c.js} +35 -34
- package/dist/cjs/EventsDeck.js +159 -152
- package/dist/cjs/ExternalResources.js +81 -80
- package/dist/cjs/Feature.js +26 -24
- package/dist/cjs/ForbesHero.js +43 -42
- package/dist/cjs/GridContent.js +190 -304
- package/dist/cjs/GridHero.js +45 -44
- package/dist/cjs/GroupDeck.js +60 -59
- package/dist/cjs/HamMagazine.js +146 -141
- package/dist/cjs/Header.js +14 -12
- package/dist/cjs/Hero.js +13 -12
- package/dist/cjs/HighlightenVideo.js +18 -17
- package/dist/cjs/HorizontalArticleListing.js +73 -72
- package/dist/cjs/HorizontalHero.js +26 -25
- package/dist/cjs/IssueContentDeck.js +78 -73
- package/dist/cjs/IssueDeck.js +77 -72
- package/dist/cjs/IssueLanding.js +96 -95
- package/dist/cjs/KMTracker.js +15 -15
- package/dist/cjs/LeftNav.js +41 -39
- package/dist/cjs/MasterDeck.js +81 -80
- package/dist/cjs/MediaSeriesLanding.js +1232 -1141
- package/dist/cjs/NavDvm.js +79 -74
- package/dist/cjs/{NavFooter-76c913e3.js → NavFooter-3dcd99a8.js} +15 -14
- package/dist/cjs/NavMagazine.js +153 -148
- package/dist/cjs/NavNative.js +147 -139
- package/dist/cjs/OncliveHero.js +19 -19
- package/dist/cjs/OncliveLargeHero.js +73 -72
- package/dist/cjs/PageFilter.js +15 -14
- package/dist/cjs/PartnerDetailListing.js +125 -3957
- package/dist/cjs/PdfDownload.js +10 -9
- package/dist/cjs/PopUpModal.js +21 -19
- package/dist/cjs/PubSection.js +43 -42
- package/dist/cjs/PubToc.js +16 -15
- package/dist/cjs/PublicationDeck.js +67 -62
- package/dist/cjs/PublicationLanding.js +139 -135
- package/dist/cjs/QueueDeckExpanded.js +310 -310
- package/dist/cjs/RecentNews.js +23 -22
- package/dist/cjs/RelatedContent.js +55 -54
- package/dist/cjs/RelatedTopicsDropdown.js +32 -29
- package/dist/cjs/RolesDeck.js +32 -27
- package/dist/cjs/Search.js +22 -18
- package/dist/cjs/Segment.js +6 -6
- package/dist/cjs/SeriesListingDeck.js +38 -38
- package/dist/cjs/{SeriesSlider-8bbc989f.js → SeriesSlider-34c6cc2b.js} +40 -39
- package/dist/cjs/SetCookie.js +1 -1
- package/dist/cjs/SideFooter.js +39 -38
- package/dist/cjs/SocialIcons.js +10 -9
- package/dist/cjs/{SocialSearchComponent-cea213aa.js → SocialSearchComponent-948138c7.js} +40 -36
- package/dist/cjs/SocialShare.js +31 -29
- package/dist/cjs/TaxonomyCard.js +64 -59
- package/dist/cjs/TaxonomyDescription.js +56 -55
- package/dist/cjs/TemplateNormal.js +75 -74
- package/dist/cjs/ThumbnailCard.js +23 -21
- package/dist/cjs/Ustream.js +31 -30
- package/dist/cjs/VerticalHero.js +17 -16
- package/dist/cjs/VideoProgramLandingPage.js +80 -76
- package/dist/cjs/VideoSeriesCard.js +33 -32
- package/dist/cjs/VideoSeriesFilter.js +18 -18
- package/dist/cjs/VideoSeriesLandingPage.js +52 -51
- package/dist/cjs/VideoSeriesListing.js +81 -82
- package/dist/cjs/View.js +310 -265
- package/dist/cjs/YahooHero.js +42 -41
- package/dist/cjs/YoutubeGroup.js +67 -66
- package/dist/cjs/{_is-array-754e012d.js → _is-array-6128bd56.js} +6 -6
- package/dist/cjs/{_iter-detect-60b2f026.js → _iter-detect-55a5657a.js} +8 -8
- package/dist/cjs/{_object-pie-68c5bcbc.js → _object-pie-083f2dd6.js} +4 -4
- package/dist/cjs/{_object-sap-5e74ba08.js → _object-sap-a175b4a9.js} +1 -1
- package/dist/cjs/{_object-to-array-5762f850.js → _object-to-array-8fe5a54f.js} +2 -2
- package/dist/cjs/{_to-object-329a650b.js → _to-object-6de10e57.js} +8 -8
- package/dist/cjs/{asyncToGenerator-140e5f89.js → asyncToGenerator-58c289d9.js} +32 -32
- package/dist/cjs/{brightcove-react-player-loader.es-156bd4d6.js → brightcove-react-player-loader.es-a195642e.js} +11 -9
- package/dist/cjs/{core.get-iterator-method-f62321d4.js → core.get-iterator-method-f474eacc.js} +2 -2
- package/dist/cjs/{debounce-529c8d06.js → debounce-d4a2369b.js} +2 -2
- package/dist/cjs/{define-property-f4d12f4e.js → define-property-c88be878.js} +6 -6
- package/dist/cjs/{defineProperty-55548b25.js → defineProperty-0cb76d99.js} +1 -1
- package/dist/cjs/{entities-310b46ee.js → entities-3f9d0f2f.js} +1 -1
- package/dist/cjs/{eq-bb2843ed.js → eq-5fc26c07.js} +1 -1
- package/dist/cjs/{es6.string.iterator-cc0bbaa4.js → es6.string.iterator-c2573ffd.js} +6 -6
- package/dist/cjs/{extends-0a918631.js → extends-29bdbc6d.js} +7 -7
- package/dist/cjs/faundadb.js +21 -21
- package/dist/cjs/{get-adbb11e3.js → get-5839e5b5.js} +21 -21
- package/dist/cjs/getRelatedArticle.js +20 -20
- package/dist/cjs/getRootDocGroup.js +8 -8
- package/dist/cjs/getSerializers.js +45 -45
- package/dist/cjs/{getTargeting-021d644c.js → getTargeting-be6168ad.js} +12 -12
- package/dist/cjs/getTargeting.js +8 -8
- package/dist/{esm/iconBase-602d52fe.js → cjs/iconBase-be4097c0.js} +33 -8
- package/dist/cjs/{index-1d6b1687.js → index-060c5d65.js} +997 -1025
- package/dist/cjs/{index-e2e62963.js → index-50be6759.js} +26 -10
- package/dist/cjs/{index-96b3db50.js → index-eadd5035.js} +17 -15
- package/dist/cjs/{index-be0c82be.js → index-efca863c.js} +36 -30
- package/dist/cjs/{index-3294d3bc.js → index-f86bb269.js} +44 -45
- package/dist/cjs/{index-98e01cb9.js → index-fc2f1ca2.js} +13 -12
- package/dist/cjs/{index.es-9110add6.js → index.es-f3e47207.js} +31 -12
- package/dist/cjs/{index.esm-90433435.js → index.esm-00a6aade.js} +7 -16
- package/dist/cjs/{index.esm-4d410430.js → index.esm-2bb721c8.js} +21 -21
- package/dist/cjs/{index.esm-e32d3e8e.js → index.esm-c1e16606.js} +4 -7
- package/dist/cjs/{index.esm-ff47db6f.js → index.esm-f27f80d9.js} +6 -13
- package/dist/cjs/index.js +169 -164
- package/dist/cjs/{inherits-1f5a1c72.js → inherits-c2065b95.js} +20 -20
- package/dist/cjs/{isSymbol-04666465.js → isSymbol-03abbdf0.js} +15 -15
- package/dist/cjs/keys-7f2c2108.js +25 -0
- package/dist/cjs/{lodash-fc2922d0.js → lodash-f0783643.js} +128 -31
- package/dist/cjs/main-f1c77adb.js +973 -0
- package/dist/cjs/{md5-5039b1a6.js → md5-e1ca5797.js} +1 -1
- package/dist/cjs/{moment-575fe24c.js → moment-aca40de1.js} +11 -9
- package/dist/cjs/{react-social-icons-f7f48f71.js → react-social-icons-af932527.js} +28 -27
- package/dist/cjs/{slicedToArray-8f385299.js → slicedToArray-5d1bc3b3.js} +14 -14
- package/dist/cjs/{smoothscroll-5054361f.js → smoothscroll-99df7f93.js} +1 -1
- package/dist/cjs/stringify-c9ac1214.js +17 -0
- package/dist/cjs/timeDifferenceCalc.js +1 -1
- package/dist/cjs/{toConsumableArray-9a3476fe.js → toConsumableArray-ddb70795.js} +9 -9
- package/dist/cjs/{toNumber-36d1e7e5.js → toNumber-5e1fac58.js} +40 -5
- package/dist/cjs/typeof-1358762e.js +33 -0
- package/dist/cjs/{typeof-725500bc.js → typeof-88a668c5.js} +36 -36
- package/dist/cjs/urlFor.js +3 -3
- package/dist/cjs/{ustream-api-d092dc31.js → ustream-api-b2b9092f.js} +4 -4
- package/dist/cjs/{util-f2c1b65b.js → util-6f784d85.js} +1 -1
- package/dist/cjs/{visibility-sensor-ad5e3116.js → visibility-sensor-eb2c5b69.js} +7 -5
- package/dist/cjs/{web.dom.iterable-a0e279c1.js → web.dom.iterable-46657b5c.js} +3 -3
- package/dist/esm/AD.js +1 -1
- package/dist/esm/AD300x250.js +24 -24
- package/dist/esm/AD300x250x600.js +24 -24
- package/dist/esm/AD728x90.js +27 -27
- package/dist/esm/ADFloatingFooter.js +23 -23
- package/dist/esm/ADFooter.js +6 -6
- package/dist/esm/ADGutter.js +23 -23
- package/dist/esm/{ADInfeed-b566ce41.js → ADInfeed-4bf3b2f9.js} +6 -6
- package/dist/esm/ADSkyscraper.js +23 -23
- package/dist/esm/ADSponsoredResources.js +23 -23
- package/dist/esm/ADWebcast.js +23 -23
- package/dist/esm/ADWelcome.js +20 -20
- package/dist/esm/{ADlgInfeed-5eb7281d.js → ADlgInfeed-a3377c4a.js} +4 -4
- package/dist/esm/AccordionPanel.js +8 -8
- package/dist/esm/AdSlot.js +24 -24
- package/dist/esm/AdSlotsProvider.js +17 -913
- package/dist/esm/AlgoliaSearch.js +599 -505
- package/dist/esm/AlphabeticList.js +10 -10
- package/dist/esm/ArticleCarousel.js +17 -17
- package/dist/esm/ArticleProgramLandingPage.js +50 -50
- package/dist/esm/ArticleSeriesLandingPage.js +32 -32
- package/dist/esm/ArticleSeriesListing.js +34 -34
- package/dist/esm/Auth.js +595 -375
- package/dist/esm/AuthWrapper.js +1711 -396
- package/dist/esm/{AuthorComponent-34b16174.js → AuthorComponent-30aeba69.js} +1 -1
- package/dist/esm/Beam.js +8 -8
- package/dist/esm/{BlockContent-e9b4ddcf.js → BlockContent-c99c9a8d.js} +34 -34
- package/dist/esm/Breadcrumbs.js +7 -7
- package/dist/esm/CMEDeck.js +24 -24
- package/dist/esm/Column1.js +4 -4
- package/dist/esm/Column2.js +21 -21
- package/dist/esm/Column3.js +39 -39
- package/dist/esm/ConferenceArticleCard.js +22 -22
- package/dist/esm/DeckContent.js +57 -57
- package/dist/esm/DeckQueue.js +50 -50
- package/dist/esm/{Dfp-b7236041.js → Dfp-2c43d2a0.js} +15 -15
- package/dist/esm/EventsDeck.js +67 -67
- package/dist/esm/ExternalResources.js +48 -48
- package/dist/esm/Feature.js +4 -4
- package/dist/esm/ForbesHero.js +12 -12
- package/dist/esm/GridContent.js +82 -200
- package/dist/esm/GridHero.js +13 -13
- package/dist/esm/GroupDeck.js +14 -14
- package/dist/esm/HamMagazine.js +39 -39
- package/dist/esm/Hero.js +4 -4
- package/dist/esm/HighlightenVideo.js +2 -2
- package/dist/esm/HorizontalArticleListing.js +47 -47
- package/dist/esm/HorizontalHero.js +5 -5
- package/dist/esm/IssueContentDeck.js +27 -27
- package/dist/esm/IssueDeck.js +37 -37
- package/dist/esm/IssueLanding.js +84 -84
- package/dist/esm/KMTracker.js +15 -15
- package/dist/esm/LeftNav.js +22 -22
- package/dist/esm/MasterDeck.js +45 -45
- package/dist/esm/MediaSeriesLanding.js +751 -663
- package/dist/esm/NavDvm.js +16 -16
- package/dist/esm/NavMagazine.js +44 -44
- package/dist/esm/NavNative.js +43 -43
- package/dist/esm/OncliveHero.js +4 -5
- package/dist/esm/OncliveLargeHero.js +13 -13
- package/dist/esm/PageFilter.js +6 -6
- package/dist/esm/PartnerDetailListing.js +75 -3907
- package/dist/esm/PdfDownload.js +2 -2
- package/dist/esm/PopUpModal.js +6 -6
- package/dist/esm/PubSection.js +34 -34
- package/dist/esm/PubToc.js +8 -8
- package/dist/esm/PublicationDeck.js +24 -24
- package/dist/esm/PublicationLanding.js +76 -76
- package/dist/esm/QueueDeckExpanded.js +38 -38
- package/dist/esm/RecentNews.js +4 -4
- package/dist/esm/RelatedContent.js +35 -35
- package/dist/esm/RelatedTopicsDropdown.js +10 -10
- package/dist/esm/RolesDeck.js +12 -12
- package/dist/esm/Search.js +8 -8
- package/dist/esm/Segment.js +6 -6
- package/dist/esm/SeriesListingDeck.js +20 -20
- package/dist/esm/{SeriesSlider-a866bb21.js → SeriesSlider-5d5c08f4.js} +14 -14
- package/dist/esm/SetCookie.js +1 -1
- package/dist/esm/SideFooter.js +17 -17
- package/dist/esm/{SocialSearchComponent-03c3e869.js → SocialSearchComponent-db963c3e.js} +12 -12
- package/dist/esm/TaxonomyCard.js +25 -25
- package/dist/esm/TaxonomyDescription.js +46 -46
- package/dist/esm/TemplateNormal.js +50 -50
- package/dist/esm/ThumbnailCard.js +7 -7
- package/dist/esm/Ustream.js +14 -14
- package/dist/esm/VerticalHero.js +3 -3
- package/dist/esm/VideoProgramLandingPage.js +54 -54
- package/dist/esm/VideoSeriesCard.js +14 -14
- package/dist/esm/VideoSeriesFilter.js +9 -9
- package/dist/esm/VideoSeriesLandingPage.js +38 -38
- package/dist/esm/VideoSeriesListing.js +37 -39
- package/dist/esm/View.js +140 -99
- package/dist/esm/YahooHero.js +15 -15
- package/dist/esm/YoutubeGroup.js +26 -26
- package/dist/esm/{_is-array-58e95429.js → _is-array-3e99e06e.js} +6 -6
- package/dist/esm/{_iter-detect-5d49a330.js → _iter-detect-7e5e5ce2.js} +8 -8
- package/dist/esm/{_object-pie-33c40e79.js → _object-pie-133f504a.js} +4 -4
- package/dist/esm/{_object-sap-964b6feb.js → _object-sap-f353c2a9.js} +1 -1
- package/dist/esm/{_object-to-array-7e804fce.js → _object-to-array-0f197f89.js} +2 -2
- package/dist/esm/{_to-object-a4107da3.js → _to-object-b50e61c3.js} +9 -9
- package/dist/esm/{asyncToGenerator-fc1c2e29.js → asyncToGenerator-7f8f9219.js} +32 -32
- package/dist/esm/{brightcove-react-player-loader.es-83f53e4e.js → brightcove-react-player-loader.es-57a70a56.js} +5 -4
- package/dist/esm/{core.get-iterator-method-e1de7503.js → core.get-iterator-method-133dfacd.js} +2 -2
- package/dist/esm/{debounce-9207d8ee.js → debounce-533d9748.js} +2 -2
- package/dist/esm/{define-property-8af5f002.js → define-property-fe54dc9f.js} +6 -6
- package/dist/esm/{defineProperty-94fd8bfc.js → defineProperty-f5ff6f5a.js} +1 -1
- package/dist/esm/{entities-7cc3bf45.js → entities-932b50cf.js} +1 -1
- package/dist/esm/{eq-b470f743.js → eq-bdcbf886.js} +1 -1
- package/dist/esm/{es6.string.iterator-c990c18c.js → es6.string.iterator-bc33758b.js} +7 -7
- package/dist/esm/{extends-6f2fcc99.js → extends-60e0e1c6.js} +7 -7
- package/dist/esm/faundadb.js +7 -7
- package/dist/esm/{get-1e515072.js → get-3c308da4.js} +21 -21
- package/dist/esm/getRelatedArticle.js +14 -14
- package/dist/esm/getRootDocGroup.js +6 -6
- package/dist/esm/getSerializers.js +45 -45
- package/dist/esm/{getTargeting-82e86707.js → getTargeting-68291ce9.js} +11 -11
- package/dist/esm/getTargeting.js +8 -8
- package/dist/{cjs/iconBase-68959171.js → esm/iconBase-ccc56b97.js} +2 -8
- package/dist/esm/{index-44f4646f.js → index-01d53c17.js} +639 -674
- package/dist/esm/{index-73819142.js → index-0dbff1d1.js} +36 -30
- package/dist/esm/{index-5f7e79e7.js → index-755f2cc2.js} +6 -6
- package/dist/esm/{index-ef6d5dcf.js → index-79cfd25c.js} +44 -45
- package/dist/esm/{index-aaa2dae0.js → index-98ca9cec.js} +26 -11
- package/dist/esm/{index-41a678ea.js → index-f0fc23eb.js} +4 -4
- package/dist/esm/{index.es-29c1cef5.js → index.es-a6137319.js} +23 -5
- package/dist/esm/{index.esm-fd746768.js → index.esm-37268dca.js} +4 -5
- package/dist/esm/{index.esm-f8aaeeeb.js → index.esm-9b042655.js} +4 -7
- package/dist/esm/{index.esm-cf08bf18.js → index.esm-d4932dea.js} +6 -13
- package/dist/esm/{index.esm-29e48d38.js → index.esm-f6156a57.js} +7 -16
- package/dist/esm/index.js +124 -122
- package/dist/esm/{inherits-cf8dde54.js → inherits-a41fe93f.js} +19 -19
- package/dist/esm/{isSymbol-1981418f.js → isSymbol-a7e9aafe.js} +15 -15
- package/dist/esm/{keys-8eda7a5c.js → keys-7a3adabf.js} +6 -6
- package/dist/esm/{lodash-17fdfebb.js → lodash-f97fd99a.js} +128 -31
- package/dist/esm/main-d4165069.js +961 -0
- package/dist/esm/{md5-9be0e905.js → md5-4e42248e.js} +1 -1
- package/dist/esm/{moment-e2f9b20c.js → moment-bc12cb97.js} +11 -9
- package/dist/esm/{react-social-icons-a7d5c5c7.js → react-social-icons-9be47857.js} +16 -16
- package/dist/esm/{slicedToArray-641f241f.js → slicedToArray-be2f7a22.js} +14 -14
- package/dist/esm/{smoothscroll-0cd4c7a6.js → smoothscroll-fa4e3f8c.js} +1 -1
- package/dist/esm/stringify-59c8f690.js +15 -0
- package/dist/esm/timeDifferenceCalc.js +1 -1
- package/dist/esm/{toConsumableArray-43aa614d.js → toConsumableArray-6d9a4616.js} +9 -9
- package/dist/esm/{toNumber-2f7a84cd.js → toNumber-5aeba6e7.js} +40 -5
- package/dist/esm/typeof-2f07d0e8.js +30 -0
- package/dist/esm/{typeof-6435ba1c.js → typeof-a286cf0c.js} +36 -36
- package/dist/esm/urlFor.js +1 -1
- package/dist/esm/{ustream-api-9a50644d.js → ustream-api-33a866b6.js} +4 -4
- package/dist/esm/{util-7700fc59.js → util-3ab476bf.js} +1 -1
- package/dist/esm/{web.dom.iterable-4439f05a.js → web.dom.iterable-4109ff68.js} +3 -3
- package/package.json +110 -111
- package/dist/cjs/ConferenceBanner-4a16fddc.js +0 -23
- package/dist/cjs/inherits-8d29278d.js +0 -110
- package/dist/cjs/keys-a586b7a0.js +0 -25
- package/dist/cjs/main-02daeefe.js +0 -862
- package/dist/cjs/stringify-7c5aff47.js +0 -17
- package/dist/esm/inherits-77d5e4fc.js +0 -101
- package/dist/esm/main-e4a934b2.js +0 -851
- package/dist/esm/stringify-4330ccdc.js +0 -15
package/dist/cjs/AuthWrapper.js
CHANGED
|
@@ -1,59 +1,1100 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
var slicedToArray$1 = require('./slicedToArray-5d1bc3b3.js');
|
|
5
4
|
var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
|
|
6
|
-
require('./
|
|
7
|
-
require('./es6.string.iterator-cc0bbaa4.js');
|
|
8
|
-
require('./core.get-iterator-method-f62321d4.js');
|
|
9
|
-
require('./web.dom.iterable-a0e279c1.js');
|
|
5
|
+
var _typeof = require('./typeof-1358762e.js');
|
|
10
6
|
var React = require('react');
|
|
11
|
-
var React__default = _interopDefault(React);
|
|
12
|
-
var slicedToArray = require('./slicedToArray-8f385299.js');
|
|
13
7
|
var reactBootstrap = require('react-bootstrap');
|
|
14
8
|
var styleInject_es = require('./style-inject.es-dcee06b6.js');
|
|
9
|
+
require('./web.dom.iterable-46657b5c.js');
|
|
10
|
+
require('./es6.string.iterator-c2573ffd.js');
|
|
11
|
+
require('./_to-object-6de10e57.js');
|
|
12
|
+
require('./core.get-iterator-method-f474eacc.js');
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
17
|
+
|
|
18
|
+
var interopRequireWildcard = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
19
|
+
var _typeof$1 = _typeof._typeof_1["default"];
|
|
20
|
+
|
|
21
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
22
|
+
if (typeof WeakMap !== "function") return null;
|
|
23
|
+
var cacheBabelInterop = new WeakMap();
|
|
24
|
+
var cacheNodeInterop = new WeakMap();
|
|
25
|
+
return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {
|
|
26
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
27
|
+
})(nodeInterop);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
31
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
32
|
+
return obj;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (obj === null || _typeof$1(obj) !== "object" && typeof obj !== "function") {
|
|
36
|
+
return {
|
|
37
|
+
"default": obj
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
42
|
+
|
|
43
|
+
if (cache && cache.has(obj)) {
|
|
44
|
+
return cache.get(obj);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
var newObj = {};
|
|
48
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
49
|
+
|
|
50
|
+
for (var key in obj) {
|
|
51
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
52
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
53
|
+
|
|
54
|
+
if (desc && (desc.get || desc.set)) {
|
|
55
|
+
Object.defineProperty(newObj, key, desc);
|
|
56
|
+
} else {
|
|
57
|
+
newObj[key] = obj[key];
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
newObj["default"] = obj;
|
|
63
|
+
|
|
64
|
+
if (cache) {
|
|
65
|
+
cache.set(obj, newObj);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return newObj;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
module.exports = _interopRequireWildcard;
|
|
72
|
+
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
20
73
|
});
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
74
|
+
|
|
75
|
+
_commonjsHelpers.unwrapExports(interopRequireWildcard);
|
|
76
|
+
|
|
77
|
+
var interopRequireDefault = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
78
|
+
function _interopRequireDefault(obj) {
|
|
79
|
+
return obj && obj.__esModule ? obj : {
|
|
80
|
+
"default": obj
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
module.exports = _interopRequireDefault;
|
|
85
|
+
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
_commonjsHelpers.unwrapExports(interopRequireDefault);
|
|
89
|
+
|
|
90
|
+
var runtime_1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
91
|
+
/**
|
|
92
|
+
* Copyright (c) 2014-present, Facebook, Inc.
|
|
93
|
+
*
|
|
94
|
+
* This source code is licensed under the MIT license found in the
|
|
95
|
+
* LICENSE file in the root directory of this source tree.
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
var runtime = (function (exports) {
|
|
99
|
+
|
|
100
|
+
var Op = Object.prototype;
|
|
101
|
+
var hasOwn = Op.hasOwnProperty;
|
|
102
|
+
var undefined$1; // More compressible than void 0.
|
|
103
|
+
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
|
104
|
+
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
|
105
|
+
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
|
106
|
+
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
107
|
+
|
|
108
|
+
function define(obj, key, value) {
|
|
109
|
+
Object.defineProperty(obj, key, {
|
|
110
|
+
value: value,
|
|
111
|
+
enumerable: true,
|
|
112
|
+
configurable: true,
|
|
113
|
+
writable: true
|
|
114
|
+
});
|
|
115
|
+
return obj[key];
|
|
116
|
+
}
|
|
117
|
+
try {
|
|
118
|
+
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
119
|
+
define({}, "");
|
|
120
|
+
} catch (err) {
|
|
121
|
+
define = function(obj, key, value) {
|
|
122
|
+
return obj[key] = value;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
127
|
+
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
|
128
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
|
129
|
+
var generator = Object.create(protoGenerator.prototype);
|
|
130
|
+
var context = new Context(tryLocsList || []);
|
|
131
|
+
|
|
132
|
+
// The ._invoke method unifies the implementations of the .next,
|
|
133
|
+
// .throw, and .return methods.
|
|
134
|
+
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
135
|
+
|
|
136
|
+
return generator;
|
|
137
|
+
}
|
|
138
|
+
exports.wrap = wrap;
|
|
139
|
+
|
|
140
|
+
// Try/catch helper to minimize deoptimizations. Returns a completion
|
|
141
|
+
// record like context.tryEntries[i].completion. This interface could
|
|
142
|
+
// have been (and was previously) designed to take a closure to be
|
|
143
|
+
// invoked without arguments, but in all the cases we care about we
|
|
144
|
+
// already have an existing method we want to call, so there's no need
|
|
145
|
+
// to create a new function object. We can even get away with assuming
|
|
146
|
+
// the method takes exactly one argument, since that happens to be true
|
|
147
|
+
// in every case, so we don't have to touch the arguments object. The
|
|
148
|
+
// only additional allocation required is the completion record, which
|
|
149
|
+
// has a stable shape and so hopefully should be cheap to allocate.
|
|
150
|
+
function tryCatch(fn, obj, arg) {
|
|
151
|
+
try {
|
|
152
|
+
return { type: "normal", arg: fn.call(obj, arg) };
|
|
153
|
+
} catch (err) {
|
|
154
|
+
return { type: "throw", arg: err };
|
|
26
155
|
}
|
|
156
|
+
}
|
|
27
157
|
|
|
28
|
-
|
|
29
|
-
|
|
158
|
+
var GenStateSuspendedStart = "suspendedStart";
|
|
159
|
+
var GenStateSuspendedYield = "suspendedYield";
|
|
160
|
+
var GenStateExecuting = "executing";
|
|
161
|
+
var GenStateCompleted = "completed";
|
|
162
|
+
|
|
163
|
+
// Returning this object from the innerFn has the same effect as
|
|
164
|
+
// breaking out of the dispatch switch statement.
|
|
165
|
+
var ContinueSentinel = {};
|
|
166
|
+
|
|
167
|
+
// Dummy constructor functions that we use as the .constructor and
|
|
168
|
+
// .constructor.prototype properties for functions that return Generator
|
|
169
|
+
// objects. For full spec compliance, you may wish to configure your
|
|
170
|
+
// minifier not to mangle the names of these two functions.
|
|
171
|
+
function Generator() {}
|
|
172
|
+
function GeneratorFunction() {}
|
|
173
|
+
function GeneratorFunctionPrototype() {}
|
|
174
|
+
|
|
175
|
+
// This is a polyfill for %IteratorPrototype% for environments that
|
|
176
|
+
// don't natively support it.
|
|
177
|
+
var IteratorPrototype = {};
|
|
178
|
+
IteratorPrototype[iteratorSymbol] = function () {
|
|
179
|
+
return this;
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
var getProto = Object.getPrototypeOf;
|
|
183
|
+
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
184
|
+
if (NativeIteratorPrototype &&
|
|
185
|
+
NativeIteratorPrototype !== Op &&
|
|
186
|
+
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
|
187
|
+
// This environment has a native %IteratorPrototype%; use it instead
|
|
188
|
+
// of the polyfill.
|
|
189
|
+
IteratorPrototype = NativeIteratorPrototype;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
var Gp = GeneratorFunctionPrototype.prototype =
|
|
193
|
+
Generator.prototype = Object.create(IteratorPrototype);
|
|
194
|
+
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
|
195
|
+
GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
|
196
|
+
GeneratorFunction.displayName = define(
|
|
197
|
+
GeneratorFunctionPrototype,
|
|
198
|
+
toStringTagSymbol,
|
|
199
|
+
"GeneratorFunction"
|
|
200
|
+
);
|
|
201
|
+
|
|
202
|
+
// Helper for defining the .next, .throw, and .return methods of the
|
|
203
|
+
// Iterator interface in terms of a single ._invoke method.
|
|
204
|
+
function defineIteratorMethods(prototype) {
|
|
205
|
+
["next", "throw", "return"].forEach(function(method) {
|
|
206
|
+
define(prototype, method, function(arg) {
|
|
207
|
+
return this._invoke(method, arg);
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
}
|
|
30
211
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
212
|
+
exports.isGeneratorFunction = function(genFun) {
|
|
213
|
+
var ctor = typeof genFun === "function" && genFun.constructor;
|
|
214
|
+
return ctor
|
|
215
|
+
? ctor === GeneratorFunction ||
|
|
216
|
+
// For the native GeneratorFunction constructor, the best we can
|
|
217
|
+
// do is to check its .name property.
|
|
218
|
+
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
|
219
|
+
: false;
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
exports.mark = function(genFun) {
|
|
223
|
+
if (Object.setPrototypeOf) {
|
|
224
|
+
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
|
225
|
+
} else {
|
|
226
|
+
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
227
|
+
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
|
34
228
|
}
|
|
229
|
+
genFun.prototype = Object.create(Gp);
|
|
230
|
+
return genFun;
|
|
231
|
+
};
|
|
35
232
|
|
|
36
|
-
|
|
37
|
-
|
|
233
|
+
// Within the body of any async function, `await x` is transformed to
|
|
234
|
+
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
|
235
|
+
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
|
236
|
+
// meant to be awaited.
|
|
237
|
+
exports.awrap = function(arg) {
|
|
238
|
+
return { __await: arg };
|
|
239
|
+
};
|
|
38
240
|
|
|
39
|
-
|
|
40
|
-
|
|
241
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
242
|
+
function invoke(method, arg, resolve, reject) {
|
|
243
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
244
|
+
if (record.type === "throw") {
|
|
245
|
+
reject(record.arg);
|
|
246
|
+
} else {
|
|
247
|
+
var result = record.arg;
|
|
248
|
+
var value = result.value;
|
|
249
|
+
if (value &&
|
|
250
|
+
typeof value === "object" &&
|
|
251
|
+
hasOwn.call(value, "__await")) {
|
|
252
|
+
return PromiseImpl.resolve(value.__await).then(function(value) {
|
|
253
|
+
invoke("next", value, resolve, reject);
|
|
254
|
+
}, function(err) {
|
|
255
|
+
invoke("throw", err, resolve, reject);
|
|
256
|
+
});
|
|
257
|
+
}
|
|
41
258
|
|
|
42
|
-
|
|
259
|
+
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
|
260
|
+
// When a yielded Promise is resolved, its final value becomes
|
|
261
|
+
// the .value of the Promise<{value,done}> result for the
|
|
262
|
+
// current iteration.
|
|
263
|
+
result.value = unwrapped;
|
|
264
|
+
resolve(result);
|
|
265
|
+
}, function(error) {
|
|
266
|
+
// If a rejected Promise was yielded, throw the rejection back
|
|
267
|
+
// into the async generator function so it can be handled there.
|
|
268
|
+
return invoke("throw", error, resolve, reject);
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
var previousPromise;
|
|
274
|
+
|
|
275
|
+
function enqueue(method, arg) {
|
|
276
|
+
function callInvokeWithMethodAndArg() {
|
|
277
|
+
return new PromiseImpl(function(resolve, reject) {
|
|
278
|
+
invoke(method, arg, resolve, reject);
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
return previousPromise =
|
|
283
|
+
// If enqueue has been called before, then we want to wait until
|
|
284
|
+
// all previous Promises have been resolved before calling invoke,
|
|
285
|
+
// so that results are always delivered in the correct order. If
|
|
286
|
+
// enqueue has not been called before, then it is important to
|
|
287
|
+
// call invoke immediately, without waiting on a callback to fire,
|
|
288
|
+
// so that the async generator function has the opportunity to do
|
|
289
|
+
// any necessary setup in a predictable way. This predictability
|
|
290
|
+
// is why the Promise constructor synchronously invokes its
|
|
291
|
+
// executor callback, and why async functions synchronously
|
|
292
|
+
// execute code before the first await. Since we implement simple
|
|
293
|
+
// async functions in terms of async generators, it is especially
|
|
294
|
+
// important to get this right, even though it requires care.
|
|
295
|
+
previousPromise ? previousPromise.then(
|
|
296
|
+
callInvokeWithMethodAndArg,
|
|
297
|
+
// Avoid propagating failures to Promises returned by later
|
|
298
|
+
// invocations of the iterator.
|
|
299
|
+
callInvokeWithMethodAndArg
|
|
300
|
+
) : callInvokeWithMethodAndArg();
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// Define the unified helper method that is used to implement .next,
|
|
304
|
+
// .throw, and .return (see defineIteratorMethods).
|
|
305
|
+
this._invoke = enqueue;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
defineIteratorMethods(AsyncIterator.prototype);
|
|
309
|
+
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
|
310
|
+
return this;
|
|
311
|
+
};
|
|
312
|
+
exports.AsyncIterator = AsyncIterator;
|
|
313
|
+
|
|
314
|
+
// Note that simple async functions are implemented on top of
|
|
315
|
+
// AsyncIterator objects; they just return a Promise for the value of
|
|
316
|
+
// the final result produced by the iterator.
|
|
317
|
+
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
318
|
+
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
319
|
+
|
|
320
|
+
var iter = new AsyncIterator(
|
|
321
|
+
wrap(innerFn, outerFn, self, tryLocsList),
|
|
322
|
+
PromiseImpl
|
|
323
|
+
);
|
|
324
|
+
|
|
325
|
+
return exports.isGeneratorFunction(outerFn)
|
|
326
|
+
? iter // If outerFn is a generator, return the full iterator.
|
|
327
|
+
: iter.next().then(function(result) {
|
|
328
|
+
return result.done ? result.value : iter.next();
|
|
329
|
+
});
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
function makeInvokeMethod(innerFn, self, context) {
|
|
333
|
+
var state = GenStateSuspendedStart;
|
|
334
|
+
|
|
335
|
+
return function invoke(method, arg) {
|
|
336
|
+
if (state === GenStateExecuting) {
|
|
337
|
+
throw new Error("Generator is already running");
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
if (state === GenStateCompleted) {
|
|
341
|
+
if (method === "throw") {
|
|
342
|
+
throw arg;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// Be forgiving, per 25.3.3.3.3 of the spec:
|
|
346
|
+
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
347
|
+
return doneResult();
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
context.method = method;
|
|
351
|
+
context.arg = arg;
|
|
352
|
+
|
|
353
|
+
while (true) {
|
|
354
|
+
var delegate = context.delegate;
|
|
355
|
+
if (delegate) {
|
|
356
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
357
|
+
if (delegateResult) {
|
|
358
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
359
|
+
return delegateResult;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
if (context.method === "next") {
|
|
364
|
+
// Setting context._sent for legacy support of Babel's
|
|
365
|
+
// function.sent implementation.
|
|
366
|
+
context.sent = context._sent = context.arg;
|
|
367
|
+
|
|
368
|
+
} else if (context.method === "throw") {
|
|
369
|
+
if (state === GenStateSuspendedStart) {
|
|
370
|
+
state = GenStateCompleted;
|
|
371
|
+
throw context.arg;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
context.dispatchException(context.arg);
|
|
375
|
+
|
|
376
|
+
} else if (context.method === "return") {
|
|
377
|
+
context.abrupt("return", context.arg);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
state = GenStateExecuting;
|
|
381
|
+
|
|
382
|
+
var record = tryCatch(innerFn, self, context);
|
|
383
|
+
if (record.type === "normal") {
|
|
384
|
+
// If an exception is thrown from innerFn, we leave state ===
|
|
385
|
+
// GenStateExecuting and loop back for another invocation.
|
|
386
|
+
state = context.done
|
|
387
|
+
? GenStateCompleted
|
|
388
|
+
: GenStateSuspendedYield;
|
|
389
|
+
|
|
390
|
+
if (record.arg === ContinueSentinel) {
|
|
391
|
+
continue;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
return {
|
|
395
|
+
value: record.arg,
|
|
396
|
+
done: context.done
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
} else if (record.type === "throw") {
|
|
400
|
+
state = GenStateCompleted;
|
|
401
|
+
// Dispatch the exception by looping back around to the
|
|
402
|
+
// context.dispatchException(context.arg) call above.
|
|
403
|
+
context.method = "throw";
|
|
404
|
+
context.arg = record.arg;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// Call delegate.iterator[context.method](context.arg) and handle the
|
|
411
|
+
// result, either by returning a { value, done } result from the
|
|
412
|
+
// delegate iterator, or by modifying context.method and context.arg,
|
|
413
|
+
// setting context.delegate to null, and returning the ContinueSentinel.
|
|
414
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
415
|
+
var method = delegate.iterator[context.method];
|
|
416
|
+
if (method === undefined$1) {
|
|
417
|
+
// A .throw or .return when the delegate iterator has no .throw
|
|
418
|
+
// method always terminates the yield* loop.
|
|
419
|
+
context.delegate = null;
|
|
420
|
+
|
|
421
|
+
if (context.method === "throw") {
|
|
422
|
+
// Note: ["return"] must be used for ES3 parsing compatibility.
|
|
423
|
+
if (delegate.iterator["return"]) {
|
|
424
|
+
// If the delegate iterator has a return method, give it a
|
|
425
|
+
// chance to clean up.
|
|
426
|
+
context.method = "return";
|
|
427
|
+
context.arg = undefined$1;
|
|
428
|
+
maybeInvokeDelegate(delegate, context);
|
|
429
|
+
|
|
430
|
+
if (context.method === "throw") {
|
|
431
|
+
// If maybeInvokeDelegate(context) changed context.method from
|
|
432
|
+
// "return" to "throw", let that override the TypeError below.
|
|
433
|
+
return ContinueSentinel;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
context.method = "throw";
|
|
438
|
+
context.arg = new TypeError(
|
|
439
|
+
"The iterator does not provide a 'throw' method");
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
return ContinueSentinel;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
446
|
+
|
|
447
|
+
if (record.type === "throw") {
|
|
448
|
+
context.method = "throw";
|
|
449
|
+
context.arg = record.arg;
|
|
450
|
+
context.delegate = null;
|
|
451
|
+
return ContinueSentinel;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
var info = record.arg;
|
|
455
|
+
|
|
456
|
+
if (! info) {
|
|
457
|
+
context.method = "throw";
|
|
458
|
+
context.arg = new TypeError("iterator result is not an object");
|
|
459
|
+
context.delegate = null;
|
|
460
|
+
return ContinueSentinel;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
if (info.done) {
|
|
464
|
+
// Assign the result of the finished delegate to the temporary
|
|
465
|
+
// variable specified by delegate.resultName (see delegateYield).
|
|
466
|
+
context[delegate.resultName] = info.value;
|
|
467
|
+
|
|
468
|
+
// Resume execution at the desired location (see delegateYield).
|
|
469
|
+
context.next = delegate.nextLoc;
|
|
470
|
+
|
|
471
|
+
// If context.method was "throw" but the delegate handled the
|
|
472
|
+
// exception, let the outer generator proceed normally. If
|
|
473
|
+
// context.method was "next", forget context.arg since it has been
|
|
474
|
+
// "consumed" by the delegate iterator. If context.method was
|
|
475
|
+
// "return", allow the original .return call to continue in the
|
|
476
|
+
// outer generator.
|
|
477
|
+
if (context.method !== "return") {
|
|
478
|
+
context.method = "next";
|
|
479
|
+
context.arg = undefined$1;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
} else {
|
|
483
|
+
// Re-yield the result returned by the delegate method.
|
|
484
|
+
return info;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// The delegate iterator is finished, so forget it and continue with
|
|
488
|
+
// the outer generator.
|
|
489
|
+
context.delegate = null;
|
|
490
|
+
return ContinueSentinel;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
// Define Generator.prototype.{next,throw,return} in terms of the
|
|
494
|
+
// unified ._invoke helper method.
|
|
495
|
+
defineIteratorMethods(Gp);
|
|
496
|
+
|
|
497
|
+
define(Gp, toStringTagSymbol, "Generator");
|
|
498
|
+
|
|
499
|
+
// A Generator should always return itself as the iterator object when the
|
|
500
|
+
// @@iterator function is called on it. Some browsers' implementations of the
|
|
501
|
+
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
502
|
+
// object to not be returned from this call. This ensures that doesn't happen.
|
|
503
|
+
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
504
|
+
Gp[iteratorSymbol] = function() {
|
|
505
|
+
return this;
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
Gp.toString = function() {
|
|
509
|
+
return "[object Generator]";
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
function pushTryEntry(locs) {
|
|
513
|
+
var entry = { tryLoc: locs[0] };
|
|
514
|
+
|
|
515
|
+
if (1 in locs) {
|
|
516
|
+
entry.catchLoc = locs[1];
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
if (2 in locs) {
|
|
520
|
+
entry.finallyLoc = locs[2];
|
|
521
|
+
entry.afterLoc = locs[3];
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
this.tryEntries.push(entry);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
function resetTryEntry(entry) {
|
|
528
|
+
var record = entry.completion || {};
|
|
529
|
+
record.type = "normal";
|
|
530
|
+
delete record.arg;
|
|
531
|
+
entry.completion = record;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
function Context(tryLocsList) {
|
|
535
|
+
// The root entry object (effectively a try statement without a catch
|
|
536
|
+
// or a finally block) gives us a place to store values thrown from
|
|
537
|
+
// locations where there is no enclosing try statement.
|
|
538
|
+
this.tryEntries = [{ tryLoc: "root" }];
|
|
539
|
+
tryLocsList.forEach(pushTryEntry, this);
|
|
540
|
+
this.reset(true);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
exports.keys = function(object) {
|
|
544
|
+
var keys = [];
|
|
545
|
+
for (var key in object) {
|
|
546
|
+
keys.push(key);
|
|
547
|
+
}
|
|
548
|
+
keys.reverse();
|
|
549
|
+
|
|
550
|
+
// Rather than returning an object with a next method, we keep
|
|
551
|
+
// things simple and return the next function itself.
|
|
552
|
+
return function next() {
|
|
553
|
+
while (keys.length) {
|
|
554
|
+
var key = keys.pop();
|
|
555
|
+
if (key in object) {
|
|
556
|
+
next.value = key;
|
|
557
|
+
next.done = false;
|
|
558
|
+
return next;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
// To avoid creating an additional object, we just hang the .value
|
|
563
|
+
// and .done properties off the next function object itself. This
|
|
564
|
+
// also ensures that the minifier will not anonymize the function.
|
|
565
|
+
next.done = true;
|
|
566
|
+
return next;
|
|
567
|
+
};
|
|
568
|
+
};
|
|
569
|
+
|
|
570
|
+
function values(iterable) {
|
|
571
|
+
if (iterable) {
|
|
572
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
573
|
+
if (iteratorMethod) {
|
|
574
|
+
return iteratorMethod.call(iterable);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
if (typeof iterable.next === "function") {
|
|
578
|
+
return iterable;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
if (!isNaN(iterable.length)) {
|
|
582
|
+
var i = -1, next = function next() {
|
|
583
|
+
while (++i < iterable.length) {
|
|
584
|
+
if (hasOwn.call(iterable, i)) {
|
|
585
|
+
next.value = iterable[i];
|
|
586
|
+
next.done = false;
|
|
587
|
+
return next;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
next.value = undefined$1;
|
|
592
|
+
next.done = true;
|
|
593
|
+
|
|
594
|
+
return next;
|
|
595
|
+
};
|
|
596
|
+
|
|
597
|
+
return next.next = next;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
// Return an iterator with no values.
|
|
602
|
+
return { next: doneResult };
|
|
603
|
+
}
|
|
604
|
+
exports.values = values;
|
|
605
|
+
|
|
606
|
+
function doneResult() {
|
|
607
|
+
return { value: undefined$1, done: true };
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
Context.prototype = {
|
|
611
|
+
constructor: Context,
|
|
612
|
+
|
|
613
|
+
reset: function(skipTempReset) {
|
|
614
|
+
this.prev = 0;
|
|
615
|
+
this.next = 0;
|
|
616
|
+
// Resetting context._sent for legacy support of Babel's
|
|
617
|
+
// function.sent implementation.
|
|
618
|
+
this.sent = this._sent = undefined$1;
|
|
619
|
+
this.done = false;
|
|
620
|
+
this.delegate = null;
|
|
621
|
+
|
|
622
|
+
this.method = "next";
|
|
623
|
+
this.arg = undefined$1;
|
|
624
|
+
|
|
625
|
+
this.tryEntries.forEach(resetTryEntry);
|
|
626
|
+
|
|
627
|
+
if (!skipTempReset) {
|
|
628
|
+
for (var name in this) {
|
|
629
|
+
// Not sure about the optimal order of these conditions:
|
|
630
|
+
if (name.charAt(0) === "t" &&
|
|
631
|
+
hasOwn.call(this, name) &&
|
|
632
|
+
!isNaN(+name.slice(1))) {
|
|
633
|
+
this[name] = undefined$1;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
},
|
|
638
|
+
|
|
639
|
+
stop: function() {
|
|
640
|
+
this.done = true;
|
|
641
|
+
|
|
642
|
+
var rootEntry = this.tryEntries[0];
|
|
643
|
+
var rootRecord = rootEntry.completion;
|
|
644
|
+
if (rootRecord.type === "throw") {
|
|
645
|
+
throw rootRecord.arg;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
return this.rval;
|
|
649
|
+
},
|
|
650
|
+
|
|
651
|
+
dispatchException: function(exception) {
|
|
652
|
+
if (this.done) {
|
|
653
|
+
throw exception;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
var context = this;
|
|
657
|
+
function handle(loc, caught) {
|
|
658
|
+
record.type = "throw";
|
|
659
|
+
record.arg = exception;
|
|
660
|
+
context.next = loc;
|
|
661
|
+
|
|
662
|
+
if (caught) {
|
|
663
|
+
// If the dispatched exception was caught by a catch block,
|
|
664
|
+
// then let that catch block handle the exception normally.
|
|
665
|
+
context.method = "next";
|
|
666
|
+
context.arg = undefined$1;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
return !! caught;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
673
|
+
var entry = this.tryEntries[i];
|
|
674
|
+
var record = entry.completion;
|
|
675
|
+
|
|
676
|
+
if (entry.tryLoc === "root") {
|
|
677
|
+
// Exception thrown outside of any try block that could handle
|
|
678
|
+
// it, so set the completion value of the entire function to
|
|
679
|
+
// throw the exception.
|
|
680
|
+
return handle("end");
|
|
681
|
+
}
|
|
43
682
|
|
|
44
|
-
|
|
45
|
-
|
|
683
|
+
if (entry.tryLoc <= this.prev) {
|
|
684
|
+
var hasCatch = hasOwn.call(entry, "catchLoc");
|
|
685
|
+
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
686
|
+
|
|
687
|
+
if (hasCatch && hasFinally) {
|
|
688
|
+
if (this.prev < entry.catchLoc) {
|
|
689
|
+
return handle(entry.catchLoc, true);
|
|
690
|
+
} else if (this.prev < entry.finallyLoc) {
|
|
691
|
+
return handle(entry.finallyLoc);
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
} else if (hasCatch) {
|
|
695
|
+
if (this.prev < entry.catchLoc) {
|
|
696
|
+
return handle(entry.catchLoc, true);
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
} else if (hasFinally) {
|
|
700
|
+
if (this.prev < entry.finallyLoc) {
|
|
701
|
+
return handle(entry.finallyLoc);
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
} else {
|
|
705
|
+
throw new Error("try statement without catch or finally");
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
},
|
|
710
|
+
|
|
711
|
+
abrupt: function(type, arg) {
|
|
712
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
713
|
+
var entry = this.tryEntries[i];
|
|
714
|
+
if (entry.tryLoc <= this.prev &&
|
|
715
|
+
hasOwn.call(entry, "finallyLoc") &&
|
|
716
|
+
this.prev < entry.finallyLoc) {
|
|
717
|
+
var finallyEntry = entry;
|
|
718
|
+
break;
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
if (finallyEntry &&
|
|
723
|
+
(type === "break" ||
|
|
724
|
+
type === "continue") &&
|
|
725
|
+
finallyEntry.tryLoc <= arg &&
|
|
726
|
+
arg <= finallyEntry.finallyLoc) {
|
|
727
|
+
// Ignore the finally entry if control is not jumping to a
|
|
728
|
+
// location outside the try/catch block.
|
|
729
|
+
finallyEntry = null;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
733
|
+
record.type = type;
|
|
734
|
+
record.arg = arg;
|
|
735
|
+
|
|
736
|
+
if (finallyEntry) {
|
|
737
|
+
this.method = "next";
|
|
738
|
+
this.next = finallyEntry.finallyLoc;
|
|
739
|
+
return ContinueSentinel;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
return this.complete(record);
|
|
743
|
+
},
|
|
744
|
+
|
|
745
|
+
complete: function(record, afterLoc) {
|
|
746
|
+
if (record.type === "throw") {
|
|
747
|
+
throw record.arg;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
if (record.type === "break" ||
|
|
751
|
+
record.type === "continue") {
|
|
752
|
+
this.next = record.arg;
|
|
753
|
+
} else if (record.type === "return") {
|
|
754
|
+
this.rval = this.arg = record.arg;
|
|
755
|
+
this.method = "return";
|
|
756
|
+
this.next = "end";
|
|
757
|
+
} else if (record.type === "normal" && afterLoc) {
|
|
758
|
+
this.next = afterLoc;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
return ContinueSentinel;
|
|
762
|
+
},
|
|
763
|
+
|
|
764
|
+
finish: function(finallyLoc) {
|
|
765
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
766
|
+
var entry = this.tryEntries[i];
|
|
767
|
+
if (entry.finallyLoc === finallyLoc) {
|
|
768
|
+
this.complete(entry.completion, entry.afterLoc);
|
|
769
|
+
resetTryEntry(entry);
|
|
770
|
+
return ContinueSentinel;
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
},
|
|
774
|
+
|
|
775
|
+
"catch": function(tryLoc) {
|
|
776
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
777
|
+
var entry = this.tryEntries[i];
|
|
778
|
+
if (entry.tryLoc === tryLoc) {
|
|
779
|
+
var record = entry.completion;
|
|
780
|
+
if (record.type === "throw") {
|
|
781
|
+
var thrown = record.arg;
|
|
782
|
+
resetTryEntry(entry);
|
|
783
|
+
}
|
|
784
|
+
return thrown;
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
// The context.catch method must only be called with a location
|
|
789
|
+
// argument that corresponds to a known catch block.
|
|
790
|
+
throw new Error("illegal catch attempt");
|
|
791
|
+
},
|
|
792
|
+
|
|
793
|
+
delegateYield: function(iterable, resultName, nextLoc) {
|
|
794
|
+
this.delegate = {
|
|
795
|
+
iterator: values(iterable),
|
|
796
|
+
resultName: resultName,
|
|
797
|
+
nextLoc: nextLoc
|
|
798
|
+
};
|
|
799
|
+
|
|
800
|
+
if (this.method === "next") {
|
|
801
|
+
// Deliberately forget the last sent value so that we don't
|
|
802
|
+
// accidentally pass it on to the delegate.
|
|
803
|
+
this.arg = undefined$1;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
return ContinueSentinel;
|
|
46
807
|
}
|
|
808
|
+
};
|
|
809
|
+
|
|
810
|
+
// Regardless of whether this script is executing as a CommonJS module
|
|
811
|
+
// or not, return the runtime object so that we can declare the variable
|
|
812
|
+
// regeneratorRuntime in the outer scope, which allows this module to be
|
|
813
|
+
// injected easily by `bin/regenerator --include-runtime script.js`.
|
|
814
|
+
return exports;
|
|
815
|
+
|
|
816
|
+
}(
|
|
817
|
+
// If this script is executing as a CommonJS module, use module.exports
|
|
818
|
+
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
|
819
|
+
// object. Either way, the resulting object will be used to initialize
|
|
820
|
+
// the regeneratorRuntime variable at the top of this file.
|
|
821
|
+
module.exports
|
|
822
|
+
));
|
|
823
|
+
|
|
824
|
+
try {
|
|
825
|
+
regeneratorRuntime = runtime;
|
|
826
|
+
} catch (accidentalStrictMode) {
|
|
827
|
+
// This module should not be running in strict mode, so the above
|
|
828
|
+
// assignment should always work unless something is misconfigured. Just
|
|
829
|
+
// in case runtime.js accidentally runs in strict mode, we can escape
|
|
830
|
+
// strict mode using a global Function call. This could conceivably fail
|
|
831
|
+
// if a Content Security Policy forbids using Function, but in that case
|
|
832
|
+
// the proper solution is to fix the accidental strict mode problem. If
|
|
833
|
+
// you've misconfigured your bundler to force strict mode and applied a
|
|
834
|
+
// CSP to forbid Function, and you're not willing to fix either of those
|
|
835
|
+
// problems, please detail your unique predicament in a GitHub issue.
|
|
836
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
|
837
|
+
}
|
|
838
|
+
});
|
|
839
|
+
|
|
840
|
+
var regenerator = runtime_1;
|
|
841
|
+
|
|
842
|
+
var defineProperty = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
843
|
+
function _defineProperty(obj, key, value) {
|
|
844
|
+
if (key in obj) {
|
|
845
|
+
Object.defineProperty(obj, key, {
|
|
846
|
+
value: value,
|
|
847
|
+
enumerable: true,
|
|
848
|
+
configurable: true,
|
|
849
|
+
writable: true
|
|
850
|
+
});
|
|
851
|
+
} else {
|
|
852
|
+
obj[key] = value;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
return obj;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
module.exports = _defineProperty;
|
|
859
|
+
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
860
|
+
});
|
|
861
|
+
|
|
862
|
+
_commonjsHelpers.unwrapExports(defineProperty);
|
|
47
863
|
|
|
48
|
-
|
|
864
|
+
var asyncToGenerator = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
865
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
866
|
+
try {
|
|
867
|
+
var info = gen[key](arg);
|
|
868
|
+
var value = info.value;
|
|
869
|
+
} catch (error) {
|
|
870
|
+
reject(error);
|
|
871
|
+
return;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
if (info.done) {
|
|
875
|
+
resolve(value);
|
|
876
|
+
} else {
|
|
877
|
+
Promise.resolve(value).then(_next, _throw);
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
function _asyncToGenerator(fn) {
|
|
882
|
+
return function () {
|
|
883
|
+
var self = this,
|
|
884
|
+
args = arguments;
|
|
885
|
+
return new Promise(function (resolve, reject) {
|
|
886
|
+
var gen = fn.apply(self, args);
|
|
887
|
+
|
|
888
|
+
function _next(value) {
|
|
889
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
function _throw(err) {
|
|
893
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
_next(undefined);
|
|
897
|
+
});
|
|
898
|
+
};
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
module.exports = _asyncToGenerator;
|
|
902
|
+
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
903
|
+
});
|
|
904
|
+
|
|
905
|
+
_commonjsHelpers.unwrapExports(asyncToGenerator);
|
|
906
|
+
|
|
907
|
+
var arrayWithHoles = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
908
|
+
function _arrayWithHoles(arr) {
|
|
909
|
+
if (Array.isArray(arr)) return arr;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
module.exports = _arrayWithHoles;
|
|
913
|
+
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
914
|
+
});
|
|
915
|
+
|
|
916
|
+
_commonjsHelpers.unwrapExports(arrayWithHoles);
|
|
917
|
+
|
|
918
|
+
var iterableToArrayLimit = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
919
|
+
function _iterableToArrayLimit(arr, i) {
|
|
920
|
+
var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]);
|
|
921
|
+
|
|
922
|
+
if (_i == null) return;
|
|
923
|
+
var _arr = [];
|
|
924
|
+
var _n = true;
|
|
925
|
+
var _d = false;
|
|
926
|
+
|
|
927
|
+
var _s, _e;
|
|
928
|
+
|
|
929
|
+
try {
|
|
930
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
931
|
+
_arr.push(_s.value);
|
|
932
|
+
|
|
933
|
+
if (i && _arr.length === i) break;
|
|
934
|
+
}
|
|
935
|
+
} catch (err) {
|
|
936
|
+
_d = true;
|
|
937
|
+
_e = err;
|
|
938
|
+
} finally {
|
|
939
|
+
try {
|
|
940
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
941
|
+
} finally {
|
|
942
|
+
if (_d) throw _e;
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
return _arr;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
module.exports = _iterableToArrayLimit;
|
|
950
|
+
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
951
|
+
});
|
|
952
|
+
|
|
953
|
+
_commonjsHelpers.unwrapExports(iterableToArrayLimit);
|
|
954
|
+
|
|
955
|
+
var arrayLikeToArray = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
956
|
+
function _arrayLikeToArray(arr, len) {
|
|
957
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
958
|
+
|
|
959
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
960
|
+
arr2[i] = arr[i];
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
return arr2;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
module.exports = _arrayLikeToArray;
|
|
967
|
+
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
968
|
+
});
|
|
969
|
+
|
|
970
|
+
_commonjsHelpers.unwrapExports(arrayLikeToArray);
|
|
971
|
+
|
|
972
|
+
var unsupportedIterableToArray = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
973
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
974
|
+
if (!o) return;
|
|
975
|
+
if (typeof o === "string") return arrayLikeToArray(o, minLen);
|
|
976
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
977
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
978
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
979
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
module.exports = _unsupportedIterableToArray;
|
|
983
|
+
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
984
|
+
});
|
|
985
|
+
|
|
986
|
+
_commonjsHelpers.unwrapExports(unsupportedIterableToArray);
|
|
987
|
+
|
|
988
|
+
var nonIterableRest = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
989
|
+
function _nonIterableRest() {
|
|
990
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
module.exports = _nonIterableRest;
|
|
994
|
+
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
995
|
+
});
|
|
996
|
+
|
|
997
|
+
_commonjsHelpers.unwrapExports(nonIterableRest);
|
|
998
|
+
|
|
999
|
+
var slicedToArray = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
1000
|
+
function _slicedToArray(arr, i) {
|
|
1001
|
+
return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
module.exports = _slicedToArray;
|
|
1005
|
+
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
1006
|
+
});
|
|
1007
|
+
|
|
1008
|
+
_commonjsHelpers.unwrapExports(slicedToArray);
|
|
1009
|
+
|
|
1010
|
+
var logger = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
1011
|
+
|
|
1012
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1013
|
+
value: true
|
|
1014
|
+
});
|
|
1015
|
+
exports.setLogger = setLogger;
|
|
1016
|
+
exports.proxyLogger = proxyLogger;
|
|
1017
|
+
exports.default = void 0;
|
|
1018
|
+
const _logger = {
|
|
1019
|
+
error(code, ...message) {
|
|
1020
|
+
console.error(`[next-auth][error][${code.toLowerCase()}]`, `\nhttps://next-auth.js.org/errors#${code.toLowerCase()}`, ...message);
|
|
1021
|
+
},
|
|
1022
|
+
|
|
1023
|
+
warn(code, ...message) {
|
|
1024
|
+
console.warn(`[next-auth][warn][${code.toLowerCase()}]`, `\nhttps://next-auth.js.org/warnings#${code.toLowerCase()}`, ...message);
|
|
1025
|
+
},
|
|
1026
|
+
|
|
1027
|
+
debug(code, ...message) {
|
|
1028
|
+
var _process, _process$env;
|
|
1029
|
+
|
|
1030
|
+
if (!((_process = process) !== null && _process !== void 0 && (_process$env = _process.env) !== null && _process$env !== void 0 && _process$env._NEXTAUTH_DEBUG)) return;
|
|
1031
|
+
console.log(`[next-auth][debug][${code.toLowerCase()}]`, ...message);
|
|
49
1032
|
}
|
|
50
1033
|
|
|
51
1034
|
};
|
|
52
|
-
|
|
1035
|
+
|
|
1036
|
+
function setLogger(newLogger = {}) {
|
|
1037
|
+
if (newLogger.error) _logger.error = newLogger.error;
|
|
1038
|
+
if (newLogger.warn) _logger.warn = newLogger.warn;
|
|
1039
|
+
if (newLogger.debug) _logger.debug = newLogger.debug;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
var _default = _logger;
|
|
53
1043
|
exports.default = _default;
|
|
1044
|
+
|
|
1045
|
+
function proxyLogger(logger = _logger, basePath) {
|
|
1046
|
+
try {
|
|
1047
|
+
if (typeof window === "undefined") {
|
|
1048
|
+
return logger;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
const clientLogger = {};
|
|
1052
|
+
|
|
1053
|
+
for (const level in logger) {
|
|
1054
|
+
clientLogger[level] = (code, ...message) => {
|
|
1055
|
+
_logger[level](code, ...message);
|
|
1056
|
+
|
|
1057
|
+
const url = `${basePath}/_log`;
|
|
1058
|
+
const body = new URLSearchParams({
|
|
1059
|
+
level,
|
|
1060
|
+
code,
|
|
1061
|
+
message: JSON.stringify(message.map(m => {
|
|
1062
|
+
if (m instanceof Error) {
|
|
1063
|
+
return {
|
|
1064
|
+
name: m.name,
|
|
1065
|
+
message: m.message,
|
|
1066
|
+
stack: m.stack
|
|
1067
|
+
};
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
return m;
|
|
1071
|
+
}))
|
|
1072
|
+
});
|
|
1073
|
+
|
|
1074
|
+
if (navigator.sendBeacon) {
|
|
1075
|
+
return navigator.sendBeacon(url, body);
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
return fetch(url, {
|
|
1079
|
+
method: "POST",
|
|
1080
|
+
headers: {
|
|
1081
|
+
"Content-Type": "application/json"
|
|
1082
|
+
},
|
|
1083
|
+
body
|
|
1084
|
+
});
|
|
1085
|
+
};
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
return clientLogger;
|
|
1089
|
+
} catch {
|
|
1090
|
+
return _logger;
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
54
1093
|
});
|
|
55
1094
|
|
|
56
|
-
_commonjsHelpers.unwrapExports(
|
|
1095
|
+
_commonjsHelpers.unwrapExports(logger);
|
|
1096
|
+
logger.setLogger;
|
|
1097
|
+
logger.proxyLogger;
|
|
57
1098
|
|
|
58
1099
|
var parseUrl_1 = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
59
1100
|
|
|
@@ -63,18 +1104,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
63
1104
|
exports.default = parseUrl;
|
|
64
1105
|
|
|
65
1106
|
function parseUrl(url) {
|
|
66
|
-
|
|
67
|
-
|
|
1107
|
+
const defaultHost = 'http://localhost:3000';
|
|
1108
|
+
const defaultPath = '/api/auth';
|
|
68
1109
|
|
|
69
1110
|
if (!url) {
|
|
70
|
-
url =
|
|
1111
|
+
url = `${defaultHost}${defaultPath}`;
|
|
71
1112
|
}
|
|
72
1113
|
|
|
73
|
-
|
|
1114
|
+
const protocol = url.startsWith('http:') ? 'http' : 'https';
|
|
74
1115
|
url = url.replace(/^https?:\/\//, '').replace(/\/$/, '');
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
1116
|
+
const [_host, ..._path] = url.split('/');
|
|
1117
|
+
const baseUrl = _host ? `${protocol}://${_host}` : defaultHost;
|
|
1118
|
+
const basePath = _path.length > 0 ? `/${_path.join('/')}` : defaultPath;
|
|
78
1119
|
return {
|
|
79
1120
|
baseUrl,
|
|
80
1121
|
basePath
|
|
@@ -84,336 +1125,428 @@ function parseUrl(url) {
|
|
|
84
1125
|
|
|
85
1126
|
_commonjsHelpers.unwrapExports(parseUrl_1);
|
|
86
1127
|
|
|
87
|
-
var client = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
1128
|
+
var client$1 = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
1129
|
+
|
|
1130
|
+
|
|
1131
|
+
|
|
1132
|
+
|
|
88
1133
|
|
|
89
1134
|
Object.defineProperty(exports, "__esModule", {
|
|
90
1135
|
value: true
|
|
91
1136
|
});
|
|
92
|
-
exports.
|
|
93
|
-
exports.
|
|
94
|
-
exports.
|
|
95
|
-
exports.
|
|
1137
|
+
exports.useSession = useSession;
|
|
1138
|
+
exports.session = exports.getSession = getSession;
|
|
1139
|
+
exports.csrfToken = exports.getCsrfToken = getCsrfToken;
|
|
1140
|
+
exports.providers = exports.getProviders = getProviders;
|
|
1141
|
+
exports.signin = exports.signIn = signIn;
|
|
1142
|
+
exports.signout = exports.signOut = signOut;
|
|
1143
|
+
exports.options = exports.setOptions = setOptions;
|
|
1144
|
+
exports.Provider = Provider;
|
|
1145
|
+
exports.default = void 0;
|
|
96
1146
|
|
|
1147
|
+
var _regenerator = interopRequireDefault(regenerator);
|
|
97
1148
|
|
|
1149
|
+
var _defineProperty2 = interopRequireDefault(defineProperty);
|
|
98
1150
|
|
|
99
|
-
var
|
|
1151
|
+
var _asyncToGenerator2 = interopRequireDefault(asyncToGenerator);
|
|
100
1152
|
|
|
101
|
-
var
|
|
1153
|
+
var _slicedToArray2 = interopRequireDefault(slicedToArray);
|
|
102
1154
|
|
|
103
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
104
1155
|
|
|
105
|
-
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; }
|
|
106
1156
|
|
|
107
|
-
|
|
1157
|
+
var _logger2 = interopRequireWildcard(logger);
|
|
108
1158
|
|
|
109
|
-
|
|
1159
|
+
var _parseUrl = interopRequireDefault(parseUrl_1);
|
|
110
1160
|
|
|
111
|
-
function
|
|
1161
|
+
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; }
|
|
112
1162
|
|
|
113
|
-
function
|
|
1163
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
114
1164
|
|
|
115
1165
|
var __NEXTAUTH = {
|
|
116
1166
|
baseUrl: (0, _parseUrl.default)(process.env.NEXTAUTH_URL || process.env.VERCEL_URL).baseUrl,
|
|
117
1167
|
basePath: (0, _parseUrl.default)(process.env.NEXTAUTH_URL).basePath,
|
|
1168
|
+
baseUrlServer: (0, _parseUrl.default)(process.env.NEXTAUTH_URL_INTERNAL || process.env.NEXTAUTH_URL || process.env.VERCEL_URL).baseUrl,
|
|
1169
|
+
basePathServer: (0, _parseUrl.default)(process.env.NEXTAUTH_URL_INTERNAL || process.env.NEXTAUTH_URL).basePath,
|
|
118
1170
|
keepAlive: 0,
|
|
119
1171
|
clientMaxAge: 0,
|
|
120
1172
|
_clientLastSync: 0,
|
|
121
1173
|
_clientSyncTimer: null,
|
|
122
1174
|
_eventListenersAdded: false,
|
|
123
1175
|
_clientSession: undefined,
|
|
124
|
-
|
|
125
|
-
_getSession: () => {}
|
|
1176
|
+
_getSession: function _getSession() {}
|
|
126
1177
|
};
|
|
1178
|
+
var logger$1 = (0, _logger2.proxyLogger)(_logger2.default, __NEXTAUTH.basePath);
|
|
1179
|
+
var broadcast = BroadcastChannel();
|
|
127
1180
|
|
|
128
|
-
if (typeof window !== 'undefined') {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
if (event.key === 'nextauth.message') {
|
|
134
|
-
var message = JSON.parse(event.newValue);
|
|
135
|
-
|
|
136
|
-
if ((message === null || message === void 0 ? void 0 : message.event) === 'session' && message.data) {
|
|
137
|
-
if (__NEXTAUTH._clientId === message.clientId) {
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
yield __NEXTAUTH._getSession({
|
|
142
|
-
event: 'storage'
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
return function (_x) {
|
|
149
|
-
return _ref.apply(this, arguments);
|
|
150
|
-
};
|
|
151
|
-
}());
|
|
152
|
-
var hidden, visibilityChange;
|
|
153
|
-
|
|
154
|
-
if (typeof document.hidden !== 'undefined') {
|
|
155
|
-
hidden = 'hidden';
|
|
156
|
-
visibilityChange = 'visibilitychange';
|
|
157
|
-
} else if (typeof document.msHidden !== 'undefined') {
|
|
158
|
-
hidden = 'msHidden';
|
|
159
|
-
visibilityChange = 'msvisibilitychange';
|
|
160
|
-
} else if (typeof document.webkitHidden !== 'undefined') {
|
|
161
|
-
hidden = 'webkitHidden';
|
|
162
|
-
visibilityChange = 'webkitvisibilitychange';
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
var handleVisibilityChange = () => !document[hidden] && __NEXTAUTH._getSession({
|
|
166
|
-
event: visibilityChange
|
|
1181
|
+
if (typeof window !== 'undefined' && !__NEXTAUTH._eventListenersAdded) {
|
|
1182
|
+
__NEXTAUTH._eventListenersAdded = true;
|
|
1183
|
+
broadcast.receive(function () {
|
|
1184
|
+
return __NEXTAUTH._getSession({
|
|
1185
|
+
event: 'storage'
|
|
167
1186
|
});
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
1187
|
+
});
|
|
1188
|
+
document.addEventListener('visibilitychange', function () {
|
|
1189
|
+
!document.hidden && __NEXTAUTH._getSession({
|
|
1190
|
+
event: 'visibilitychange'
|
|
1191
|
+
});
|
|
1192
|
+
}, false);
|
|
171
1193
|
}
|
|
172
1194
|
|
|
173
|
-
var
|
|
174
|
-
var {
|
|
175
|
-
baseUrl,
|
|
176
|
-
basePath,
|
|
177
|
-
clientMaxAge,
|
|
178
|
-
keepAlive
|
|
179
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
180
|
-
|
|
181
|
-
if (baseUrl) {
|
|
182
|
-
__NEXTAUTH.baseUrl = baseUrl;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
if (basePath) {
|
|
186
|
-
__NEXTAUTH.basePath = basePath;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
if (clientMaxAge) {
|
|
190
|
-
__NEXTAUTH.clientMaxAge = clientMaxAge;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
if (keepAlive) {
|
|
194
|
-
__NEXTAUTH.keepAlive = keepAlive;
|
|
195
|
-
|
|
196
|
-
if (typeof window !== 'undefined' && keepAlive > 0) {
|
|
197
|
-
if (__NEXTAUTH._clientSyncTimer !== null) {
|
|
198
|
-
clearTimeout(__NEXTAUTH._clientSyncTimer);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
__NEXTAUTH._clientSyncTimer = setTimeout(_asyncToGenerator(function* () {
|
|
202
|
-
if (__NEXTAUTH._clientSession) {
|
|
203
|
-
yield __NEXTAUTH._getSession({
|
|
204
|
-
event: 'timer'
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
}), keepAlive * 1000);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
};
|
|
1195
|
+
var SessionContext = (0, React__default['default'].createContext)();
|
|
211
1196
|
|
|
212
|
-
function
|
|
213
|
-
|
|
1197
|
+
function useSession(session) {
|
|
1198
|
+
var context = (0, React__default['default'].useContext)(SessionContext);
|
|
1199
|
+
if (context) return context;
|
|
1200
|
+
return _useSessionHook(session);
|
|
214
1201
|
}
|
|
215
1202
|
|
|
216
|
-
function
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
1203
|
+
function _useSessionHook(session) {
|
|
1204
|
+
var _useState = (0, React__default['default'].useState)(session),
|
|
1205
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
1206
|
+
data = _useState2[0],
|
|
1207
|
+
setData = _useState2[1];
|
|
1208
|
+
|
|
1209
|
+
var _useState3 = (0, React__default['default'].useState)(!data),
|
|
1210
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
1211
|
+
loading = _useState4[0],
|
|
1212
|
+
setLoading = _useState4[1];
|
|
1213
|
+
|
|
1214
|
+
(0, React__default['default'].useEffect)(function () {
|
|
1215
|
+
__NEXTAUTH._getSession = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee() {
|
|
1216
|
+
var _ref2,
|
|
1217
|
+
_ref2$event,
|
|
1218
|
+
event,
|
|
1219
|
+
triggredByEvent,
|
|
1220
|
+
triggeredByStorageEvent,
|
|
1221
|
+
clientMaxAge,
|
|
1222
|
+
clientLastSync,
|
|
1223
|
+
currentTime,
|
|
1224
|
+
clientSession,
|
|
1225
|
+
newClientSessionData,
|
|
1226
|
+
_args = arguments;
|
|
1227
|
+
|
|
1228
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
1229
|
+
while (1) {
|
|
1230
|
+
switch (_context.prev = _context.next) {
|
|
1231
|
+
case 0:
|
|
1232
|
+
_ref2 = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}, _ref2$event = _ref2.event, event = _ref2$event === void 0 ? null : _ref2$event;
|
|
1233
|
+
_context.prev = 1;
|
|
1234
|
+
triggredByEvent = event !== null;
|
|
1235
|
+
triggeredByStorageEvent = event === 'storage';
|
|
1236
|
+
clientMaxAge = __NEXTAUTH.clientMaxAge;
|
|
1237
|
+
clientLastSync = parseInt(__NEXTAUTH._clientLastSync);
|
|
1238
|
+
currentTime = _now();
|
|
1239
|
+
clientSession = __NEXTAUTH._clientSession;
|
|
1240
|
+
|
|
1241
|
+
if (!(!triggeredByStorageEvent && clientSession !== undefined)) {
|
|
1242
|
+
_context.next = 19;
|
|
1243
|
+
break;
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
if (!(clientMaxAge === 0 && triggredByEvent !== true)) {
|
|
1247
|
+
_context.next = 13;
|
|
1248
|
+
break;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
return _context.abrupt("return");
|
|
1252
|
+
|
|
1253
|
+
case 13:
|
|
1254
|
+
if (!(clientMaxAge > 0 && clientSession === null)) {
|
|
1255
|
+
_context.next = 17;
|
|
1256
|
+
break;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
return _context.abrupt("return");
|
|
1260
|
+
|
|
1261
|
+
case 17:
|
|
1262
|
+
if (!(clientMaxAge > 0 && currentTime < clientLastSync + clientMaxAge)) {
|
|
1263
|
+
_context.next = 19;
|
|
1264
|
+
break;
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
return _context.abrupt("return");
|
|
1268
|
+
|
|
1269
|
+
case 19:
|
|
1270
|
+
if (clientSession === undefined) {
|
|
1271
|
+
__NEXTAUTH._clientSession = null;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
__NEXTAUTH._clientLastSync = _now();
|
|
1275
|
+
_context.next = 23;
|
|
1276
|
+
return getSession({
|
|
1277
|
+
triggerEvent: !triggeredByStorageEvent
|
|
1278
|
+
});
|
|
1279
|
+
|
|
1280
|
+
case 23:
|
|
1281
|
+
newClientSessionData = _context.sent;
|
|
1282
|
+
__NEXTAUTH._clientSession = newClientSessionData;
|
|
1283
|
+
setData(newClientSessionData);
|
|
1284
|
+
setLoading(false);
|
|
1285
|
+
_context.next = 33;
|
|
1286
|
+
break;
|
|
1287
|
+
|
|
1288
|
+
case 29:
|
|
1289
|
+
_context.prev = 29;
|
|
1290
|
+
_context.t0 = _context["catch"](1);
|
|
1291
|
+
logger$1.error('CLIENT_USE_SESSION_ERROR', _context.t0);
|
|
1292
|
+
setLoading(false);
|
|
1293
|
+
|
|
1294
|
+
case 33:
|
|
1295
|
+
case "end":
|
|
1296
|
+
return _context.stop();
|
|
1297
|
+
}
|
|
238
1298
|
}
|
|
239
|
-
});
|
|
240
|
-
}
|
|
1299
|
+
}, _callee, null, [[1, 29]]);
|
|
1300
|
+
}));
|
|
241
1301
|
|
|
242
|
-
|
|
1302
|
+
__NEXTAUTH._getSession();
|
|
243
1303
|
});
|
|
244
|
-
return
|
|
1304
|
+
return [data, loading];
|
|
245
1305
|
}
|
|
246
1306
|
|
|
247
|
-
function
|
|
248
|
-
return
|
|
1307
|
+
function getSession(_x) {
|
|
1308
|
+
return _getSession2.apply(this, arguments);
|
|
249
1309
|
}
|
|
250
1310
|
|
|
251
|
-
function
|
|
252
|
-
|
|
253
|
-
var
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
1311
|
+
function _getSession2() {
|
|
1312
|
+
_getSession2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee4(ctx) {
|
|
1313
|
+
var _ctx$triggerEvent;
|
|
1314
|
+
|
|
1315
|
+
var session;
|
|
1316
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
1317
|
+
while (1) {
|
|
1318
|
+
switch (_context4.prev = _context4.next) {
|
|
1319
|
+
case 0:
|
|
1320
|
+
_context4.next = 2;
|
|
1321
|
+
return _fetchData('session', ctx);
|
|
1322
|
+
|
|
1323
|
+
case 2:
|
|
1324
|
+
session = _context4.sent;
|
|
1325
|
+
|
|
1326
|
+
if ((_ctx$triggerEvent = ctx === null || ctx === void 0 ? void 0 : ctx.triggerEvent) !== null && _ctx$triggerEvent !== void 0 ? _ctx$triggerEvent : true) {
|
|
1327
|
+
broadcast.post({
|
|
1328
|
+
event: 'session',
|
|
1329
|
+
data: {
|
|
1330
|
+
trigger: 'getSession'
|
|
1331
|
+
}
|
|
1332
|
+
});
|
|
1333
|
+
}
|
|
257
1334
|
|
|
258
|
-
|
|
1335
|
+
return _context4.abrupt("return", session);
|
|
259
1336
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
1337
|
+
case 5:
|
|
1338
|
+
case "end":
|
|
1339
|
+
return _context4.stop();
|
|
1340
|
+
}
|
|
263
1341
|
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
});
|
|
268
|
-
return _getCsrfToken.apply(this, arguments);
|
|
1342
|
+
}, _callee4);
|
|
1343
|
+
}));
|
|
1344
|
+
return _getSession2.apply(this, arguments);
|
|
269
1345
|
}
|
|
270
1346
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
return _fetchData("".concat(baseUrl, "/providers"));
|
|
276
|
-
});
|
|
277
|
-
|
|
278
|
-
return function getProviders() {
|
|
279
|
-
return _ref3.apply(this, arguments);
|
|
280
|
-
};
|
|
281
|
-
}();
|
|
282
|
-
|
|
283
|
-
var SessionContext = (0, React__default.createContext)();
|
|
1347
|
+
function getCsrfToken(_x2) {
|
|
1348
|
+
return _getCsrfToken.apply(this, arguments);
|
|
1349
|
+
}
|
|
284
1350
|
|
|
285
|
-
|
|
286
|
-
|
|
1351
|
+
function _getCsrfToken() {
|
|
1352
|
+
_getCsrfToken = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee5(ctx) {
|
|
1353
|
+
var _yield$_fetchData;
|
|
1354
|
+
|
|
1355
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
1356
|
+
while (1) {
|
|
1357
|
+
switch (_context5.prev = _context5.next) {
|
|
1358
|
+
case 0:
|
|
1359
|
+
_context5.next = 2;
|
|
1360
|
+
return _fetchData('csrf', ctx);
|
|
1361
|
+
|
|
1362
|
+
case 2:
|
|
1363
|
+
_context5.t1 = _yield$_fetchData = _context5.sent;
|
|
1364
|
+
_context5.t0 = _context5.t1 === null;
|
|
1365
|
+
|
|
1366
|
+
if (_context5.t0) {
|
|
1367
|
+
_context5.next = 6;
|
|
1368
|
+
break;
|
|
1369
|
+
}
|
|
287
1370
|
|
|
288
|
-
|
|
289
|
-
return _useSessionHook(session);
|
|
290
|
-
}
|
|
1371
|
+
_context5.t0 = _yield$_fetchData === void 0;
|
|
291
1372
|
|
|
292
|
-
|
|
293
|
-
|
|
1373
|
+
case 6:
|
|
1374
|
+
if (!_context5.t0) {
|
|
1375
|
+
_context5.next = 10;
|
|
1376
|
+
break;
|
|
1377
|
+
}
|
|
294
1378
|
|
|
295
|
-
|
|
1379
|
+
_context5.t2 = void 0;
|
|
1380
|
+
_context5.next = 11;
|
|
1381
|
+
break;
|
|
296
1382
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
var [loading, setLoading] = (0, React__default.useState)(true);
|
|
300
|
-
(0, React__default.useEffect)(() => {
|
|
301
|
-
var _getSession = function () {
|
|
302
|
-
var _ref4 = _asyncToGenerator(function* () {
|
|
303
|
-
var {
|
|
304
|
-
event = null
|
|
305
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
306
|
-
|
|
307
|
-
try {
|
|
308
|
-
var triggredByEvent = event !== null;
|
|
309
|
-
var triggeredByStorageEvent = !!(event && event === 'storage');
|
|
310
|
-
var clientMaxAge = __NEXTAUTH.clientMaxAge;
|
|
311
|
-
var clientLastSync = parseInt(__NEXTAUTH._clientLastSync);
|
|
312
|
-
var currentTime = Math.floor(new Date().getTime() / 1000);
|
|
313
|
-
var clientSession = __NEXTAUTH._clientSession;
|
|
314
|
-
|
|
315
|
-
if (triggeredByStorageEvent === false && clientSession !== undefined) {
|
|
316
|
-
if (clientMaxAge === 0 && triggredByEvent !== true) {
|
|
317
|
-
return;
|
|
318
|
-
} else if (clientMaxAge > 0 && clientSession === null) {
|
|
319
|
-
return;
|
|
320
|
-
} else if (clientMaxAge > 0 && currentTime < clientLastSync + clientMaxAge) {
|
|
321
|
-
return;
|
|
322
|
-
}
|
|
323
|
-
}
|
|
1383
|
+
case 10:
|
|
1384
|
+
_context5.t2 = _yield$_fetchData.csrfToken;
|
|
324
1385
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
}
|
|
1386
|
+
case 11:
|
|
1387
|
+
return _context5.abrupt("return", _context5.t2);
|
|
328
1388
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
triggerEvent
|
|
333
|
-
});
|
|
334
|
-
__NEXTAUTH._clientSession = newClientSessionData;
|
|
335
|
-
setData(newClientSessionData);
|
|
336
|
-
setLoading(false);
|
|
337
|
-
} catch (error) {
|
|
338
|
-
_logger.default.error('CLIENT_USE_SESSION_ERROR', error);
|
|
1389
|
+
case 12:
|
|
1390
|
+
case "end":
|
|
1391
|
+
return _context5.stop();
|
|
339
1392
|
}
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
}();
|
|
1393
|
+
}
|
|
1394
|
+
}, _callee5);
|
|
1395
|
+
}));
|
|
1396
|
+
return _getCsrfToken.apply(this, arguments);
|
|
1397
|
+
}
|
|
346
1398
|
|
|
347
|
-
|
|
1399
|
+
function getProviders() {
|
|
1400
|
+
return _getProviders.apply(this, arguments);
|
|
1401
|
+
}
|
|
348
1402
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
1403
|
+
function _getProviders() {
|
|
1404
|
+
_getProviders = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee6() {
|
|
1405
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
1406
|
+
while (1) {
|
|
1407
|
+
switch (_context6.prev = _context6.next) {
|
|
1408
|
+
case 0:
|
|
1409
|
+
return _context6.abrupt("return", _fetchData('providers'));
|
|
1410
|
+
|
|
1411
|
+
case 1:
|
|
1412
|
+
case "end":
|
|
1413
|
+
return _context6.stop();
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
}, _callee6);
|
|
1417
|
+
}));
|
|
1418
|
+
return _getProviders.apply(this, arguments);
|
|
1419
|
+
}
|
|
353
1420
|
|
|
354
|
-
function signIn(
|
|
1421
|
+
function signIn(_x3) {
|
|
355
1422
|
return _signIn.apply(this, arguments);
|
|
356
1423
|
}
|
|
357
1424
|
|
|
358
1425
|
function _signIn() {
|
|
359
|
-
_signIn =
|
|
360
|
-
var options
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
callbackUrl = window.location,
|
|
364
|
-
redirect = true
|
|
365
|
-
} = options;
|
|
366
|
-
|
|
367
|
-
var baseUrl = _apiBaseUrl();
|
|
368
|
-
|
|
369
|
-
var providers = yield getProviders();
|
|
370
|
-
|
|
371
|
-
if (!(provider in providers)) {
|
|
372
|
-
window.location = "".concat(baseUrl, "/signin?callbackUrl=").concat(encodeURIComponent(callbackUrl));
|
|
373
|
-
return;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
var isCredentials = providers[provider].type === 'credentials';
|
|
377
|
-
var signInUrl = isCredentials ? "".concat(baseUrl, "/callback/").concat(provider) : "".concat(baseUrl, "/signin/").concat(provider);
|
|
378
|
-
var fetchOptions = {
|
|
379
|
-
method: 'post',
|
|
380
|
-
headers: {
|
|
381
|
-
'Content-Type': 'application/x-www-form-urlencoded'
|
|
382
|
-
},
|
|
383
|
-
body: new URLSearchParams(_objectSpread(_objectSpread({}, options), {}, {
|
|
384
|
-
csrfToken: yield getCsrfToken(),
|
|
1426
|
+
_signIn = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee7(provider) {
|
|
1427
|
+
var options,
|
|
1428
|
+
authorizationParams,
|
|
1429
|
+
_options$callbackUrl,
|
|
385
1430
|
callbackUrl,
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
1431
|
+
_options$redirect,
|
|
1432
|
+
redirect,
|
|
1433
|
+
baseUrl,
|
|
1434
|
+
providers,
|
|
1435
|
+
isCredentials,
|
|
1436
|
+
isEmail,
|
|
1437
|
+
canRedirectBeDisabled,
|
|
1438
|
+
signInUrl,
|
|
1439
|
+
fetchOptions,
|
|
1440
|
+
_signInUrl,
|
|
1441
|
+
res,
|
|
1442
|
+
data,
|
|
1443
|
+
_data$url,
|
|
1444
|
+
url,
|
|
1445
|
+
error,
|
|
1446
|
+
_args7 = arguments;
|
|
1447
|
+
|
|
1448
|
+
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
1449
|
+
while (1) {
|
|
1450
|
+
switch (_context7.prev = _context7.next) {
|
|
1451
|
+
case 0:
|
|
1452
|
+
options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
|
|
1453
|
+
authorizationParams = _args7.length > 2 && _args7[2] !== undefined ? _args7[2] : {};
|
|
1454
|
+
_options$callbackUrl = options.callbackUrl, callbackUrl = _options$callbackUrl === void 0 ? window.location : _options$callbackUrl, _options$redirect = options.redirect, redirect = _options$redirect === void 0 ? true : _options$redirect;
|
|
1455
|
+
baseUrl = _apiBaseUrl();
|
|
1456
|
+
_context7.next = 6;
|
|
1457
|
+
return getProviders();
|
|
1458
|
+
|
|
1459
|
+
case 6:
|
|
1460
|
+
providers = _context7.sent;
|
|
1461
|
+
|
|
1462
|
+
if (provider in providers) {
|
|
1463
|
+
_context7.next = 10;
|
|
1464
|
+
break;
|
|
1465
|
+
}
|
|
389
1466
|
|
|
390
|
-
|
|
1467
|
+
window.location = "".concat(baseUrl, "/signin?callbackUrl=").concat(encodeURIComponent(callbackUrl));
|
|
1468
|
+
return _context7.abrupt("return");
|
|
1469
|
+
|
|
1470
|
+
case 10:
|
|
1471
|
+
isCredentials = providers[provider].type === 'credentials';
|
|
1472
|
+
isEmail = providers[provider].type === 'email';
|
|
1473
|
+
canRedirectBeDisabled = isCredentials || isEmail;
|
|
1474
|
+
signInUrl = isCredentials ? "".concat(baseUrl, "/callback/").concat(provider) : "".concat(baseUrl, "/signin/").concat(provider);
|
|
1475
|
+
_context7.t0 = {
|
|
1476
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
1477
|
+
};
|
|
1478
|
+
_context7.t1 = URLSearchParams;
|
|
1479
|
+
_context7.t2 = _objectSpread;
|
|
1480
|
+
_context7.t3 = _objectSpread({}, options);
|
|
1481
|
+
_context7.t4 = {};
|
|
1482
|
+
_context7.next = 21;
|
|
1483
|
+
return getCsrfToken();
|
|
1484
|
+
|
|
1485
|
+
case 21:
|
|
1486
|
+
_context7.t5 = _context7.sent;
|
|
1487
|
+
_context7.t6 = callbackUrl;
|
|
1488
|
+
_context7.t7 = {
|
|
1489
|
+
csrfToken: _context7.t5,
|
|
1490
|
+
callbackUrl: _context7.t6,
|
|
1491
|
+
json: true
|
|
1492
|
+
};
|
|
1493
|
+
_context7.t8 = (0, _context7.t2)(_context7.t3, _context7.t4, _context7.t7);
|
|
1494
|
+
_context7.t9 = new _context7.t1(_context7.t8);
|
|
1495
|
+
fetchOptions = {
|
|
1496
|
+
method: 'post',
|
|
1497
|
+
headers: _context7.t0,
|
|
1498
|
+
body: _context7.t9
|
|
1499
|
+
};
|
|
1500
|
+
_signInUrl = "".concat(signInUrl, "?").concat(new URLSearchParams(authorizationParams));
|
|
1501
|
+
_context7.next = 30;
|
|
1502
|
+
return fetch(_signInUrl, fetchOptions);
|
|
1503
|
+
|
|
1504
|
+
case 30:
|
|
1505
|
+
res = _context7.sent;
|
|
1506
|
+
_context7.next = 33;
|
|
1507
|
+
return res.json();
|
|
1508
|
+
|
|
1509
|
+
case 33:
|
|
1510
|
+
data = _context7.sent;
|
|
1511
|
+
|
|
1512
|
+
if (!(redirect || !canRedirectBeDisabled)) {
|
|
1513
|
+
_context7.next = 39;
|
|
1514
|
+
break;
|
|
1515
|
+
}
|
|
391
1516
|
|
|
392
|
-
|
|
393
|
-
|
|
1517
|
+
url = (_data$url = data.url) !== null && _data$url !== void 0 ? _data$url : callbackUrl;
|
|
1518
|
+
window.location = url;
|
|
1519
|
+
if (url.includes('#')) window.location.reload();
|
|
1520
|
+
return _context7.abrupt("return");
|
|
394
1521
|
|
|
395
|
-
|
|
396
|
-
|
|
1522
|
+
case 39:
|
|
1523
|
+
error = new URL(data.url).searchParams.get('error');
|
|
397
1524
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
1525
|
+
if (!res.ok) {
|
|
1526
|
+
_context7.next = 43;
|
|
1527
|
+
break;
|
|
1528
|
+
}
|
|
401
1529
|
|
|
402
|
-
|
|
1530
|
+
_context7.next = 43;
|
|
1531
|
+
return __NEXTAUTH._getSession({
|
|
1532
|
+
event: 'storage'
|
|
1533
|
+
});
|
|
403
1534
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
1535
|
+
case 43:
|
|
1536
|
+
return _context7.abrupt("return", {
|
|
1537
|
+
error: error,
|
|
1538
|
+
status: res.status,
|
|
1539
|
+
ok: res.ok,
|
|
1540
|
+
url: error ? null : data.url
|
|
1541
|
+
});
|
|
409
1542
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
};
|
|
416
|
-
});
|
|
1543
|
+
case 44:
|
|
1544
|
+
case "end":
|
|
1545
|
+
return _context7.stop();
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
}, _callee7);
|
|
1549
|
+
}));
|
|
417
1550
|
return _signIn.apply(this, arguments);
|
|
418
1551
|
}
|
|
419
1552
|
|
|
@@ -422,116 +1555,290 @@ function signOut() {
|
|
|
422
1555
|
}
|
|
423
1556
|
|
|
424
1557
|
function _signOut() {
|
|
425
|
-
_signOut =
|
|
426
|
-
var options
|
|
427
|
-
|
|
428
|
-
callbackUrl = window.location,
|
|
429
|
-
redirect = true
|
|
430
|
-
} = options;
|
|
431
|
-
|
|
432
|
-
var baseUrl = _apiBaseUrl();
|
|
433
|
-
|
|
434
|
-
var fetchOptions = {
|
|
435
|
-
method: 'post',
|
|
436
|
-
headers: {
|
|
437
|
-
'Content-Type': 'application/x-www-form-urlencoded'
|
|
438
|
-
},
|
|
439
|
-
body: new URLSearchParams({
|
|
440
|
-
csrfToken: yield getCsrfToken(),
|
|
1558
|
+
_signOut = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee8() {
|
|
1559
|
+
var options,
|
|
1560
|
+
_options$callbackUrl2,
|
|
441
1561
|
callbackUrl,
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
1562
|
+
_options$redirect2,
|
|
1563
|
+
redirect,
|
|
1564
|
+
baseUrl,
|
|
1565
|
+
fetchOptions,
|
|
1566
|
+
res,
|
|
1567
|
+
data,
|
|
1568
|
+
_data$url2,
|
|
1569
|
+
url,
|
|
1570
|
+
_args8 = arguments;
|
|
1571
|
+
|
|
1572
|
+
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
1573
|
+
while (1) {
|
|
1574
|
+
switch (_context8.prev = _context8.next) {
|
|
1575
|
+
case 0:
|
|
1576
|
+
options = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
|
|
1577
|
+
_options$callbackUrl2 = options.callbackUrl, callbackUrl = _options$callbackUrl2 === void 0 ? window.location : _options$callbackUrl2, _options$redirect2 = options.redirect, redirect = _options$redirect2 === void 0 ? true : _options$redirect2;
|
|
1578
|
+
baseUrl = _apiBaseUrl();
|
|
1579
|
+
_context8.t0 = {
|
|
1580
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
1581
|
+
};
|
|
1582
|
+
_context8.t1 = URLSearchParams;
|
|
1583
|
+
_context8.next = 7;
|
|
1584
|
+
return getCsrfToken();
|
|
1585
|
+
|
|
1586
|
+
case 7:
|
|
1587
|
+
_context8.t2 = _context8.sent;
|
|
1588
|
+
_context8.t3 = callbackUrl;
|
|
1589
|
+
_context8.t4 = {
|
|
1590
|
+
csrfToken: _context8.t2,
|
|
1591
|
+
callbackUrl: _context8.t3,
|
|
1592
|
+
json: true
|
|
1593
|
+
};
|
|
1594
|
+
_context8.t5 = new _context8.t1(_context8.t4);
|
|
1595
|
+
fetchOptions = {
|
|
1596
|
+
method: 'post',
|
|
1597
|
+
headers: _context8.t0,
|
|
1598
|
+
body: _context8.t5
|
|
1599
|
+
};
|
|
1600
|
+
_context8.next = 14;
|
|
1601
|
+
return fetch("".concat(baseUrl, "/signout"), fetchOptions);
|
|
1602
|
+
|
|
1603
|
+
case 14:
|
|
1604
|
+
res = _context8.sent;
|
|
1605
|
+
_context8.next = 17;
|
|
1606
|
+
return res.json();
|
|
1607
|
+
|
|
1608
|
+
case 17:
|
|
1609
|
+
data = _context8.sent;
|
|
1610
|
+
broadcast.post({
|
|
1611
|
+
event: 'session',
|
|
1612
|
+
data: {
|
|
1613
|
+
trigger: 'signout'
|
|
1614
|
+
}
|
|
1615
|
+
});
|
|
1616
|
+
|
|
1617
|
+
if (!redirect) {
|
|
1618
|
+
_context8.next = 24;
|
|
1619
|
+
break;
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
url = (_data$url2 = data.url) !== null && _data$url2 !== void 0 ? _data$url2 : callbackUrl;
|
|
1623
|
+
window.location = url;
|
|
1624
|
+
if (url.includes('#')) window.location.reload();
|
|
1625
|
+
return _context8.abrupt("return");
|
|
1626
|
+
|
|
1627
|
+
case 24:
|
|
1628
|
+
_context8.next = 26;
|
|
1629
|
+
return __NEXTAUTH._getSession({
|
|
1630
|
+
event: 'storage'
|
|
1631
|
+
});
|
|
1632
|
+
|
|
1633
|
+
case 26:
|
|
1634
|
+
return _context8.abrupt("return", data);
|
|
447
1635
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
1636
|
+
case 27:
|
|
1637
|
+
case "end":
|
|
1638
|
+
return _context8.stop();
|
|
1639
|
+
}
|
|
452
1640
|
}
|
|
453
|
-
});
|
|
1641
|
+
}, _callee8);
|
|
1642
|
+
}));
|
|
1643
|
+
return _signOut.apply(this, arguments);
|
|
1644
|
+
}
|
|
454
1645
|
|
|
455
|
-
|
|
456
|
-
|
|
1646
|
+
function setOptions() {
|
|
1647
|
+
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
1648
|
+
baseUrl = _ref3.baseUrl,
|
|
1649
|
+
basePath = _ref3.basePath,
|
|
1650
|
+
clientMaxAge = _ref3.clientMaxAge,
|
|
1651
|
+
keepAlive = _ref3.keepAlive;
|
|
1652
|
+
|
|
1653
|
+
if (baseUrl) __NEXTAUTH.baseUrl = baseUrl;
|
|
1654
|
+
if (basePath) __NEXTAUTH.basePath = basePath;
|
|
1655
|
+
if (clientMaxAge) __NEXTAUTH.clientMaxAge = clientMaxAge;
|
|
1656
|
+
|
|
1657
|
+
if (keepAlive) {
|
|
1658
|
+
__NEXTAUTH.keepAlive = keepAlive;
|
|
1659
|
+
if (typeof window === 'undefined') return;
|
|
457
1660
|
|
|
458
|
-
|
|
459
|
-
|
|
1661
|
+
if (__NEXTAUTH._clientSyncTimer !== null) {
|
|
1662
|
+
clearTimeout(__NEXTAUTH._clientSyncTimer);
|
|
460
1663
|
}
|
|
461
1664
|
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
1665
|
+
__NEXTAUTH._clientSyncTimer = setTimeout((0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2() {
|
|
1666
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
1667
|
+
while (1) {
|
|
1668
|
+
switch (_context2.prev = _context2.next) {
|
|
1669
|
+
case 0:
|
|
1670
|
+
if (__NEXTAUTH._clientSession) {
|
|
1671
|
+
_context2.next = 2;
|
|
1672
|
+
break;
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
return _context2.abrupt("return");
|
|
1676
|
+
|
|
1677
|
+
case 2:
|
|
1678
|
+
_context2.next = 4;
|
|
1679
|
+
return __NEXTAUTH._getSession({
|
|
1680
|
+
event: 'timer'
|
|
1681
|
+
});
|
|
1682
|
+
|
|
1683
|
+
case 4:
|
|
1684
|
+
case "end":
|
|
1685
|
+
return _context2.stop();
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
}, _callee2);
|
|
1689
|
+
})), keepAlive * 1000);
|
|
1690
|
+
}
|
|
468
1691
|
}
|
|
469
1692
|
|
|
470
|
-
|
|
471
|
-
var
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
options
|
|
475
|
-
} = _ref5;
|
|
1693
|
+
function Provider(_ref5) {
|
|
1694
|
+
var children = _ref5.children,
|
|
1695
|
+
session = _ref5.session,
|
|
1696
|
+
options = _ref5.options;
|
|
476
1697
|
setOptions(options);
|
|
477
|
-
return (0, React__default.createElement)(SessionContext.Provider, {
|
|
1698
|
+
return (0, React__default['default'].createElement)(SessionContext.Provider, {
|
|
478
1699
|
value: useSession(session)
|
|
479
1700
|
}, children);
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
exports.Provider = Provider;
|
|
483
|
-
|
|
484
|
-
var _fetchData = function () {
|
|
485
|
-
var _ref6 = _asyncToGenerator(function* (url) {
|
|
486
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
487
|
-
|
|
488
|
-
try {
|
|
489
|
-
var res = yield fetch(url, options);
|
|
490
|
-
var data = yield res.json();
|
|
491
|
-
return Promise.resolve(Object.keys(data).length > 0 ? data : null);
|
|
492
|
-
} catch (error) {
|
|
493
|
-
_logger.default.error('CLIENT_FETCH_ERROR', url, error);
|
|
1701
|
+
}
|
|
494
1702
|
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
1703
|
+
function _fetchData(_x4) {
|
|
1704
|
+
return _fetchData2.apply(this, arguments);
|
|
1705
|
+
}
|
|
498
1706
|
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
1707
|
+
function _fetchData2() {
|
|
1708
|
+
_fetchData2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee9(path) {
|
|
1709
|
+
var _ref7,
|
|
1710
|
+
ctx,
|
|
1711
|
+
_ref7$req,
|
|
1712
|
+
req,
|
|
1713
|
+
baseUrl,
|
|
1714
|
+
options,
|
|
1715
|
+
res,
|
|
1716
|
+
data,
|
|
1717
|
+
_args9 = arguments;
|
|
1718
|
+
|
|
1719
|
+
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
1720
|
+
while (1) {
|
|
1721
|
+
switch (_context9.prev = _context9.next) {
|
|
1722
|
+
case 0:
|
|
1723
|
+
_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;
|
|
1724
|
+
_context9.prev = 1;
|
|
1725
|
+
_context9.next = 4;
|
|
1726
|
+
return _apiBaseUrl();
|
|
1727
|
+
|
|
1728
|
+
case 4:
|
|
1729
|
+
baseUrl = _context9.sent;
|
|
1730
|
+
options = req ? {
|
|
1731
|
+
headers: {
|
|
1732
|
+
cookie: req.headers.cookie
|
|
1733
|
+
}
|
|
1734
|
+
} : {};
|
|
1735
|
+
_context9.next = 8;
|
|
1736
|
+
return fetch("".concat(baseUrl, "/").concat(path), options);
|
|
1737
|
+
|
|
1738
|
+
case 8:
|
|
1739
|
+
res = _context9.sent;
|
|
1740
|
+
_context9.next = 11;
|
|
1741
|
+
return res.json();
|
|
1742
|
+
|
|
1743
|
+
case 11:
|
|
1744
|
+
data = _context9.sent;
|
|
1745
|
+
return _context9.abrupt("return", Object.keys(data).length > 0 ? data : null);
|
|
1746
|
+
|
|
1747
|
+
case 15:
|
|
1748
|
+
_context9.prev = 15;
|
|
1749
|
+
_context9.t0 = _context9["catch"](1);
|
|
1750
|
+
logger$1.error('CLIENT_FETCH_ERROR', path, _context9.t0);
|
|
1751
|
+
return _context9.abrupt("return", null);
|
|
1752
|
+
|
|
1753
|
+
case 19:
|
|
1754
|
+
case "end":
|
|
1755
|
+
return _context9.stop();
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
}, _callee9, null, [[1, 15]]);
|
|
1759
|
+
}));
|
|
1760
|
+
return _fetchData2.apply(this, arguments);
|
|
1761
|
+
}
|
|
503
1762
|
|
|
504
|
-
|
|
1763
|
+
function _apiBaseUrl() {
|
|
505
1764
|
if (typeof window === 'undefined') {
|
|
506
1765
|
if (!process.env.NEXTAUTH_URL) {
|
|
507
|
-
|
|
1766
|
+
logger$1.warn('NEXTAUTH_URL', 'NEXTAUTH_URL environment variable not set');
|
|
508
1767
|
}
|
|
509
1768
|
|
|
510
|
-
return "".concat(__NEXTAUTH.
|
|
511
|
-
} else {
|
|
512
|
-
return __NEXTAUTH.basePath;
|
|
1769
|
+
return "".concat(__NEXTAUTH.baseUrlServer).concat(__NEXTAUTH.basePathServer);
|
|
513
1770
|
}
|
|
514
|
-
};
|
|
515
1771
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
1772
|
+
return __NEXTAUTH.basePath;
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
function _now() {
|
|
1776
|
+
return Math.floor(Date.now() / 1000);
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
function BroadcastChannel() {
|
|
1780
|
+
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'nextauth.message';
|
|
1781
|
+
return {
|
|
1782
|
+
receive: function receive(onReceive) {
|
|
1783
|
+
if (typeof window === 'undefined') return;
|
|
1784
|
+
window.addEventListener('storage', function () {
|
|
1785
|
+
var _ref6 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(event) {
|
|
1786
|
+
var message;
|
|
1787
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
1788
|
+
while (1) {
|
|
1789
|
+
switch (_context3.prev = _context3.next) {
|
|
1790
|
+
case 0:
|
|
1791
|
+
if (!(event.key !== name)) {
|
|
1792
|
+
_context3.next = 2;
|
|
1793
|
+
break;
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
return _context3.abrupt("return");
|
|
1797
|
+
|
|
1798
|
+
case 2:
|
|
1799
|
+
message = JSON.parse(event.newValue);
|
|
1800
|
+
|
|
1801
|
+
if (!((message === null || message === void 0 ? void 0 : message.event) !== 'session' || !(message !== null && message !== void 0 && message.data))) {
|
|
1802
|
+
_context3.next = 5;
|
|
1803
|
+
break;
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
return _context3.abrupt("return");
|
|
1807
|
+
|
|
1808
|
+
case 5:
|
|
1809
|
+
onReceive(message);
|
|
1810
|
+
|
|
1811
|
+
case 6:
|
|
1812
|
+
case "end":
|
|
1813
|
+
return _context3.stop();
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1816
|
+
}, _callee3);
|
|
1817
|
+
}));
|
|
1818
|
+
|
|
1819
|
+
return function (_x5) {
|
|
1820
|
+
return _ref6.apply(this, arguments);
|
|
1821
|
+
};
|
|
1822
|
+
}());
|
|
1823
|
+
},
|
|
1824
|
+
post: function post(message) {
|
|
1825
|
+
if (typeof localStorage === 'undefined') return;
|
|
1826
|
+
localStorage.setItem(name, JSON.stringify(_objectSpread(_objectSpread({}, message), {}, {
|
|
1827
|
+
timestamp: _now()
|
|
1828
|
+
})));
|
|
1829
|
+
}
|
|
1830
|
+
};
|
|
1831
|
+
}
|
|
525
1832
|
|
|
526
1833
|
var _default = {
|
|
527
|
-
getSession,
|
|
528
|
-
getCsrfToken,
|
|
529
|
-
getProviders,
|
|
530
|
-
useSession,
|
|
531
|
-
signIn,
|
|
532
|
-
signOut,
|
|
533
|
-
Provider,
|
|
534
|
-
setOptions,
|
|
1834
|
+
getSession: getSession,
|
|
1835
|
+
getCsrfToken: getCsrfToken,
|
|
1836
|
+
getProviders: getProviders,
|
|
1837
|
+
useSession: useSession,
|
|
1838
|
+
signIn: signIn,
|
|
1839
|
+
signOut: signOut,
|
|
1840
|
+
Provider: Provider,
|
|
1841
|
+
setOptions: setOptions,
|
|
535
1842
|
options: setOptions,
|
|
536
1843
|
session: getSession,
|
|
537
1844
|
providers: getProviders,
|
|
@@ -542,16 +1849,25 @@ var _default = {
|
|
|
542
1849
|
exports.default = _default;
|
|
543
1850
|
});
|
|
544
1851
|
|
|
545
|
-
_commonjsHelpers.unwrapExports(client);
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
1852
|
+
_commonjsHelpers.unwrapExports(client$1);
|
|
1853
|
+
client$1.useSession;
|
|
1854
|
+
client$1.session;
|
|
1855
|
+
client$1.getSession;
|
|
1856
|
+
client$1.csrfToken;
|
|
1857
|
+
client$1.getCsrfToken;
|
|
1858
|
+
client$1.providers;
|
|
1859
|
+
client$1.getProviders;
|
|
1860
|
+
client$1.signin;
|
|
1861
|
+
client$1.signIn;
|
|
1862
|
+
client$1.signout;
|
|
1863
|
+
client$1.signOut;
|
|
1864
|
+
client$1.options;
|
|
1865
|
+
client$1.setOptions;
|
|
1866
|
+
client$1.Provider;
|
|
1867
|
+
|
|
1868
|
+
var client = client$1.default;
|
|
1869
|
+
|
|
1870
|
+
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}";
|
|
555
1871
|
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" };
|
|
556
1872
|
styleInject_es.styleInject(css);
|
|
557
1873
|
|
|
@@ -561,28 +1877,28 @@ var AuthWrapper = function AuthWrapper(_ref) {
|
|
|
561
1877
|
_ref$formUrl = _ref.formUrl,
|
|
562
1878
|
formUrl = _ref$formUrl === undefined ? '' : _ref$formUrl;
|
|
563
1879
|
|
|
564
|
-
var _nextAuth$useSession = client
|
|
565
|
-
_nextAuth$useSession2 = slicedToArray._slicedToArray(_nextAuth$useSession, 2),
|
|
1880
|
+
var _nextAuth$useSession = client.useSession(),
|
|
1881
|
+
_nextAuth$useSession2 = slicedToArray$1._slicedToArray(_nextAuth$useSession, 2),
|
|
566
1882
|
session = _nextAuth$useSession2[0],
|
|
567
1883
|
loading = _nextAuth$useSession2[1];
|
|
568
1884
|
|
|
569
1885
|
var _useState = React.useState(null),
|
|
570
|
-
_useState2 = slicedToArray._slicedToArray(_useState, 2),
|
|
1886
|
+
_useState2 = slicedToArray$1._slicedToArray(_useState, 2),
|
|
571
1887
|
callbackUrl = _useState2[0],
|
|
572
1888
|
setCallbackUrl = _useState2[1];
|
|
573
1889
|
|
|
574
1890
|
var _useState3 = React.useState(),
|
|
575
|
-
_useState4 = slicedToArray._slicedToArray(_useState3, 2),
|
|
1891
|
+
_useState4 = slicedToArray$1._slicedToArray(_useState3, 2),
|
|
576
1892
|
email = _useState4[0],
|
|
577
1893
|
setEmail = _useState4[1];
|
|
578
1894
|
|
|
579
1895
|
var _useState5 = React.useState(false),
|
|
580
|
-
_useState6 = slicedToArray._slicedToArray(_useState5, 2),
|
|
1896
|
+
_useState6 = slicedToArray$1._slicedToArray(_useState5, 2),
|
|
581
1897
|
showForm = _useState6[0],
|
|
582
1898
|
setShowForm = _useState6[1];
|
|
583
1899
|
|
|
584
1900
|
var _useState7 = React.useState(),
|
|
585
|
-
_useState8 = slicedToArray._slicedToArray(_useState7, 2),
|
|
1901
|
+
_useState8 = slicedToArray$1._slicedToArray(_useState7, 2),
|
|
586
1902
|
password = _useState8[0],
|
|
587
1903
|
setPassword = _useState8[1];
|
|
588
1904
|
|
|
@@ -591,7 +1907,7 @@ var AuthWrapper = function AuthWrapper(_ref) {
|
|
|
591
1907
|
}, []);
|
|
592
1908
|
|
|
593
1909
|
if (session || !needAuth) {
|
|
594
|
-
return React__default.createElement(
|
|
1910
|
+
return React__default['default'].createElement(
|
|
595
1911
|
'div',
|
|
596
1912
|
null,
|
|
597
1913
|
children
|
|
@@ -599,57 +1915,57 @@ var AuthWrapper = function AuthWrapper(_ref) {
|
|
|
599
1915
|
}
|
|
600
1916
|
|
|
601
1917
|
if (!loading) {
|
|
602
|
-
return React__default.createElement(
|
|
1918
|
+
return React__default['default'].createElement(
|
|
603
1919
|
'div',
|
|
604
1920
|
{ style: { position: 'relative', minHeight: '300px', paddingTop: '2rem' } },
|
|
605
|
-
callbackUrl && React__default.createElement(
|
|
1921
|
+
callbackUrl && React__default['default'].createElement(
|
|
606
1922
|
'div',
|
|
607
1923
|
null,
|
|
608
|
-
!showForm && React__default.createElement(
|
|
1924
|
+
!showForm && React__default['default'].createElement(
|
|
609
1925
|
'div',
|
|
610
1926
|
{ className: styles.loginBox },
|
|
611
|
-
React__default.createElement(
|
|
1927
|
+
React__default['default'].createElement(
|
|
612
1928
|
'div',
|
|
613
1929
|
{ className: styles.loginBox_title },
|
|
614
|
-
React__default.createElement(
|
|
1930
|
+
React__default['default'].createElement(
|
|
615
1931
|
'b',
|
|
616
1932
|
null,
|
|
617
1933
|
'Please log in to view this content.'
|
|
618
1934
|
)
|
|
619
1935
|
),
|
|
620
|
-
React__default.createElement(
|
|
1936
|
+
React__default['default'].createElement(
|
|
621
1937
|
reactBootstrap.Form,
|
|
622
1938
|
{ onSubmit: function onSubmit(e) {
|
|
623
1939
|
return e.preventDefault();
|
|
624
1940
|
} },
|
|
625
|
-
React__default.createElement(
|
|
1941
|
+
React__default['default'].createElement(
|
|
626
1942
|
reactBootstrap.Form.Group,
|
|
627
1943
|
{ controlId: 'email' },
|
|
628
|
-
React__default.createElement(reactBootstrap.Form.Control, { type: 'email', onChange: function onChange(e) {
|
|
1944
|
+
React__default['default'].createElement(reactBootstrap.Form.Control, { type: 'email', onChange: function onChange(e) {
|
|
629
1945
|
return setEmail(e.target.value);
|
|
630
1946
|
}, placeholder: 'Email' })
|
|
631
1947
|
),
|
|
632
|
-
React__default.createElement(
|
|
1948
|
+
React__default['default'].createElement(
|
|
633
1949
|
reactBootstrap.Form.Group,
|
|
634
1950
|
{ controlId: 'password' },
|
|
635
|
-
React__default.createElement(reactBootstrap.Form.Control, { type: 'password', onChange: function onChange(e) {
|
|
1951
|
+
React__default['default'].createElement(reactBootstrap.Form.Control, { type: 'password', onChange: function onChange(e) {
|
|
636
1952
|
return setPassword(e.target.value);
|
|
637
1953
|
}, placeholder: 'Password' })
|
|
638
1954
|
),
|
|
639
|
-
React__default.createElement(
|
|
1955
|
+
React__default['default'].createElement(
|
|
640
1956
|
'button',
|
|
641
1957
|
{ className: 'btn btn-primary btn-block', onClick: function onClick() {
|
|
642
|
-
return client
|
|
1958
|
+
return client.signIn('credentials', { email: email, password: password, callbackUrl: callbackUrl });
|
|
643
1959
|
} },
|
|
644
1960
|
'Sign in'
|
|
645
1961
|
)
|
|
646
1962
|
),
|
|
647
|
-
React__default.createElement(
|
|
1963
|
+
React__default['default'].createElement(
|
|
648
1964
|
'p',
|
|
649
1965
|
{ style: { textAlign: 'center' }, className: 'mt-2 mb-0' },
|
|
650
1966
|
'Don\'t have an account?',
|
|
651
1967
|
' ',
|
|
652
|
-
React__default.createElement(
|
|
1968
|
+
React__default['default'].createElement(
|
|
653
1969
|
'a',
|
|
654
1970
|
{ style: { color: 'blue', textDecoration: 'underline' }, onClick: function onClick() {
|
|
655
1971
|
return setShowForm(!showForm);
|
|
@@ -658,13 +1974,13 @@ var AuthWrapper = function AuthWrapper(_ref) {
|
|
|
658
1974
|
),
|
|
659
1975
|
' to register.'
|
|
660
1976
|
),
|
|
661
|
-
React__default.createElement(
|
|
1977
|
+
React__default['default'].createElement(
|
|
662
1978
|
'p',
|
|
663
1979
|
{ className: 'mt-1', style: { fontSize: '.8em', textAlign: 'center' } },
|
|
664
|
-
React__default.createElement(
|
|
1980
|
+
React__default['default'].createElement(
|
|
665
1981
|
'em',
|
|
666
1982
|
null,
|
|
667
|
-
React__default.createElement(
|
|
1983
|
+
React__default['default'].createElement(
|
|
668
1984
|
'a',
|
|
669
1985
|
{ href: '/forgotpassword', style: { color: 'blue', textDecoration: 'underline' } },
|
|
670
1986
|
'Forgot your password? '
|
|
@@ -672,7 +1988,7 @@ var AuthWrapper = function AuthWrapper(_ref) {
|
|
|
672
1988
|
)
|
|
673
1989
|
)
|
|
674
1990
|
),
|
|
675
|
-
showForm && React__default.createElement('iframe', { className: styles.iframe, src: formUrl })
|
|
1991
|
+
showForm && React__default['default'].createElement('iframe', { className: styles.iframe, src: formUrl })
|
|
676
1992
|
)
|
|
677
1993
|
);
|
|
678
1994
|
} else {
|