@mjhls/mjh-framework 1.0.854 → 1.0.855-beta.0
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 +9 -10
- package/dist/cjs/AD300x250.js +30 -31
- package/dist/cjs/AD300x250x600.js +30 -31
- package/dist/cjs/AD728x90.js +33 -34
- package/dist/cjs/ADFloatingFooter.js +32 -33
- package/dist/cjs/ADFooter.js +14 -15
- package/dist/cjs/ADGutter.js +32 -33
- package/dist/cjs/{ADInfeed-fb136f1d.js → ADInfeed-98c71bcd.js} +13 -15
- package/dist/cjs/ADSkyscraper.js +32 -33
- package/dist/cjs/ADSponsoredResources.js +32 -33
- package/dist/cjs/ADWebcast.js +32 -33
- package/dist/cjs/ADWelcome.js +33 -34
- package/dist/cjs/{ADlgInfeed-d303d27e.js → ADlgInfeed-9de32585.js} +10 -11
- package/dist/cjs/AccordionPanel.js +29 -31
- package/dist/cjs/AdSlot.js +35 -36
- package/dist/cjs/AdSlotsProvider.js +911 -20
- package/dist/cjs/AlgoliaSearch.js +1274 -1392
- package/dist/cjs/AlphabeticList.js +25 -26
- package/dist/cjs/ArticleCarousel.js +23 -24
- package/dist/cjs/ArticleProgramLandingPage.js +59 -60
- package/dist/cjs/ArticleSeriesLandingPage.js +40 -41
- package/dist/cjs/ArticleSeriesListing.js +61 -62
- package/dist/cjs/Auth.js +1506 -682
- package/dist/cjs/AuthWrapper.js +269 -311
- package/dist/cjs/{AuthorComponent-c21aac7f.js → AuthorComponent-bb831b74.js} +13 -14
- package/dist/cjs/Beam.js +8 -8
- package/dist/cjs/{BlockContent-36e54d77.js → BlockContent-091a991f.js} +55 -56
- package/dist/cjs/Breadcrumbs.js +27 -29
- package/dist/cjs/CMEDeck.js +83 -83
- package/dist/cjs/Column1.js +11 -14
- package/dist/cjs/Column2.js +33 -36
- package/dist/cjs/Column3.js +59 -62
- package/dist/cjs/ConferenceArticleCard.js +37 -38
- package/dist/cjs/ConferenceBanner-4a16fddc.js +23 -0
- package/dist/cjs/DeckContent.js +103 -107
- package/dist/cjs/DeckQueue.js +88 -92
- package/dist/cjs/{Dfp-93399f8c.js → Dfp-26baccf1.js} +34 -35
- package/dist/cjs/EventsDeck.js +152 -159
- package/dist/cjs/ExternalResources.js +80 -81
- package/dist/cjs/Feature.js +24 -26
- package/dist/cjs/ForbesHero.js +42 -43
- package/dist/cjs/GridContent.js +233 -238
- package/dist/cjs/GridHero.js +44 -45
- package/dist/cjs/GroupDeck.js +59 -60
- package/dist/cjs/HamMagazine.js +140 -145
- package/dist/cjs/Header.js +12 -14
- package/dist/cjs/Hero.js +12 -13
- package/dist/cjs/HighlightenVideo.js +17 -18
- package/dist/cjs/HorizontalArticleListing.js +72 -73
- package/dist/cjs/HorizontalHero.js +24 -25
- package/dist/cjs/IssueContentDeck.js +73 -78
- package/dist/cjs/IssueDeck.js +72 -77
- package/dist/cjs/IssueLanding.js +95 -96
- package/dist/cjs/KMTracker.js +15 -15
- package/dist/cjs/LeftNav.js +39 -41
- package/dist/cjs/MasterDeck.js +80 -81
- package/dist/cjs/MediaSeriesLanding.js +1125 -1116
- package/dist/cjs/NavDvm.js +74 -79
- package/dist/cjs/{NavFooter-3dcd99a8.js → NavFooter-76c913e3.js} +14 -15
- package/dist/cjs/NavMagazine.js +147 -152
- package/dist/cjs/NavNative.js +139 -147
- package/dist/cjs/OncliveHero.js +19 -19
- package/dist/cjs/OncliveLargeHero.js +72 -73
- package/dist/cjs/PageFilter.js +14 -15
- package/dist/cjs/PartnerDetailListing.js +1206 -109
- package/dist/cjs/PdfDownload.js +8 -9
- package/dist/cjs/PopUpModal.js +19 -21
- package/dist/cjs/PubSection.js +42 -43
- package/dist/cjs/PubToc.js +15 -16
- package/dist/cjs/PublicationDeck.js +62 -67
- package/dist/cjs/PublicationLanding.js +135 -139
- package/dist/cjs/QueueDeckExpanded.js +310 -310
- package/dist/cjs/RecentNews.js +21 -22
- package/dist/cjs/RelatedContent.js +54 -55
- package/dist/cjs/RelatedTopicsDropdown.js +29 -32
- package/dist/cjs/RolesDeck.js +27 -32
- package/dist/cjs/Search.js +18 -22
- package/dist/cjs/Segment.js +6 -6
- package/dist/cjs/SeriesListingDeck.js +38 -38
- package/dist/cjs/{SeriesSlider-cbab9f0f.js → SeriesSlider-8bbc989f.js} +39 -40
- package/dist/cjs/SetCookie.js +1 -1
- package/dist/cjs/SideFooter.js +38 -39
- package/dist/cjs/SocialIcons.js +9 -10
- package/dist/cjs/{SocialSearchComponent-ecb4f972.js → SocialSearchComponent-cea213aa.js} +36 -40
- package/dist/cjs/SocialShare.js +29 -31
- package/dist/cjs/TaxonomyCard.js +59 -64
- package/dist/cjs/TaxonomyDescription.js +55 -56
- package/dist/cjs/TemplateNormal.js +74 -75
- package/dist/cjs/ThumbnailCard.js +21 -23
- package/dist/cjs/Ustream.js +29 -30
- package/dist/cjs/VerticalHero.js +16 -17
- package/dist/cjs/VideoProgramLandingPage.js +74 -78
- package/dist/cjs/VideoSeriesCard.js +32 -33
- package/dist/cjs/VideoSeriesFilter.js +18 -18
- package/dist/cjs/VideoSeriesLandingPage.js +49 -50
- package/dist/cjs/VideoSeriesListing.js +78 -79
- package/dist/cjs/View.js +263 -266
- package/dist/cjs/YahooHero.js +41 -42
- package/dist/cjs/YoutubeGroup.js +66 -67
- package/dist/cjs/{_is-array-6128bd56.js → _is-array-754e012d.js} +6 -6
- package/dist/cjs/{_iter-detect-55a5657a.js → _iter-detect-60b2f026.js} +8 -8
- package/dist/cjs/{_object-pie-083f2dd6.js → _object-pie-68c5bcbc.js} +4 -4
- package/dist/cjs/{_object-sap-a175b4a9.js → _object-sap-5e74ba08.js} +1 -1
- package/dist/cjs/{_object-to-array-8fe5a54f.js → _object-to-array-5762f850.js} +2 -2
- package/dist/cjs/{_to-object-6de10e57.js → _to-object-329a650b.js} +8 -8
- package/dist/cjs/{asyncToGenerator-58c289d9.js → asyncToGenerator-140e5f89.js} +32 -32
- package/dist/cjs/{brightcove-react-player-loader.es-a195642e.js → brightcove-react-player-loader.es-156bd4d6.js} +9 -11
- package/dist/cjs/{core.get-iterator-method-f474eacc.js → core.get-iterator-method-f62321d4.js} +2 -2
- package/dist/cjs/{debounce-d4a2369b.js → debounce-529c8d06.js} +2 -2
- package/dist/cjs/{define-property-c88be878.js → define-property-f4d12f4e.js} +6 -6
- package/dist/cjs/{defineProperty-0cb76d99.js → defineProperty-55548b25.js} +1 -1
- package/dist/cjs/{entities-3f9d0f2f.js → entities-310b46ee.js} +1 -1
- package/dist/cjs/{eq-5fc26c07.js → eq-bb2843ed.js} +1 -1
- package/dist/cjs/{es6.string.iterator-c2573ffd.js → es6.string.iterator-cc0bbaa4.js} +6 -6
- package/dist/cjs/{extends-29bdbc6d.js → extends-0a918631.js} +7 -7
- package/dist/cjs/faundadb.js +7 -7
- package/dist/cjs/{get-5839e5b5.js → get-adbb11e3.js} +21 -21
- package/dist/cjs/getRelatedArticle.js +20 -20
- package/dist/cjs/getRootDocGroup.js +6 -6
- package/dist/cjs/getSerializers.js +45 -45
- package/dist/cjs/{getTargeting-faf37284.js → getTargeting-f1821260.js} +12 -12
- package/dist/cjs/getTargeting.js +8 -8
- package/dist/cjs/iconBase-68959171.js +3 -0
- package/dist/cjs/{index-f86bb269.js → index-3294d3bc.js} +45 -44
- package/dist/cjs/{index-d8793467.js → index-665ed72e.js} +1090 -1089
- package/dist/cjs/{index-eadd5035.js → index-96b3db50.js} +15 -17
- package/dist/cjs/{index-fc2f1ca2.js → index-98e01cb9.js} +12 -13
- package/dist/cjs/{index-efca863c.js → index-be0c82be.js} +30 -36
- package/dist/cjs/{index-8041a4eb.js → index-e2e62963.js} +1 -11
- package/dist/cjs/{index.es-f3e47207.js → index.es-9110add6.js} +12 -31
- package/dist/cjs/{index.esm-8123cf40.js → index.esm-4d410430.js} +20 -20
- package/dist/cjs/{index.esm-974f47d9.js → index.esm-90433435.js} +15 -6
- package/dist/cjs/{index.esm-44f3e2d0.js → index.esm-e32d3e8e.js} +6 -3
- package/dist/cjs/{index.esm-05850a2f.js → index.esm-ff47db6f.js} +12 -5
- package/dist/cjs/index.js +166 -171
- package/dist/cjs/{inherits-c2065b95.js → inherits-452ff02c.js} +19 -19
- package/dist/cjs/inherits-8d29278d.js +110 -0
- package/dist/cjs/{isSymbol-03abbdf0.js → isSymbol-04666465.js} +15 -15
- package/dist/cjs/keys-a586b7a0.js +25 -0
- package/dist/cjs/{lodash-f0783643.js → lodash-fc2922d0.js} +31 -128
- package/dist/cjs/main-02daeefe.js +862 -0
- package/dist/cjs/{md5-e1ca5797.js → md5-5039b1a6.js} +1 -1
- package/dist/cjs/{moment-aca40de1.js → moment-575fe24c.js} +9 -11
- package/dist/cjs/{react-social-icons-af932527.js → react-social-icons-f7f48f71.js} +27 -28
- package/dist/cjs/{slicedToArray-5d1bc3b3.js → slicedToArray-8f385299.js} +14 -14
- package/dist/cjs/{smoothscroll-99df7f93.js → smoothscroll-5054361f.js} +1 -1
- package/dist/cjs/stringify-7c5aff47.js +17 -0
- package/dist/cjs/timeDifferenceCalc.js +1 -1
- package/dist/cjs/{toConsumableArray-ddb70795.js → toConsumableArray-9a3476fe.js} +9 -9
- package/dist/cjs/{toNumber-5e1fac58.js → toNumber-36d1e7e5.js} +5 -40
- package/dist/cjs/{typeof-88a668c5.js → typeof-725500bc.js} +36 -36
- package/dist/cjs/urlFor.js +3 -3
- package/dist/cjs/{ustream-api-b2b9092f.js → ustream-api-d092dc31.js} +4 -4
- package/dist/cjs/{util-6f784d85.js → util-f2c1b65b.js} +1 -1
- package/dist/cjs/{visibility-sensor-eb2c5b69.js → visibility-sensor-ad5e3116.js} +5 -7
- package/dist/cjs/{web.dom.iterable-46657b5c.js → web.dom.iterable-a0e279c1.js} +3 -3
- package/dist/esm/AD.js +7 -7
- package/dist/esm/AD300x250.js +27 -27
- package/dist/esm/AD300x250x600.js +27 -27
- package/dist/esm/AD728x90.js +30 -30
- package/dist/esm/ADFloatingFooter.js +29 -29
- package/dist/esm/ADFooter.js +11 -11
- package/dist/esm/ADGutter.js +29 -29
- package/dist/esm/{ADInfeed-df562a07.js → ADInfeed-1cc9d817.js} +11 -11
- package/dist/esm/ADSkyscraper.js +29 -29
- package/dist/esm/ADSponsoredResources.js +29 -29
- package/dist/esm/ADWebcast.js +29 -29
- package/dist/esm/ADWelcome.js +30 -30
- package/dist/esm/{ADlgInfeed-53992119.js → ADlgInfeed-8c4f129e.js} +8 -8
- package/dist/esm/AccordionPanel.js +24 -24
- package/dist/esm/AdSlot.js +27 -27
- package/dist/esm/AdSlotsProvider.js +909 -17
- package/dist/esm/AlgoliaSearch.js +703 -820
- package/dist/esm/AlphabeticList.js +22 -22
- package/dist/esm/ArticleCarousel.js +20 -20
- package/dist/esm/ArticleProgramLandingPage.js +56 -56
- package/dist/esm/ArticleSeriesLandingPage.js +37 -37
- package/dist/esm/ArticleSeriesListing.js +57 -57
- package/dist/esm/Auth.js +1489 -661
- package/dist/esm/AuthWrapper.js +267 -308
- package/dist/esm/{AuthorComponent-5ae7409f.js → AuthorComponent-34b16174.js} +11 -11
- package/dist/esm/Beam.js +8 -8
- package/dist/esm/{BlockContent-52cf21c5.js → BlockContent-e9b4ddcf.js} +35 -35
- package/dist/esm/Breadcrumbs.js +17 -17
- package/dist/esm/CMEDeck.js +79 -79
- package/dist/esm/Column1.js +9 -9
- package/dist/esm/Column2.js +30 -30
- package/dist/esm/Column3.js +56 -56
- package/dist/esm/ConferenceArticleCard.js +35 -35
- package/dist/esm/{ConferenceBanner-9162d0ca.js → ConferenceBanner-8792ebd2.js} +4 -4
- package/dist/esm/DeckContent.js +98 -98
- package/dist/esm/DeckQueue.js +83 -83
- package/dist/esm/{Dfp-43f121ff.js → Dfp-b7236041.js} +22 -22
- package/dist/esm/EventsDeck.js +129 -129
- package/dist/esm/ExternalResources.js +74 -74
- package/dist/esm/Feature.js +18 -18
- package/dist/esm/ForbesHero.js +35 -35
- package/dist/esm/GridContent.js +201 -201
- package/dist/esm/GridHero.js +37 -37
- package/dist/esm/GroupDeck.js +47 -47
- package/dist/esm/HamMagazine.js +116 -116
- package/dist/esm/Header.js +8 -8
- package/dist/esm/Hero.js +10 -10
- package/dist/esm/HighlightenVideo.js +14 -14
- package/dist/esm/HorizontalArticleListing.js +69 -69
- package/dist/esm/HorizontalHero.js +22 -22
- package/dist/esm/IssueContentDeck.js +61 -61
- package/dist/esm/IssueDeck.js +65 -65
- package/dist/esm/IssueLanding.js +92 -92
- package/dist/esm/KMTracker.js +15 -15
- package/dist/esm/LeftNav.js +35 -35
- package/dist/esm/MasterDeck.js +77 -77
- package/dist/esm/MediaSeriesLanding.js +853 -841
- package/dist/esm/NavDvm.js +59 -59
- package/dist/esm/{NavFooter-c29526b7.js → NavFooter-e27bd93b.js} +12 -12
- package/dist/esm/NavMagazine.js +126 -126
- package/dist/esm/NavNative.js +116 -116
- package/dist/esm/OncliveHero.js +17 -16
- package/dist/esm/OncliveLargeHero.js +60 -60
- package/dist/esm/PageFilter.js +12 -12
- package/dist/esm/PartnerDetailListing.js +1204 -107
- package/dist/esm/PdfDownload.js +6 -6
- package/dist/esm/PopUpModal.js +14 -14
- package/dist/esm/PubSection.js +39 -39
- package/dist/esm/PubToc.js +12 -12
- package/dist/esm/PublicationDeck.js +53 -53
- package/dist/esm/PublicationLanding.js +122 -122
- package/dist/esm/QueueDeckExpanded.js +275 -275
- package/dist/esm/RecentNews.js +19 -19
- package/dist/esm/RelatedContent.js +48 -48
- package/dist/esm/RelatedTopicsDropdown.js +21 -21
- package/dist/esm/RolesDeck.js +25 -25
- package/dist/esm/Search.js +13 -13
- package/dist/esm/Segment.js +6 -6
- package/dist/esm/SeriesListingDeck.js +32 -32
- package/dist/esm/{SeriesSlider-5c62a578.js → SeriesSlider-a866bb21.js} +31 -31
- package/dist/esm/SetCookie.js +1 -1
- package/dist/esm/SideFooter.js +34 -34
- package/dist/esm/SocialIcons.js +7 -7
- package/dist/esm/{SocialSearchComponent-cd38ae60.js → SocialSearchComponent-03c3e869.js} +30 -30
- package/dist/esm/SocialShare.js +25 -25
- package/dist/esm/TaxonomyCard.js +54 -54
- package/dist/esm/TaxonomyDescription.js +50 -50
- package/dist/esm/TemplateNormal.js +70 -70
- package/dist/esm/ThumbnailCard.js +14 -14
- package/dist/esm/Ustream.js +26 -26
- package/dist/esm/VerticalHero.js +14 -14
- package/dist/esm/VideoProgramLandingPage.js +67 -67
- package/dist/esm/VideoSeriesCard.js +26 -26
- package/dist/esm/VideoSeriesFilter.js +15 -15
- package/dist/esm/VideoSeriesLandingPage.js +42 -42
- package/dist/esm/VideoSeriesListing.js +74 -74
- package/dist/esm/View.js +248 -247
- package/dist/esm/YahooHero.js +35 -35
- package/dist/esm/YoutubeGroup.js +51 -51
- package/dist/esm/{_is-array-3e99e06e.js → _is-array-58e95429.js} +6 -6
- package/dist/esm/{_iter-detect-7e5e5ce2.js → _iter-detect-5d49a330.js} +8 -8
- package/dist/esm/{_object-pie-133f504a.js → _object-pie-33c40e79.js} +4 -4
- package/dist/esm/{_object-sap-f353c2a9.js → _object-sap-964b6feb.js} +1 -1
- package/dist/esm/{_object-to-array-0f197f89.js → _object-to-array-7e804fce.js} +2 -2
- package/dist/esm/{_to-object-b50e61c3.js → _to-object-a4107da3.js} +9 -9
- package/dist/esm/{asyncToGenerator-7f8f9219.js → asyncToGenerator-fc1c2e29.js} +32 -32
- package/dist/esm/{brightcove-react-player-loader.es-b43c695a.js → brightcove-react-player-loader.es-83f53e4e.js} +6 -7
- package/dist/esm/{core.get-iterator-method-133dfacd.js → core.get-iterator-method-e1de7503.js} +2 -2
- package/dist/esm/{debounce-533d9748.js → debounce-9207d8ee.js} +2 -2
- package/dist/esm/{define-property-fe54dc9f.js → define-property-8af5f002.js} +6 -6
- package/dist/esm/{defineProperty-f5ff6f5a.js → defineProperty-94fd8bfc.js} +1 -1
- package/dist/esm/{entities-932b50cf.js → entities-7cc3bf45.js} +1 -1
- package/dist/esm/{eq-bdcbf886.js → eq-b470f743.js} +1 -1
- package/dist/esm/{es6.string.iterator-bc33758b.js → es6.string.iterator-c990c18c.js} +7 -7
- package/dist/esm/{extends-60e0e1c6.js → extends-6f2fcc99.js} +7 -7
- package/dist/esm/faundadb.js +7 -7
- package/dist/esm/{get-3c308da4.js → get-1e515072.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-c3401fa7.js → getTargeting-bd800589.js} +11 -11
- package/dist/esm/getTargeting.js +8 -8
- package/dist/esm/{index-2446af28.js → index-41a678ea.js} +6 -6
- package/dist/esm/{index-35bdcc81.js → index-5f7e79e7.js} +10 -10
- package/dist/esm/{index-0dbff1d1.js → index-73819142.js} +30 -36
- package/dist/esm/{index-ffedd1e8.js → index-8ea04db3.js} +1049 -1038
- package/dist/esm/{index-67e1773f.js → index-aaa2dae0.js} +2 -11
- package/dist/esm/{index-79cfd25c.js → index-ef6d5dcf.js} +45 -44
- package/dist/esm/{index.es-c6222053.js → index.es-29c1cef5.js} +10 -28
- package/dist/esm/{index.esm-3fdda599.js → index.esm-29e48d38.js} +15 -6
- package/dist/esm/{index.esm-a8ff922c.js → index.esm-cf08bf18.js} +12 -5
- package/dist/esm/{index.esm-c6715e80.js → index.esm-f8aaeeeb.js} +6 -3
- package/dist/esm/{index.esm-8016b507.js → index.esm-fd746768.js} +18 -17
- package/dist/esm/index.js +139 -141
- package/dist/esm/inherits-77d5e4fc.js +101 -0
- package/dist/esm/{inherits-a41fe93f.js → inherits-cf8dde54.js} +19 -19
- package/dist/esm/{isSymbol-a7e9aafe.js → isSymbol-1981418f.js} +15 -15
- package/dist/esm/{keys-7a3adabf.js → keys-8eda7a5c.js} +6 -6
- package/dist/esm/{lodash-f97fd99a.js → lodash-17fdfebb.js} +31 -128
- package/dist/esm/main-e4a934b2.js +851 -0
- package/dist/esm/{md5-4e42248e.js → md5-9be0e905.js} +1 -1
- package/dist/esm/{moment-bc12cb97.js → moment-e2f9b20c.js} +9 -11
- package/dist/esm/{react-social-icons-91f9716f.js → react-social-icons-a7d5c5c7.js} +20 -20
- package/dist/esm/{slicedToArray-be2f7a22.js → slicedToArray-641f241f.js} +14 -14
- package/dist/esm/{smoothscroll-fa4e3f8c.js → smoothscroll-0cd4c7a6.js} +1 -1
- package/dist/esm/stringify-4330ccdc.js +15 -0
- package/dist/esm/timeDifferenceCalc.js +1 -1
- package/dist/esm/{toConsumableArray-6d9a4616.js → toConsumableArray-43aa614d.js} +9 -9
- package/dist/esm/{toNumber-5aeba6e7.js → toNumber-2f7a84cd.js} +5 -40
- package/dist/esm/{typeof-a286cf0c.js → typeof-6435ba1c.js} +36 -36
- package/dist/esm/urlFor.js +1 -1
- package/dist/esm/{ustream-api-33a866b6.js → ustream-api-9a50644d.js} +4 -4
- package/dist/esm/{util-3ab476bf.js → util-7700fc59.js} +1 -1
- package/dist/esm/{visibility-sensor-f40c2564.js → visibility-sensor-72fd8f8b.js} +2 -2
- package/dist/esm/{web.dom.iterable-4109ff68.js → web.dom.iterable-4439f05a.js} +3 -3
- package/package.json +110 -110
- package/dist/cjs/ConferenceBanner-6c9e718a.js +0 -24
- package/dist/cjs/keys-7f2c2108.js +0 -25
- package/dist/cjs/main-025fdc78.js +0 -973
- package/dist/cjs/stringify-c9ac1214.js +0 -17
- package/dist/esm/main-b5c5aac1.js +0 -961
- package/dist/esm/stringify-59c8f690.js +0 -15
package/dist/esm/Auth.js
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { a as commonjsGlobal } from './_commonjsHelpers-0c4b6f40.js';
|
|
2
|
+
import './_to-object-a4107da3.js';
|
|
3
|
+
import './es6.string.iterator-c990c18c.js';
|
|
4
|
+
import './_library-528f1934.js';
|
|
5
|
+
import './_iter-detect-5d49a330.js';
|
|
6
|
+
import './core.get-iterator-method-e1de7503.js';
|
|
7
|
+
import './_object-pie-33c40e79.js';
|
|
8
|
+
import { _ as _extends } from './extends-6f2fcc99.js';
|
|
9
|
+
import './web.dom.iterable-4439f05a.js';
|
|
10
|
+
import React__default, { useEffect, useLayoutEffect, createContext, useContext, useRef, useDebugValue, useState, useCallback, useMemo } from 'react';
|
|
5
11
|
import Router from 'next/router';
|
|
6
|
-
import { _ as
|
|
12
|
+
import { _ as _slicedToArray, a as _getIterator } from './slicedToArray-641f241f.js';
|
|
13
|
+
import { _ as _JSON$stringify } from './stringify-4330ccdc.js';
|
|
14
|
+
import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-fc1c2e29.js';
|
|
7
15
|
import { Col, Form, Button, Spinner } from 'react-bootstrap';
|
|
8
|
-
import
|
|
16
|
+
import { u as util } from './util-7700fc59.js';
|
|
9
17
|
import { s as serialize_1, p as parse_1 } from './index-db3bb315.js';
|
|
10
18
|
import Local from 'passport-local';
|
|
11
19
|
import mysql from 'mysql';
|
|
12
|
-
import {
|
|
13
|
-
import { c as createCommonjsModule } from './_commonjsHelpers-0c4b6f40.js';
|
|
14
|
-
import { m as md5 } from './md5-4e42248e.js';
|
|
15
|
-
import './es6.string.iterator-bc33758b.js';
|
|
16
|
-
import './_to-object-b50e61c3.js';
|
|
17
|
-
import './web.dom.iterable-4109ff68.js';
|
|
18
|
-
import './_library-528f1934.js';
|
|
19
|
-
import './core.get-iterator-method-133dfacd.js';
|
|
20
|
-
import './_iter-detect-7e5e5ce2.js';
|
|
21
|
-
import './_object-pie-133f504a.js';
|
|
20
|
+
import { m as md5 } from './md5-9be0e905.js';
|
|
22
21
|
|
|
23
22
|
var returnFormField = function returnFormField(_ref) {
|
|
24
23
|
var name = _ref.name,
|
|
@@ -57,21 +56,21 @@ var returnFormField = function returnFormField(_ref) {
|
|
|
57
56
|
}
|
|
58
57
|
|
|
59
58
|
if (type == 'text' || type == 'email' || type == 'password' || type == 'number') {
|
|
60
|
-
return
|
|
59
|
+
return React__default.createElement(
|
|
61
60
|
Form.Group,
|
|
62
61
|
_extends({}, opts, { controlId: name }),
|
|
63
|
-
|
|
62
|
+
React__default.createElement(
|
|
64
63
|
Form.Label,
|
|
65
64
|
{ kye: name + '_label' },
|
|
66
65
|
label,
|
|
67
|
-
required &&
|
|
66
|
+
required && React__default.createElement(
|
|
68
67
|
'span',
|
|
69
68
|
{ style: { color: 'red' } },
|
|
70
69
|
'*'
|
|
71
70
|
)
|
|
72
71
|
),
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
React__default.createElement(Form.Control, { key: name + '_' + type, type: type, readOnly: readonly, name: name, placeholder: '', defaultValue: default_value, required: required }),
|
|
73
|
+
React__default.createElement(
|
|
75
74
|
Form.Control.Feedback,
|
|
76
75
|
{ key: name + '_feedback', type: 'invalid' },
|
|
77
76
|
errors[name]
|
|
@@ -79,28 +78,28 @@ var returnFormField = function returnFormField(_ref) {
|
|
|
79
78
|
);
|
|
80
79
|
}
|
|
81
80
|
if (type == 'select') {
|
|
82
|
-
return
|
|
81
|
+
return React__default.createElement(
|
|
83
82
|
Form.Group,
|
|
84
83
|
_extends({}, opts, { key: name, controlId: name }),
|
|
85
|
-
|
|
84
|
+
React__default.createElement(
|
|
86
85
|
Form.Label,
|
|
87
86
|
{ key: name + '_' + label },
|
|
88
87
|
label,
|
|
89
|
-
required &&
|
|
88
|
+
required && React__default.createElement(
|
|
90
89
|
'span',
|
|
91
90
|
{ key: name + '_required_span', style: { color: 'red' } },
|
|
92
91
|
'*'
|
|
93
92
|
)
|
|
94
93
|
),
|
|
95
|
-
|
|
94
|
+
React__default.createElement(
|
|
96
95
|
Form.Control,
|
|
97
96
|
{ key: name + '_select', as: 'select', name: name, required: required, defaultValue: default_value },
|
|
98
|
-
|
|
97
|
+
React__default.createElement('option', { value: '', key: name + '_options_empty' }),
|
|
99
98
|
options.map(function (option, index) {
|
|
100
99
|
var value = option.value ? option.value : option;
|
|
101
100
|
var label = option.label ? option.label : option;
|
|
102
101
|
var key = name + '_options_' + index;
|
|
103
|
-
return
|
|
102
|
+
return React__default.createElement(
|
|
104
103
|
'option',
|
|
105
104
|
{ key: key, value: value },
|
|
106
105
|
label
|
|
@@ -111,32 +110,1081 @@ var returnFormField = function returnFormField(_ref) {
|
|
|
111
110
|
}
|
|
112
111
|
|
|
113
112
|
if (type == 'radio' || type == 'checkbox') {
|
|
114
|
-
return
|
|
113
|
+
return React__default.createElement(
|
|
115
114
|
Form.Group,
|
|
116
115
|
opts,
|
|
117
|
-
|
|
116
|
+
React__default.createElement(
|
|
118
117
|
Form.Label,
|
|
119
118
|
null,
|
|
120
119
|
label,
|
|
121
|
-
required &&
|
|
120
|
+
required && React__default.createElement(
|
|
122
121
|
'span',
|
|
123
122
|
{ style: { color: 'red' } },
|
|
124
123
|
'*'
|
|
125
124
|
)
|
|
126
125
|
),
|
|
127
126
|
options.map(function (option, index) {
|
|
128
|
-
return
|
|
127
|
+
return React__default.createElement(
|
|
129
128
|
Form.Check,
|
|
130
129
|
{ type: type, key: index, required: required },
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
React__default.createElement(Form.Check.Input, { type: type, key: type + '_' + index + '_input', defaultChecked: default_value ? default_value === option.value : false, name: name, id: name + '_' + index, value: option.value, required: required }),
|
|
131
|
+
React__default.createElement(Form.Check.Label, { style: { cursor: 'pointer' }, 'for': name + '_' + index, key: type + '_' + index + '_label', dangerouslySetInnerHTML: { __html: option.label } })
|
|
133
132
|
);
|
|
134
133
|
})
|
|
135
134
|
);
|
|
136
135
|
}
|
|
137
136
|
};
|
|
138
137
|
|
|
139
|
-
var
|
|
138
|
+
var has = Object.prototype.hasOwnProperty;
|
|
139
|
+
|
|
140
|
+
function dequal(foo, bar) {
|
|
141
|
+
var ctor, len;
|
|
142
|
+
if (foo === bar) return true;
|
|
143
|
+
|
|
144
|
+
if (foo && bar && (ctor=foo.constructor) === bar.constructor) {
|
|
145
|
+
if (ctor === Date) return foo.getTime() === bar.getTime();
|
|
146
|
+
if (ctor === RegExp) return foo.toString() === bar.toString();
|
|
147
|
+
|
|
148
|
+
if (ctor === Array) {
|
|
149
|
+
if ((len=foo.length) === bar.length) {
|
|
150
|
+
while (len-- && dequal(foo[len], bar[len]));
|
|
151
|
+
}
|
|
152
|
+
return len === -1;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (!ctor || typeof foo === 'object') {
|
|
156
|
+
len = 0;
|
|
157
|
+
for (ctor in foo) {
|
|
158
|
+
if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
|
|
159
|
+
if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
|
|
160
|
+
}
|
|
161
|
+
return Object.keys(bar).length === len;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return foo !== foo && bar !== bar;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// use WeakMap to store the object->key mapping
|
|
169
|
+
// so the objects can be garbage collected.
|
|
170
|
+
// WeakMap uses a hashtable under the hood, so the lookup
|
|
171
|
+
// complexity is almost O(1).
|
|
172
|
+
var table = new WeakMap();
|
|
173
|
+
// counter of the key
|
|
174
|
+
var counter = 0;
|
|
175
|
+
// hashes an array of objects and returns a string
|
|
176
|
+
function hash(args) {
|
|
177
|
+
if (!args.length)
|
|
178
|
+
return '';
|
|
179
|
+
var key = 'arg';
|
|
180
|
+
for (var i = 0; i < args.length; ++i) {
|
|
181
|
+
if (args[i] === null) {
|
|
182
|
+
key += '@null';
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
var _hash = void 0;
|
|
186
|
+
if (typeof args[i] !== 'object' && typeof args[i] !== 'function') {
|
|
187
|
+
// need to consider the case that args[i] is a string:
|
|
188
|
+
// args[i] _hash
|
|
189
|
+
// "undefined" -> '"undefined"'
|
|
190
|
+
// undefined -> 'undefined'
|
|
191
|
+
// 123 -> '123'
|
|
192
|
+
// "null" -> '"null"'
|
|
193
|
+
if (typeof args[i] === 'string') {
|
|
194
|
+
_hash = '"' + args[i] + '"';
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
_hash = String(args[i]);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
if (!table.has(args[i])) {
|
|
202
|
+
_hash = counter;
|
|
203
|
+
table.set(args[i], counter++);
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
_hash = table.get(args[i]);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
key += '@' + _hash;
|
|
210
|
+
}
|
|
211
|
+
return key;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
var Cache = /** @class */ (function () {
|
|
215
|
+
function Cache(initialData) {
|
|
216
|
+
if (initialData === void 0) { initialData = {}; }
|
|
217
|
+
this.cache = new Map(Object.entries(initialData));
|
|
218
|
+
this.subs = [];
|
|
219
|
+
}
|
|
220
|
+
Cache.prototype.get = function (key) {
|
|
221
|
+
var _key = this.serializeKey(key)[0];
|
|
222
|
+
return this.cache.get(_key);
|
|
223
|
+
};
|
|
224
|
+
Cache.prototype.set = function (key, value) {
|
|
225
|
+
var _key = this.serializeKey(key)[0];
|
|
226
|
+
this.cache.set(_key, value);
|
|
227
|
+
this.notify();
|
|
228
|
+
};
|
|
229
|
+
Cache.prototype.keys = function () {
|
|
230
|
+
return Array.from(this.cache.keys());
|
|
231
|
+
};
|
|
232
|
+
Cache.prototype.has = function (key) {
|
|
233
|
+
var _key = this.serializeKey(key)[0];
|
|
234
|
+
return this.cache.has(_key);
|
|
235
|
+
};
|
|
236
|
+
Cache.prototype.clear = function () {
|
|
237
|
+
this.cache.clear();
|
|
238
|
+
this.notify();
|
|
239
|
+
};
|
|
240
|
+
Cache.prototype.delete = function (key) {
|
|
241
|
+
var _key = this.serializeKey(key)[0];
|
|
242
|
+
this.cache.delete(_key);
|
|
243
|
+
this.notify();
|
|
244
|
+
};
|
|
245
|
+
// TODO: introduce namespace for the cache
|
|
246
|
+
Cache.prototype.serializeKey = function (key) {
|
|
247
|
+
var args = null;
|
|
248
|
+
if (typeof key === 'function') {
|
|
249
|
+
try {
|
|
250
|
+
key = key();
|
|
251
|
+
}
|
|
252
|
+
catch (err) {
|
|
253
|
+
// dependencies not ready
|
|
254
|
+
key = '';
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
if (Array.isArray(key)) {
|
|
258
|
+
// args array
|
|
259
|
+
args = key;
|
|
260
|
+
key = hash(key);
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
// convert null to ''
|
|
264
|
+
key = String(key || '');
|
|
265
|
+
}
|
|
266
|
+
var errorKey = key ? 'err@' + key : '';
|
|
267
|
+
var isValidatingKey = key ? 'validating@' + key : '';
|
|
268
|
+
return [key, args, errorKey, isValidatingKey];
|
|
269
|
+
};
|
|
270
|
+
Cache.prototype.subscribe = function (listener) {
|
|
271
|
+
var _this = this;
|
|
272
|
+
if (typeof listener !== 'function') {
|
|
273
|
+
throw new Error('Expected the listener to be a function.');
|
|
274
|
+
}
|
|
275
|
+
var isSubscribed = true;
|
|
276
|
+
this.subs.push(listener);
|
|
277
|
+
return function () {
|
|
278
|
+
if (!isSubscribed)
|
|
279
|
+
return;
|
|
280
|
+
isSubscribed = false;
|
|
281
|
+
var index = _this.subs.indexOf(listener);
|
|
282
|
+
if (index > -1) {
|
|
283
|
+
_this.subs[index] = _this.subs[_this.subs.length - 1];
|
|
284
|
+
_this.subs.length--;
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
// Notify Cache subscribers about a change in the cache
|
|
289
|
+
Cache.prototype.notify = function () {
|
|
290
|
+
for (var _i = 0, _a = this.subs; _i < _a.length; _i++) {
|
|
291
|
+
var listener = _a[_i];
|
|
292
|
+
listener();
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
return Cache;
|
|
296
|
+
}());
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Due to bug https://bugs.chromium.org/p/chromium/issues/detail?id=678075,
|
|
300
|
+
* it's not reliable to detect if the browser is currently online or offline
|
|
301
|
+
* based on `navigator.onLine`.
|
|
302
|
+
* As a work around, we always assume it's online on first load, and change
|
|
303
|
+
* the status upon `online` or `offline` events.
|
|
304
|
+
*/
|
|
305
|
+
var online = true;
|
|
306
|
+
var isOnline = function () { return online; };
|
|
307
|
+
var isDocumentVisible = function () {
|
|
308
|
+
if (typeof document !== 'undefined' &&
|
|
309
|
+
document.visibilityState !== undefined) {
|
|
310
|
+
return document.visibilityState !== 'hidden';
|
|
311
|
+
}
|
|
312
|
+
// always assume it's visible
|
|
313
|
+
return true;
|
|
314
|
+
};
|
|
315
|
+
var fetcher = function (url) { return fetch(url).then(function (res) { return res.json(); }); };
|
|
316
|
+
var registerOnFocus = function (cb) {
|
|
317
|
+
if (typeof window !== 'undefined' &&
|
|
318
|
+
window.addEventListener !== undefined &&
|
|
319
|
+
typeof document !== 'undefined' &&
|
|
320
|
+
document.addEventListener !== undefined) {
|
|
321
|
+
// focus revalidate
|
|
322
|
+
document.addEventListener('visibilitychange', function () { return cb(); }, false);
|
|
323
|
+
window.addEventListener('focus', function () { return cb(); }, false);
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
var registerOnReconnect = function (cb) {
|
|
327
|
+
if (typeof window !== 'undefined' && window.addEventListener !== undefined) {
|
|
328
|
+
// reconnect revalidate
|
|
329
|
+
window.addEventListener('online', function () {
|
|
330
|
+
online = true;
|
|
331
|
+
cb();
|
|
332
|
+
}, false);
|
|
333
|
+
// nothing to revalidate, just update the status
|
|
334
|
+
window.addEventListener('offline', function () { return (online = false); }, false);
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
var webPreset = {
|
|
338
|
+
isOnline: isOnline,
|
|
339
|
+
isDocumentVisible: isDocumentVisible,
|
|
340
|
+
fetcher: fetcher,
|
|
341
|
+
registerOnFocus: registerOnFocus,
|
|
342
|
+
registerOnReconnect: registerOnReconnect
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
var __assign = (undefined && undefined.__assign) || function () {
|
|
346
|
+
__assign = Object.assign || function(t) {
|
|
347
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
348
|
+
s = arguments[i];
|
|
349
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
350
|
+
t[p] = s[p];
|
|
351
|
+
}
|
|
352
|
+
return t;
|
|
353
|
+
};
|
|
354
|
+
return __assign.apply(this, arguments);
|
|
355
|
+
};
|
|
356
|
+
// cache
|
|
357
|
+
var cache = new Cache();
|
|
358
|
+
// error retry
|
|
359
|
+
function onErrorRetry(_, __, config, revalidate, opts) {
|
|
360
|
+
if (!config.isDocumentVisible()) {
|
|
361
|
+
// if it's hidden, stop
|
|
362
|
+
// it will auto revalidate when focus
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
if (typeof config.errorRetryCount === 'number' &&
|
|
366
|
+
opts.retryCount > config.errorRetryCount) {
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
// exponential backoff
|
|
370
|
+
var count = Math.min(opts.retryCount, 8);
|
|
371
|
+
var timeout = ~~((Math.random() + 0.5) * (1 << count)) * config.errorRetryInterval;
|
|
372
|
+
setTimeout(revalidate, timeout, opts);
|
|
373
|
+
}
|
|
374
|
+
// client side: need to adjust the config
|
|
375
|
+
// based on the browser status
|
|
376
|
+
// slow connection (<= 70Kbps)
|
|
377
|
+
var slowConnection = typeof window !== 'undefined' &&
|
|
378
|
+
// @ts-ignore
|
|
379
|
+
navigator['connection'] &&
|
|
380
|
+
// @ts-ignore
|
|
381
|
+
['slow-2g', '2g'].indexOf(navigator['connection'].effectiveType) !== -1;
|
|
382
|
+
// config
|
|
383
|
+
var defaultConfig = __assign({
|
|
384
|
+
// events
|
|
385
|
+
onLoadingSlow: function () { }, onSuccess: function () { }, onError: function () { }, onErrorRetry: onErrorRetry, errorRetryInterval: (slowConnection ? 10 : 5) * 1000, focusThrottleInterval: 5 * 1000, dedupingInterval: 2 * 1000, loadingTimeout: (slowConnection ? 5 : 3) * 1000, refreshInterval: 0, revalidateOnFocus: true, revalidateOnReconnect: true, refreshWhenHidden: false, refreshWhenOffline: false, shouldRetryOnError: true, suspense: false, compare: dequal, isPaused: function () { return false; } }, webPreset);
|
|
386
|
+
|
|
387
|
+
var IS_SERVER = typeof window === 'undefined' ||
|
|
388
|
+
// @ts-ignore
|
|
389
|
+
!!(typeof Deno !== 'undefined' && Deno && Deno.version && Deno.version.deno);
|
|
390
|
+
// polyfill for requestAnimationFrame
|
|
391
|
+
var rAF = IS_SERVER
|
|
392
|
+
? null
|
|
393
|
+
: window['requestAnimationFrame']
|
|
394
|
+
? function (f) { return window['requestAnimationFrame'](f); }
|
|
395
|
+
: function (f) { return setTimeout(f, 1); };
|
|
396
|
+
// React currently throws a warning when using useLayoutEffect on the server.
|
|
397
|
+
// To get around it, we can conditionally useEffect on the server (no-op) and
|
|
398
|
+
// useLayoutEffect in the browser.
|
|
399
|
+
var useIsomorphicLayoutEffect = IS_SERVER ? useEffect : useLayoutEffect;
|
|
400
|
+
|
|
401
|
+
var SWRConfigContext = createContext({});
|
|
402
|
+
SWRConfigContext.displayName = 'SWRConfigContext';
|
|
403
|
+
|
|
404
|
+
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
405
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
406
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
407
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
408
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
409
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
410
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
411
|
+
});
|
|
412
|
+
};
|
|
413
|
+
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
|
|
414
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
415
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
416
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
417
|
+
function step(op) {
|
|
418
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
419
|
+
while (_) try {
|
|
420
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
421
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
422
|
+
switch (op[0]) {
|
|
423
|
+
case 0: case 1: t = op; break;
|
|
424
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
425
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
426
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
427
|
+
default:
|
|
428
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
429
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
430
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
431
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
432
|
+
if (t[2]) _.ops.pop();
|
|
433
|
+
_.trys.pop(); continue;
|
|
434
|
+
}
|
|
435
|
+
op = body.call(thisArg, _);
|
|
436
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
437
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
// global state managers
|
|
441
|
+
var CONCURRENT_PROMISES = {};
|
|
442
|
+
var CONCURRENT_PROMISES_TS = {};
|
|
443
|
+
var FOCUS_REVALIDATORS = {};
|
|
444
|
+
var RECONNECT_REVALIDATORS = {};
|
|
445
|
+
var CACHE_REVALIDATORS = {};
|
|
446
|
+
var MUTATION_TS = {};
|
|
447
|
+
var MUTATION_END_TS = {};
|
|
448
|
+
// generate strictly increasing timestamps
|
|
449
|
+
var now = (function () {
|
|
450
|
+
var ts = 0;
|
|
451
|
+
return function () { return ++ts; };
|
|
452
|
+
})();
|
|
453
|
+
// setup DOM events listeners for `focus` and `reconnect` actions
|
|
454
|
+
if (!IS_SERVER) {
|
|
455
|
+
var revalidate_1 = function (revalidators) {
|
|
456
|
+
if (!defaultConfig.isDocumentVisible() || !defaultConfig.isOnline())
|
|
457
|
+
return;
|
|
458
|
+
for (var key in revalidators) {
|
|
459
|
+
if (revalidators[key][0])
|
|
460
|
+
revalidators[key][0]();
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
if (typeof defaultConfig.registerOnFocus === 'function') {
|
|
464
|
+
defaultConfig.registerOnFocus(function () { return revalidate_1(FOCUS_REVALIDATORS); });
|
|
465
|
+
}
|
|
466
|
+
if (typeof defaultConfig.registerOnReconnect === 'function') {
|
|
467
|
+
defaultConfig.registerOnReconnect(function () { return revalidate_1(RECONNECT_REVALIDATORS); });
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
var trigger = function (_key, shouldRevalidate) {
|
|
471
|
+
if (shouldRevalidate === void 0) { shouldRevalidate = true; }
|
|
472
|
+
// we are ignoring the second argument which correspond to the arguments
|
|
473
|
+
// the fetcher will receive when key is an array
|
|
474
|
+
var _a = cache.serializeKey(_key), key = _a[0], keyErr = _a[2], keyValidating = _a[3];
|
|
475
|
+
if (!key)
|
|
476
|
+
return Promise.resolve();
|
|
477
|
+
var updaters = CACHE_REVALIDATORS[key];
|
|
478
|
+
if (key && updaters) {
|
|
479
|
+
var currentData = cache.get(key);
|
|
480
|
+
var currentError = cache.get(keyErr);
|
|
481
|
+
var currentIsValidating = cache.get(keyValidating);
|
|
482
|
+
var promises = [];
|
|
483
|
+
for (var i = 0; i < updaters.length; ++i) {
|
|
484
|
+
promises.push(updaters[i](shouldRevalidate, currentData, currentError, currentIsValidating, i > 0));
|
|
485
|
+
}
|
|
486
|
+
// return new updated value
|
|
487
|
+
return Promise.all(promises).then(function () { return cache.get(key); });
|
|
488
|
+
}
|
|
489
|
+
return Promise.resolve(cache.get(key));
|
|
490
|
+
};
|
|
491
|
+
var broadcastState = function (key, data, error, isValidating) {
|
|
492
|
+
var updaters = CACHE_REVALIDATORS[key];
|
|
493
|
+
if (key && updaters) {
|
|
494
|
+
for (var i = 0; i < updaters.length; ++i) {
|
|
495
|
+
updaters[i](false, data, error, isValidating);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
};
|
|
499
|
+
var mutate = function (_key, _data, shouldRevalidate) {
|
|
500
|
+
if (shouldRevalidate === void 0) { shouldRevalidate = true; }
|
|
501
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
502
|
+
var _a, key, keyErr, beforeMutationTs, beforeConcurrentPromisesTs, data, error, isAsyncMutation, err_1, shouldAbort, updaters, promises, i;
|
|
503
|
+
return __generator(this, function (_b) {
|
|
504
|
+
switch (_b.label) {
|
|
505
|
+
case 0:
|
|
506
|
+
_a = cache.serializeKey(_key), key = _a[0], keyErr = _a[2];
|
|
507
|
+
if (!key)
|
|
508
|
+
return [2 /*return*/];
|
|
509
|
+
// if there is no new data to update, let's just revalidate the key
|
|
510
|
+
if (typeof _data === 'undefined')
|
|
511
|
+
return [2 /*return*/, trigger(_key, shouldRevalidate)
|
|
512
|
+
// update global timestamps
|
|
513
|
+
];
|
|
514
|
+
// update global timestamps
|
|
515
|
+
MUTATION_TS[key] = now() - 1;
|
|
516
|
+
MUTATION_END_TS[key] = 0;
|
|
517
|
+
beforeMutationTs = MUTATION_TS[key];
|
|
518
|
+
beforeConcurrentPromisesTs = CONCURRENT_PROMISES_TS[key];
|
|
519
|
+
isAsyncMutation = false;
|
|
520
|
+
if (_data && typeof _data === 'function') {
|
|
521
|
+
// `_data` is a function, call it passing current cache value
|
|
522
|
+
try {
|
|
523
|
+
_data = _data(cache.get(key));
|
|
524
|
+
}
|
|
525
|
+
catch (err) {
|
|
526
|
+
// if `_data` function throws an error synchronously, it shouldn't be cached
|
|
527
|
+
_data = undefined;
|
|
528
|
+
error = err;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
if (!(_data && typeof _data.then === 'function')) return [3 /*break*/, 5];
|
|
532
|
+
// `_data` is a promise
|
|
533
|
+
isAsyncMutation = true;
|
|
534
|
+
_b.label = 1;
|
|
535
|
+
case 1:
|
|
536
|
+
_b.trys.push([1, 3, , 4]);
|
|
537
|
+
return [4 /*yield*/, _data];
|
|
538
|
+
case 2:
|
|
539
|
+
data = _b.sent();
|
|
540
|
+
return [3 /*break*/, 4];
|
|
541
|
+
case 3:
|
|
542
|
+
err_1 = _b.sent();
|
|
543
|
+
error = err_1;
|
|
544
|
+
return [3 /*break*/, 4];
|
|
545
|
+
case 4: return [3 /*break*/, 6];
|
|
546
|
+
case 5:
|
|
547
|
+
data = _data;
|
|
548
|
+
_b.label = 6;
|
|
549
|
+
case 6:
|
|
550
|
+
shouldAbort = function () {
|
|
551
|
+
// check if other mutations have occurred since we've started this mutation
|
|
552
|
+
if (beforeMutationTs !== MUTATION_TS[key] ||
|
|
553
|
+
beforeConcurrentPromisesTs !== CONCURRENT_PROMISES_TS[key]) {
|
|
554
|
+
if (error)
|
|
555
|
+
throw error;
|
|
556
|
+
return true;
|
|
557
|
+
}
|
|
558
|
+
};
|
|
559
|
+
// if there's a race we don't update cache or broadcast change, just return the data
|
|
560
|
+
if (shouldAbort())
|
|
561
|
+
return [2 /*return*/, data];
|
|
562
|
+
if (typeof data !== 'undefined') {
|
|
563
|
+
// update cached data
|
|
564
|
+
cache.set(key, data);
|
|
565
|
+
}
|
|
566
|
+
// always update or reset the error
|
|
567
|
+
cache.set(keyErr, error);
|
|
568
|
+
// reset the timestamp to mark the mutation has ended
|
|
569
|
+
MUTATION_END_TS[key] = now() - 1;
|
|
570
|
+
if (!isAsyncMutation) {
|
|
571
|
+
// we skip broadcasting if there's another mutation happened synchronously
|
|
572
|
+
if (shouldAbort())
|
|
573
|
+
return [2 /*return*/, data];
|
|
574
|
+
}
|
|
575
|
+
updaters = CACHE_REVALIDATORS[key];
|
|
576
|
+
if (updaters) {
|
|
577
|
+
promises = [];
|
|
578
|
+
for (i = 0; i < updaters.length; ++i) {
|
|
579
|
+
promises.push(updaters[i](!!shouldRevalidate, data, error, undefined, i > 0));
|
|
580
|
+
}
|
|
581
|
+
// return new updated value
|
|
582
|
+
return [2 /*return*/, Promise.all(promises).then(function () {
|
|
583
|
+
if (error)
|
|
584
|
+
throw error;
|
|
585
|
+
return cache.get(key);
|
|
586
|
+
})];
|
|
587
|
+
}
|
|
588
|
+
// throw error or return data to be used by caller of mutate
|
|
589
|
+
if (error)
|
|
590
|
+
throw error;
|
|
591
|
+
return [2 /*return*/, data];
|
|
592
|
+
}
|
|
593
|
+
});
|
|
594
|
+
});
|
|
595
|
+
};
|
|
596
|
+
function useSWR() {
|
|
597
|
+
var _this = this;
|
|
598
|
+
var args = [];
|
|
599
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
600
|
+
args[_i] = arguments[_i];
|
|
601
|
+
}
|
|
602
|
+
var _key = args[0];
|
|
603
|
+
var config = Object.assign({}, defaultConfig, useContext(SWRConfigContext), args.length > 2
|
|
604
|
+
? args[2]
|
|
605
|
+
: args.length === 2 && typeof args[1] === 'object'
|
|
606
|
+
? args[1]
|
|
607
|
+
: {});
|
|
608
|
+
// in typescript args.length > 2 is not same as args.lenth === 3
|
|
609
|
+
// we do a safe type assertion here
|
|
610
|
+
// args.length === 3
|
|
611
|
+
var fn = (args.length > 2
|
|
612
|
+
? args[1]
|
|
613
|
+
: args.length === 2 && typeof args[1] === 'function'
|
|
614
|
+
? args[1]
|
|
615
|
+
: /**
|
|
616
|
+
pass fn as null will disable revalidate
|
|
617
|
+
https://paco.sh/blog/shared-hook-state-with-swr
|
|
618
|
+
*/
|
|
619
|
+
args[1] === null
|
|
620
|
+
? args[1]
|
|
621
|
+
: config.fetcher);
|
|
622
|
+
// we assume `key` as the identifier of the request
|
|
623
|
+
// `key` can change but `fn` shouldn't
|
|
624
|
+
// (because `revalidate` only depends on `key`)
|
|
625
|
+
// `keyErr` is the cache key for error objects
|
|
626
|
+
var _a = cache.serializeKey(_key), key = _a[0], fnArgs = _a[1], keyErr = _a[2], keyValidating = _a[3];
|
|
627
|
+
var configRef = useRef(config);
|
|
628
|
+
useIsomorphicLayoutEffect(function () {
|
|
629
|
+
configRef.current = config;
|
|
630
|
+
});
|
|
631
|
+
var willRevalidateOnMount = function () {
|
|
632
|
+
return (config.revalidateOnMount ||
|
|
633
|
+
(!config.initialData && config.revalidateOnMount === undefined));
|
|
634
|
+
};
|
|
635
|
+
var resolveData = function () {
|
|
636
|
+
var cachedData = cache.get(key);
|
|
637
|
+
return typeof cachedData === 'undefined' ? config.initialData : cachedData;
|
|
638
|
+
};
|
|
639
|
+
var resolveIsValidating = function () {
|
|
640
|
+
return !!cache.get(keyValidating) || (key && willRevalidateOnMount());
|
|
641
|
+
};
|
|
642
|
+
var initialData = resolveData();
|
|
643
|
+
var initialError = cache.get(keyErr);
|
|
644
|
+
var initialIsValidating = resolveIsValidating();
|
|
645
|
+
// if a state is accessed (data, error or isValidating),
|
|
646
|
+
// we add the state to dependencies so if the state is
|
|
647
|
+
// updated in the future, we can trigger a rerender
|
|
648
|
+
var stateDependencies = useRef({
|
|
649
|
+
data: false,
|
|
650
|
+
error: false,
|
|
651
|
+
isValidating: false
|
|
652
|
+
});
|
|
653
|
+
var stateRef = useRef({
|
|
654
|
+
data: initialData,
|
|
655
|
+
error: initialError,
|
|
656
|
+
isValidating: initialIsValidating
|
|
657
|
+
});
|
|
658
|
+
// display the data label in the React DevTools next to SWR hooks
|
|
659
|
+
useDebugValue(stateRef.current.data);
|
|
660
|
+
var rerender = useState({})[1];
|
|
661
|
+
var dispatch = useCallback(function (payload) {
|
|
662
|
+
var shouldUpdateState = false;
|
|
663
|
+
for (var k in payload) {
|
|
664
|
+
// @ts-ignore
|
|
665
|
+
if (stateRef.current[k] === payload[k]) {
|
|
666
|
+
continue;
|
|
667
|
+
}
|
|
668
|
+
// @ts-ignore
|
|
669
|
+
stateRef.current[k] = payload[k];
|
|
670
|
+
// @ts-ignore
|
|
671
|
+
if (stateDependencies.current[k]) {
|
|
672
|
+
shouldUpdateState = true;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
if (shouldUpdateState) {
|
|
676
|
+
// if component is unmounted, should skip rerender
|
|
677
|
+
// if component is not mounted, should skip rerender
|
|
678
|
+
if (unmountedRef.current || !initialMountedRef.current)
|
|
679
|
+
return;
|
|
680
|
+
rerender({});
|
|
681
|
+
}
|
|
682
|
+
},
|
|
683
|
+
// config.suspense isn't allowed to change during the lifecycle
|
|
684
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
685
|
+
[]);
|
|
686
|
+
// error ref inside revalidate (is last request errored?)
|
|
687
|
+
var unmountedRef = useRef(false);
|
|
688
|
+
var keyRef = useRef(key);
|
|
689
|
+
// check if component is mounted in suspense mode
|
|
690
|
+
var initialMountedRef = useRef(false);
|
|
691
|
+
// do unmount check for callbacks
|
|
692
|
+
var eventsCallback = useCallback(function (event) {
|
|
693
|
+
var _a;
|
|
694
|
+
var params = [];
|
|
695
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
696
|
+
params[_i - 1] = arguments[_i];
|
|
697
|
+
}
|
|
698
|
+
if (unmountedRef.current)
|
|
699
|
+
return;
|
|
700
|
+
if (!initialMountedRef.current)
|
|
701
|
+
return;
|
|
702
|
+
if (key !== keyRef.current)
|
|
703
|
+
return;
|
|
704
|
+
// @ts-ignore
|
|
705
|
+
(_a = configRef.current)[event].apply(_a, params);
|
|
706
|
+
}, [key]);
|
|
707
|
+
var boundMutate = useCallback(function (data, shouldRevalidate) {
|
|
708
|
+
return mutate(keyRef.current, data, shouldRevalidate);
|
|
709
|
+
}, []);
|
|
710
|
+
var addRevalidator = function (revalidators, callback) {
|
|
711
|
+
if (!revalidators[key]) {
|
|
712
|
+
revalidators[key] = [callback];
|
|
713
|
+
}
|
|
714
|
+
else {
|
|
715
|
+
revalidators[key].push(callback);
|
|
716
|
+
}
|
|
717
|
+
return function () {
|
|
718
|
+
var keyedRevalidators = revalidators[key];
|
|
719
|
+
var index = keyedRevalidators.indexOf(callback);
|
|
720
|
+
if (index >= 0) {
|
|
721
|
+
// O(1): faster than splice
|
|
722
|
+
keyedRevalidators[index] =
|
|
723
|
+
keyedRevalidators[keyedRevalidators.length - 1];
|
|
724
|
+
keyedRevalidators.pop();
|
|
725
|
+
}
|
|
726
|
+
};
|
|
727
|
+
};
|
|
728
|
+
// start a revalidation
|
|
729
|
+
var revalidate = useCallback(function (revalidateOpts) {
|
|
730
|
+
if (revalidateOpts === void 0) { revalidateOpts = {}; }
|
|
731
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
732
|
+
var _a, retryCount, _b, dedupe, loading, shouldDeduping, newData, startAt, newState, err_2;
|
|
733
|
+
return __generator(this, function (_c) {
|
|
734
|
+
switch (_c.label) {
|
|
735
|
+
case 0:
|
|
736
|
+
if (!key || !fn)
|
|
737
|
+
return [2 /*return*/, false];
|
|
738
|
+
if (unmountedRef.current)
|
|
739
|
+
return [2 /*return*/, false];
|
|
740
|
+
if (configRef.current.isPaused())
|
|
741
|
+
return [2 /*return*/, false];
|
|
742
|
+
_a = revalidateOpts.retryCount, retryCount = _a === void 0 ? 0 : _a, _b = revalidateOpts.dedupe, dedupe = _b === void 0 ? false : _b;
|
|
743
|
+
loading = true;
|
|
744
|
+
shouldDeduping = typeof CONCURRENT_PROMISES[key] !== 'undefined' && dedupe;
|
|
745
|
+
_c.label = 1;
|
|
746
|
+
case 1:
|
|
747
|
+
_c.trys.push([1, 6, , 7]);
|
|
748
|
+
dispatch({
|
|
749
|
+
isValidating: true
|
|
750
|
+
});
|
|
751
|
+
cache.set(keyValidating, true);
|
|
752
|
+
if (!shouldDeduping) {
|
|
753
|
+
// also update other hooks
|
|
754
|
+
broadcastState(key, stateRef.current.data, stateRef.current.error, true);
|
|
755
|
+
}
|
|
756
|
+
newData = void 0;
|
|
757
|
+
startAt = void 0;
|
|
758
|
+
if (!shouldDeduping) return [3 /*break*/, 3];
|
|
759
|
+
// there's already an ongoing request,
|
|
760
|
+
// this one needs to be deduplicated.
|
|
761
|
+
startAt = CONCURRENT_PROMISES_TS[key];
|
|
762
|
+
return [4 /*yield*/, CONCURRENT_PROMISES[key]];
|
|
763
|
+
case 2:
|
|
764
|
+
newData = _c.sent();
|
|
765
|
+
return [3 /*break*/, 5];
|
|
766
|
+
case 3:
|
|
767
|
+
// if no cache being rendered currently (it shows a blank page),
|
|
768
|
+
// we trigger the loading slow event.
|
|
769
|
+
if (config.loadingTimeout && !cache.get(key)) {
|
|
770
|
+
setTimeout(function () {
|
|
771
|
+
if (loading)
|
|
772
|
+
eventsCallback('onLoadingSlow', key, config);
|
|
773
|
+
}, config.loadingTimeout);
|
|
774
|
+
}
|
|
775
|
+
if (fnArgs !== null) {
|
|
776
|
+
CONCURRENT_PROMISES[key] = fn.apply(void 0, fnArgs);
|
|
777
|
+
}
|
|
778
|
+
else {
|
|
779
|
+
CONCURRENT_PROMISES[key] = fn(key);
|
|
780
|
+
}
|
|
781
|
+
CONCURRENT_PROMISES_TS[key] = startAt = now();
|
|
782
|
+
return [4 /*yield*/, CONCURRENT_PROMISES[key]];
|
|
783
|
+
case 4:
|
|
784
|
+
newData = _c.sent();
|
|
785
|
+
setTimeout(function () {
|
|
786
|
+
delete CONCURRENT_PROMISES[key];
|
|
787
|
+
delete CONCURRENT_PROMISES_TS[key];
|
|
788
|
+
}, config.dedupingInterval);
|
|
789
|
+
// trigger the success event,
|
|
790
|
+
// only do this for the original request.
|
|
791
|
+
eventsCallback('onSuccess', newData, key, config);
|
|
792
|
+
_c.label = 5;
|
|
793
|
+
case 5:
|
|
794
|
+
// if there're other ongoing request(s), started after the current one,
|
|
795
|
+
// we need to ignore the current one to avoid possible race conditions:
|
|
796
|
+
// req1------------------>res1 (current one)
|
|
797
|
+
// req2---------------->res2
|
|
798
|
+
// the request that fired later will always be kept.
|
|
799
|
+
if (CONCURRENT_PROMISES_TS[key] > startAt) {
|
|
800
|
+
return [2 /*return*/, false];
|
|
801
|
+
}
|
|
802
|
+
// if there're other mutations(s), overlapped with the current revalidation:
|
|
803
|
+
// case 1:
|
|
804
|
+
// req------------------>res
|
|
805
|
+
// mutate------>end
|
|
806
|
+
// case 2:
|
|
807
|
+
// req------------>res
|
|
808
|
+
// mutate------>end
|
|
809
|
+
// case 3:
|
|
810
|
+
// req------------------>res
|
|
811
|
+
// mutate-------...---------->
|
|
812
|
+
// we have to ignore the revalidation result (res) because it's no longer fresh.
|
|
813
|
+
// meanwhile, a new revalidation should be triggered when the mutation ends.
|
|
814
|
+
if (MUTATION_TS[key] &&
|
|
815
|
+
// case 1
|
|
816
|
+
(startAt <= MUTATION_TS[key] ||
|
|
817
|
+
// case 2
|
|
818
|
+
startAt <= MUTATION_END_TS[key] ||
|
|
819
|
+
// case 3
|
|
820
|
+
MUTATION_END_TS[key] === 0)) {
|
|
821
|
+
dispatch({ isValidating: false });
|
|
822
|
+
return [2 /*return*/, false];
|
|
823
|
+
}
|
|
824
|
+
cache.set(keyErr, undefined);
|
|
825
|
+
cache.set(keyValidating, false);
|
|
826
|
+
newState = {
|
|
827
|
+
isValidating: false
|
|
828
|
+
};
|
|
829
|
+
if (typeof stateRef.current.error !== 'undefined') {
|
|
830
|
+
// we don't have an error
|
|
831
|
+
newState.error = undefined;
|
|
832
|
+
}
|
|
833
|
+
if (!config.compare(stateRef.current.data, newData)) {
|
|
834
|
+
// deep compare to avoid extra re-render
|
|
835
|
+
// data changed
|
|
836
|
+
newState.data = newData;
|
|
837
|
+
}
|
|
838
|
+
if (!config.compare(cache.get(key), newData)) {
|
|
839
|
+
cache.set(key, newData);
|
|
840
|
+
}
|
|
841
|
+
// merge the new state
|
|
842
|
+
dispatch(newState);
|
|
843
|
+
if (!shouldDeduping) {
|
|
844
|
+
// also update other hooks
|
|
845
|
+
broadcastState(key, newData, newState.error, false);
|
|
846
|
+
}
|
|
847
|
+
return [3 /*break*/, 7];
|
|
848
|
+
case 6:
|
|
849
|
+
err_2 = _c.sent();
|
|
850
|
+
delete CONCURRENT_PROMISES[key];
|
|
851
|
+
delete CONCURRENT_PROMISES_TS[key];
|
|
852
|
+
if (configRef.current.isPaused()) {
|
|
853
|
+
dispatch({
|
|
854
|
+
isValidating: false
|
|
855
|
+
});
|
|
856
|
+
return [2 /*return*/, false];
|
|
857
|
+
}
|
|
858
|
+
cache.set(keyErr, err_2);
|
|
859
|
+
// get a new error
|
|
860
|
+
// don't use deep equal for errors
|
|
861
|
+
if (stateRef.current.error !== err_2) {
|
|
862
|
+
// we keep the stale data
|
|
863
|
+
dispatch({
|
|
864
|
+
isValidating: false,
|
|
865
|
+
error: err_2
|
|
866
|
+
});
|
|
867
|
+
if (!shouldDeduping) {
|
|
868
|
+
// also broadcast to update other hooks
|
|
869
|
+
broadcastState(key, undefined, err_2, false);
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
// events and retry
|
|
873
|
+
eventsCallback('onError', err_2, key, config);
|
|
874
|
+
if (config.shouldRetryOnError) {
|
|
875
|
+
// when retrying, we always enable deduping
|
|
876
|
+
eventsCallback('onErrorRetry', err_2, key, config, revalidate, {
|
|
877
|
+
retryCount: retryCount + 1,
|
|
878
|
+
dedupe: true
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
return [3 /*break*/, 7];
|
|
882
|
+
case 7:
|
|
883
|
+
loading = false;
|
|
884
|
+
return [2 /*return*/, true];
|
|
885
|
+
}
|
|
886
|
+
});
|
|
887
|
+
});
|
|
888
|
+
},
|
|
889
|
+
// dispatch is immutable, and `eventsCallback`, `fnArgs`, `keyErr`, and `keyValidating` are based on `key`,
|
|
890
|
+
// so we can them from the deps array.
|
|
891
|
+
//
|
|
892
|
+
// FIXME:
|
|
893
|
+
// `fn` and `config` might be changed during the lifecycle,
|
|
894
|
+
// but they might be changed every render like this.
|
|
895
|
+
// useSWR('key', () => fetch('/api/'), { suspense: true })
|
|
896
|
+
// So we omit the values from the deps array
|
|
897
|
+
// even though it might cause unexpected behaviors.
|
|
898
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
899
|
+
[key]);
|
|
900
|
+
// mounted (client side rendering)
|
|
901
|
+
useIsomorphicLayoutEffect(function () {
|
|
902
|
+
if (!key)
|
|
903
|
+
return undefined;
|
|
904
|
+
// after `key` updates, we need to mark it as mounted
|
|
905
|
+
unmountedRef.current = false;
|
|
906
|
+
var isUpdating = initialMountedRef.current;
|
|
907
|
+
initialMountedRef.current = true;
|
|
908
|
+
// after the component is mounted (hydrated),
|
|
909
|
+
// we need to update the data from the cache
|
|
910
|
+
// and trigger a revalidation
|
|
911
|
+
var currentHookData = stateRef.current.data;
|
|
912
|
+
var latestKeyedData = resolveData();
|
|
913
|
+
// update the state if the key changed (not the inital render) or cache updated
|
|
914
|
+
keyRef.current = key;
|
|
915
|
+
if (!config.compare(currentHookData, latestKeyedData)) {
|
|
916
|
+
dispatch({ data: latestKeyedData });
|
|
917
|
+
}
|
|
918
|
+
// revalidate with deduping
|
|
919
|
+
var softRevalidate = function () { return revalidate({ dedupe: true }); };
|
|
920
|
+
// trigger a revalidation
|
|
921
|
+
if (isUpdating || willRevalidateOnMount()) {
|
|
922
|
+
if (typeof latestKeyedData !== 'undefined' && !IS_SERVER) {
|
|
923
|
+
// delay revalidate if there's cache
|
|
924
|
+
// to not block the rendering
|
|
925
|
+
// @ts-ignore it's safe to use requestAnimationFrame in browser
|
|
926
|
+
rAF(softRevalidate);
|
|
927
|
+
}
|
|
928
|
+
else {
|
|
929
|
+
softRevalidate();
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
var pending = false;
|
|
933
|
+
var onFocus = function () {
|
|
934
|
+
if (pending || !configRef.current.revalidateOnFocus)
|
|
935
|
+
return;
|
|
936
|
+
pending = true;
|
|
937
|
+
softRevalidate();
|
|
938
|
+
setTimeout(function () { return (pending = false); }, configRef.current.focusThrottleInterval);
|
|
939
|
+
};
|
|
940
|
+
var onReconnect = function () {
|
|
941
|
+
if (configRef.current.revalidateOnReconnect) {
|
|
942
|
+
softRevalidate();
|
|
943
|
+
}
|
|
944
|
+
};
|
|
945
|
+
// register global cache update listener
|
|
946
|
+
var onUpdate = function (shouldRevalidate, updatedData, updatedError, updatedIsValidating, dedupe) {
|
|
947
|
+
if (shouldRevalidate === void 0) { shouldRevalidate = true; }
|
|
948
|
+
if (dedupe === void 0) { dedupe = true; }
|
|
949
|
+
// update hook state
|
|
950
|
+
var newState = {};
|
|
951
|
+
var needUpdate = false;
|
|
952
|
+
if (typeof updatedData !== 'undefined' &&
|
|
953
|
+
!config.compare(stateRef.current.data, updatedData)) {
|
|
954
|
+
newState.data = updatedData;
|
|
955
|
+
needUpdate = true;
|
|
956
|
+
}
|
|
957
|
+
// always update error
|
|
958
|
+
// because it can be `undefined`
|
|
959
|
+
if (stateRef.current.error !== updatedError) {
|
|
960
|
+
newState.error = updatedError;
|
|
961
|
+
needUpdate = true;
|
|
962
|
+
}
|
|
963
|
+
if (typeof updatedIsValidating !== 'undefined' &&
|
|
964
|
+
stateRef.current.isValidating !== updatedIsValidating) {
|
|
965
|
+
newState.isValidating = updatedIsValidating;
|
|
966
|
+
needUpdate = true;
|
|
967
|
+
}
|
|
968
|
+
if (needUpdate) {
|
|
969
|
+
dispatch(newState);
|
|
970
|
+
}
|
|
971
|
+
if (shouldRevalidate) {
|
|
972
|
+
if (dedupe) {
|
|
973
|
+
return softRevalidate();
|
|
974
|
+
}
|
|
975
|
+
else {
|
|
976
|
+
return revalidate();
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
return false;
|
|
980
|
+
};
|
|
981
|
+
var unsubFocus = addRevalidator(FOCUS_REVALIDATORS, onFocus);
|
|
982
|
+
var unsubReconnect = addRevalidator(RECONNECT_REVALIDATORS, onReconnect);
|
|
983
|
+
var unsubUpdate = addRevalidator(CACHE_REVALIDATORS, onUpdate);
|
|
984
|
+
return function () {
|
|
985
|
+
// cleanup
|
|
986
|
+
dispatch = function () { return null; };
|
|
987
|
+
// mark it as unmounted
|
|
988
|
+
unmountedRef.current = true;
|
|
989
|
+
unsubFocus();
|
|
990
|
+
unsubReconnect();
|
|
991
|
+
unsubUpdate();
|
|
992
|
+
};
|
|
993
|
+
}, [key, revalidate]);
|
|
994
|
+
useIsomorphicLayoutEffect(function () {
|
|
995
|
+
var timer = null;
|
|
996
|
+
var tick = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
997
|
+
return __generator(this, function (_a) {
|
|
998
|
+
switch (_a.label) {
|
|
999
|
+
case 0:
|
|
1000
|
+
if (!(!stateRef.current.error &&
|
|
1001
|
+
(configRef.current.refreshWhenHidden ||
|
|
1002
|
+
configRef.current.isDocumentVisible()) &&
|
|
1003
|
+
(configRef.current.refreshWhenOffline || configRef.current.isOnline()))) return [3 /*break*/, 2];
|
|
1004
|
+
// only revalidate when the page is visible
|
|
1005
|
+
// if API request errored, we stop polling in this round
|
|
1006
|
+
// and let the error retry function handle it
|
|
1007
|
+
return [4 /*yield*/, revalidate({ dedupe: true })];
|
|
1008
|
+
case 1:
|
|
1009
|
+
// only revalidate when the page is visible
|
|
1010
|
+
// if API request errored, we stop polling in this round
|
|
1011
|
+
// and let the error retry function handle it
|
|
1012
|
+
_a.sent();
|
|
1013
|
+
_a.label = 2;
|
|
1014
|
+
case 2:
|
|
1015
|
+
// Read the latest refreshInterval
|
|
1016
|
+
if (configRef.current.refreshInterval && timer) {
|
|
1017
|
+
timer = setTimeout(tick, configRef.current.refreshInterval);
|
|
1018
|
+
}
|
|
1019
|
+
return [2 /*return*/];
|
|
1020
|
+
}
|
|
1021
|
+
});
|
|
1022
|
+
}); };
|
|
1023
|
+
if (configRef.current.refreshInterval) {
|
|
1024
|
+
timer = setTimeout(tick, configRef.current.refreshInterval);
|
|
1025
|
+
}
|
|
1026
|
+
return function () {
|
|
1027
|
+
if (timer) {
|
|
1028
|
+
clearTimeout(timer);
|
|
1029
|
+
timer = null;
|
|
1030
|
+
}
|
|
1031
|
+
};
|
|
1032
|
+
}, [
|
|
1033
|
+
config.refreshInterval,
|
|
1034
|
+
config.refreshWhenHidden,
|
|
1035
|
+
config.refreshWhenOffline,
|
|
1036
|
+
revalidate
|
|
1037
|
+
]);
|
|
1038
|
+
// suspense
|
|
1039
|
+
var latestData;
|
|
1040
|
+
var latestError;
|
|
1041
|
+
if (config.suspense) {
|
|
1042
|
+
// in suspense mode, we can't return empty state
|
|
1043
|
+
// (it should be suspended)
|
|
1044
|
+
// try to get data and error from cache
|
|
1045
|
+
latestData = cache.get(key);
|
|
1046
|
+
latestError = cache.get(keyErr);
|
|
1047
|
+
if (typeof latestData === 'undefined') {
|
|
1048
|
+
latestData = initialData;
|
|
1049
|
+
}
|
|
1050
|
+
if (typeof latestError === 'undefined') {
|
|
1051
|
+
latestError = initialError;
|
|
1052
|
+
}
|
|
1053
|
+
if (typeof latestData === 'undefined' &&
|
|
1054
|
+
typeof latestError === 'undefined') {
|
|
1055
|
+
// need to start the request if it hasn't
|
|
1056
|
+
if (!CONCURRENT_PROMISES[key]) {
|
|
1057
|
+
// trigger revalidate immediately
|
|
1058
|
+
// to get the promise
|
|
1059
|
+
// in this revalidate, should not rerender
|
|
1060
|
+
revalidate();
|
|
1061
|
+
}
|
|
1062
|
+
if (CONCURRENT_PROMISES[key] &&
|
|
1063
|
+
typeof CONCURRENT_PROMISES[key].then === 'function') {
|
|
1064
|
+
// if it is a promise
|
|
1065
|
+
throw CONCURRENT_PROMISES[key];
|
|
1066
|
+
}
|
|
1067
|
+
// it's a value, return it directly (override)
|
|
1068
|
+
latestData = CONCURRENT_PROMISES[key];
|
|
1069
|
+
}
|
|
1070
|
+
if (typeof latestData === 'undefined' && latestError) {
|
|
1071
|
+
// in suspense mode, throw error if there's no content
|
|
1072
|
+
throw latestError;
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
// define returned state
|
|
1076
|
+
// can be memorized since the state is a ref
|
|
1077
|
+
var memoizedState = useMemo(function () {
|
|
1078
|
+
// revalidate will be deprecated in the 1.x release
|
|
1079
|
+
// because mutate() covers the same use case of revalidate().
|
|
1080
|
+
// This remains only for backward compatibility
|
|
1081
|
+
var state = { revalidate: revalidate, mutate: boundMutate };
|
|
1082
|
+
Object.defineProperties(state, {
|
|
1083
|
+
error: {
|
|
1084
|
+
// `key` might be changed in the upcoming hook re-render,
|
|
1085
|
+
// but the previous state will stay
|
|
1086
|
+
// so we need to match the latest key and data (fallback to `initialData`)
|
|
1087
|
+
get: function () {
|
|
1088
|
+
stateDependencies.current.error = true;
|
|
1089
|
+
if (config.suspense) {
|
|
1090
|
+
return latestError;
|
|
1091
|
+
}
|
|
1092
|
+
return keyRef.current === key ? stateRef.current.error : initialError;
|
|
1093
|
+
},
|
|
1094
|
+
enumerable: true
|
|
1095
|
+
},
|
|
1096
|
+
data: {
|
|
1097
|
+
get: function () {
|
|
1098
|
+
stateDependencies.current.data = true;
|
|
1099
|
+
if (config.suspense) {
|
|
1100
|
+
return latestData;
|
|
1101
|
+
}
|
|
1102
|
+
return keyRef.current === key ? stateRef.current.data : initialData;
|
|
1103
|
+
},
|
|
1104
|
+
enumerable: true
|
|
1105
|
+
},
|
|
1106
|
+
isValidating: {
|
|
1107
|
+
get: function () {
|
|
1108
|
+
stateDependencies.current.isValidating = true;
|
|
1109
|
+
return key ? stateRef.current.isValidating : false;
|
|
1110
|
+
},
|
|
1111
|
+
enumerable: true
|
|
1112
|
+
}
|
|
1113
|
+
});
|
|
1114
|
+
return state;
|
|
1115
|
+
// `config.suspense` isn't allowed to change during the lifecycle.
|
|
1116
|
+
// `boundMutate` is immutable, and the immutability of `revalidate` depends on `key`
|
|
1117
|
+
// so we can omit them from the deps array,
|
|
1118
|
+
// but we put it to enable react-hooks/exhaustive-deps rule.
|
|
1119
|
+
// `initialData` and `initialError` are not initial values
|
|
1120
|
+
// because they are changed during the lifecycle
|
|
1121
|
+
// so we should add them in the deps array.
|
|
1122
|
+
}, [
|
|
1123
|
+
revalidate,
|
|
1124
|
+
initialData,
|
|
1125
|
+
initialError,
|
|
1126
|
+
boundMutate,
|
|
1127
|
+
key,
|
|
1128
|
+
config.suspense,
|
|
1129
|
+
latestError,
|
|
1130
|
+
latestData
|
|
1131
|
+
]);
|
|
1132
|
+
return memoizedState;
|
|
1133
|
+
}
|
|
1134
|
+
Object.defineProperty(SWRConfigContext.Provider, 'default', {
|
|
1135
|
+
value: defaultConfig
|
|
1136
|
+
});
|
|
1137
|
+
var SWRConfig = SWRConfigContext.Provider;
|
|
1138
|
+
|
|
1139
|
+
var __awaiter$1 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
1140
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
1141
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
1142
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
1143
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
1144
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
1145
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1146
|
+
});
|
|
1147
|
+
};
|
|
1148
|
+
var __generator$1 = (undefined && undefined.__generator) || function (thisArg, body) {
|
|
1149
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
1150
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
1151
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
1152
|
+
function step(op) {
|
|
1153
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
1154
|
+
while (_) try {
|
|
1155
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
1156
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
1157
|
+
switch (op[0]) {
|
|
1158
|
+
case 0: case 1: t = op; break;
|
|
1159
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
1160
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
1161
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
1162
|
+
default:
|
|
1163
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
1164
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
1165
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
1166
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
1167
|
+
if (t[2]) _.ops.pop();
|
|
1168
|
+
_.trys.pop(); continue;
|
|
1169
|
+
}
|
|
1170
|
+
op = body.call(thisArg, _);
|
|
1171
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
1172
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
1173
|
+
}
|
|
1174
|
+
};
|
|
1175
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
1176
|
+
var t = {};
|
|
1177
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1178
|
+
t[p] = s[p];
|
|
1179
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1180
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1181
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1182
|
+
t[p[i]] = s[p[i]];
|
|
1183
|
+
}
|
|
1184
|
+
return t;
|
|
1185
|
+
};
|
|
1186
|
+
|
|
1187
|
+
var _this = undefined;
|
|
140
1188
|
|
|
141
1189
|
var dataHandler = function () {
|
|
142
1190
|
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(api_url, body) {
|
|
@@ -202,7 +1250,7 @@ var dataHandler = function () {
|
|
|
202
1250
|
return _context.stop();
|
|
203
1251
|
}
|
|
204
1252
|
}
|
|
205
|
-
}, _callee, _this
|
|
1253
|
+
}, _callee, _this, [[0, 20]]);
|
|
206
1254
|
}));
|
|
207
1255
|
|
|
208
1256
|
return function dataHandler(_x, _x2) {
|
|
@@ -336,43 +1384,43 @@ var LoginForm = function LoginForm(props) {
|
|
|
336
1384
|
loading = _useState4[0],
|
|
337
1385
|
setLoading = _useState4[1];
|
|
338
1386
|
|
|
339
|
-
return
|
|
1387
|
+
return React__default.createElement(
|
|
340
1388
|
Form,
|
|
341
1389
|
{ className: 'login', onSubmit: handleSubmit },
|
|
342
|
-
|
|
1390
|
+
React__default.createElement(
|
|
343
1391
|
'h1',
|
|
344
1392
|
null,
|
|
345
1393
|
'Login'
|
|
346
1394
|
),
|
|
347
|
-
|
|
1395
|
+
React__default.createElement('hr', null),
|
|
348
1396
|
returnFormField({ name: 'email', label: 'Email', type: 'email', required: true }),
|
|
349
1397
|
returnFormField({ name: 'password', label: 'Password', type: 'password', required: true }),
|
|
350
|
-
|
|
351
|
-
|
|
1398
|
+
React__default.createElement('hr', null),
|
|
1399
|
+
React__default.createElement(
|
|
352
1400
|
Form.Row,
|
|
353
1401
|
null,
|
|
354
|
-
|
|
1402
|
+
React__default.createElement(
|
|
355
1403
|
Form.Group,
|
|
356
1404
|
{ as: Col },
|
|
357
|
-
|
|
1405
|
+
React__default.createElement(
|
|
358
1406
|
'a',
|
|
359
1407
|
{ href: '/auth/signup' },
|
|
360
1408
|
'I don\'t have an account'
|
|
361
1409
|
)
|
|
362
1410
|
),
|
|
363
|
-
|
|
1411
|
+
React__default.createElement(
|
|
364
1412
|
Form.Group,
|
|
365
1413
|
{ as: Col, className: 'text-right' },
|
|
366
|
-
!loading &&
|
|
1414
|
+
!loading && React__default.createElement(
|
|
367
1415
|
Button,
|
|
368
1416
|
{ type: 'submit' },
|
|
369
1417
|
'Login'
|
|
370
1418
|
),
|
|
371
|
-
loading &&
|
|
1419
|
+
loading && React__default.createElement(
|
|
372
1420
|
Button,
|
|
373
1421
|
{ variant: 'primary', disabled: true },
|
|
374
|
-
|
|
375
|
-
|
|
1422
|
+
React__default.createElement(Spinner, { as: 'span', animation: 'border', role: 'status', 'aria-hidden': 'true', size: 'sm' }),
|
|
1423
|
+
React__default.createElement(
|
|
376
1424
|
'span',
|
|
377
1425
|
{ className: 'sr-only' },
|
|
378
1426
|
'Loading...'
|
|
@@ -380,12 +1428,12 @@ var LoginForm = function LoginForm(props) {
|
|
|
380
1428
|
)
|
|
381
1429
|
)
|
|
382
1430
|
),
|
|
383
|
-
errorMsg &&
|
|
1431
|
+
errorMsg && React__default.createElement(
|
|
384
1432
|
'p',
|
|
385
1433
|
{ className: 'error' },
|
|
386
1434
|
errorMsg
|
|
387
1435
|
),
|
|
388
|
-
|
|
1436
|
+
React__default.createElement(
|
|
389
1437
|
'style',
|
|
390
1438
|
{ jsx: 'true'.toString() },
|
|
391
1439
|
'\n .login {\n margin: 0 auto;\n padding: 1rem;\n border: 1px solid #ccc;\n border-radius: 4px;\n }\n .error {\n color: red;\n margin: 1rem 0 0;\n }\n '
|
|
@@ -398,9 +1446,9 @@ var countries = ["United States", "Afghanistan", "Albania", "Algeria", "American
|
|
|
398
1446
|
|
|
399
1447
|
var states = ['AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FM', 'FL', 'GA', 'GU', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MH', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'MP', 'OH', 'OK', 'OR', 'PW', 'PA', 'PR', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VI', 'VA', 'WA', 'WV', 'WI', 'WY'];
|
|
400
1448
|
|
|
401
|
-
var _this$
|
|
1449
|
+
var _this$1 = undefined;
|
|
402
1450
|
|
|
403
|
-
var SignupForm
|
|
1451
|
+
var SignupForm = function SignupForm(props) {
|
|
404
1452
|
var handleSubmit = function () {
|
|
405
1453
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee3(e) {
|
|
406
1454
|
var formData, body, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, key, res;
|
|
@@ -561,7 +1609,7 @@ var SignupForm$1 = function SignupForm(props) {
|
|
|
561
1609
|
return _context.stop();
|
|
562
1610
|
}
|
|
563
1611
|
}
|
|
564
|
-
}, _callee, _this$
|
|
1612
|
+
}, _callee, _this$1);
|
|
565
1613
|
}));
|
|
566
1614
|
|
|
567
1615
|
return function loadInitData() {
|
|
@@ -628,7 +1676,7 @@ var SignupForm$1 = function SignupForm(props) {
|
|
|
628
1676
|
return _context2.stop();
|
|
629
1677
|
}
|
|
630
1678
|
}
|
|
631
|
-
}, _callee2, _this$
|
|
1679
|
+
}, _callee2, _this$1);
|
|
632
1680
|
}));
|
|
633
1681
|
|
|
634
1682
|
return function handleOccupationChanged(_x) {
|
|
@@ -641,29 +1689,29 @@ var SignupForm$1 = function SignupForm(props) {
|
|
|
641
1689
|
loading = _useState14[0],
|
|
642
1690
|
setLoading = _useState14[1];
|
|
643
1691
|
|
|
644
|
-
return
|
|
1692
|
+
return React__default.createElement(
|
|
645
1693
|
Form,
|
|
646
1694
|
{ className: 'login', id: 'signupForm', onSubmit: handleSubmit },
|
|
647
|
-
|
|
1695
|
+
React__default.createElement(
|
|
648
1696
|
'h1',
|
|
649
1697
|
null,
|
|
650
1698
|
'Sign Up'
|
|
651
1699
|
),
|
|
652
|
-
|
|
1700
|
+
React__default.createElement('hr', null),
|
|
653
1701
|
returnFormField({ name: 'email', label: 'Email', type: 'email', required: true }),
|
|
654
|
-
|
|
1702
|
+
React__default.createElement(
|
|
655
1703
|
Form.Row,
|
|
656
1704
|
null,
|
|
657
1705
|
returnFormField({ name: 'password', label: 'Password', type: 'password', groupType: Col, required: true }),
|
|
658
1706
|
returnFormField({ name: 'rpassword', label: 'Retype Password', type: 'password', groupType: Col, required: true })
|
|
659
1707
|
),
|
|
660
|
-
|
|
1708
|
+
React__default.createElement(
|
|
661
1709
|
Form.Row,
|
|
662
1710
|
null,
|
|
663
1711
|
returnFormField({ name: 'first_name', label: 'First Name', type: 'text', groupType: Col, required: true }),
|
|
664
1712
|
returnFormField({ name: 'last_name', label: 'Last Name', type: 'text', groupType: Col, required: true })
|
|
665
1713
|
),
|
|
666
|
-
|
|
1714
|
+
React__default.createElement(
|
|
667
1715
|
Form.Row,
|
|
668
1716
|
null,
|
|
669
1717
|
returnFormField({
|
|
@@ -677,7 +1725,7 @@ var SignupForm$1 = function SignupForm(props) {
|
|
|
677
1725
|
}),
|
|
678
1726
|
countryUS && returnFormField({ name: 'state', label: 'State', type: 'select', required: true, groupType: Col, options: states })
|
|
679
1727
|
),
|
|
680
|
-
|
|
1728
|
+
React__default.createElement(
|
|
681
1729
|
Form.Row,
|
|
682
1730
|
null,
|
|
683
1731
|
countryUS && returnFormField({ name: 'zip', label: 'Working Zip Code', type: 'text', required: true, groupType: Col }),
|
|
@@ -724,38 +1772,38 @@ var SignupForm$1 = function SignupForm(props) {
|
|
|
724
1772
|
required: true,
|
|
725
1773
|
options: [{ label: 'By registering you agree to our <a href="/terms" style="color:blue">Terms and Conditions</a> and <a href="/privacy" style="color:blue">Privacy Policy</a> and understand that you will be receiving email communications', value: 'Y' }]
|
|
726
1774
|
}),
|
|
727
|
-
|
|
728
|
-
|
|
1775
|
+
React__default.createElement('hr', null),
|
|
1776
|
+
React__default.createElement(
|
|
729
1777
|
Form.Row,
|
|
730
1778
|
null,
|
|
731
|
-
|
|
1779
|
+
React__default.createElement(
|
|
732
1780
|
Form.Group,
|
|
733
1781
|
{ as: Col },
|
|
734
|
-
|
|
1782
|
+
React__default.createElement(
|
|
735
1783
|
'a',
|
|
736
1784
|
{ href: '/auth/login' },
|
|
737
1785
|
'I already have an account'
|
|
738
1786
|
)
|
|
739
1787
|
),
|
|
740
|
-
|
|
1788
|
+
React__default.createElement(
|
|
741
1789
|
Form.Group,
|
|
742
1790
|
{ as: Col, className: 'text-right' },
|
|
743
|
-
!loading &&
|
|
1791
|
+
!loading && React__default.createElement(
|
|
744
1792
|
Button,
|
|
745
1793
|
{ type: 'submit' },
|
|
746
1794
|
'Sign Up'
|
|
747
1795
|
),
|
|
748
|
-
loading &&
|
|
1796
|
+
loading && React__default.createElement(
|
|
749
1797
|
Button,
|
|
750
1798
|
{ variant: 'primary', disabled: true },
|
|
751
|
-
|
|
1799
|
+
React__default.createElement(Spinner, {
|
|
752
1800
|
as: 'span',
|
|
753
1801
|
animation: 'border',
|
|
754
1802
|
role: 'status',
|
|
755
1803
|
'aria-hidden': 'true',
|
|
756
1804
|
size: 'sm'
|
|
757
1805
|
}),
|
|
758
|
-
|
|
1806
|
+
React__default.createElement(
|
|
759
1807
|
'span',
|
|
760
1808
|
{ className: 'sr-only' },
|
|
761
1809
|
'Loading...'
|
|
@@ -763,12 +1811,12 @@ var SignupForm$1 = function SignupForm(props) {
|
|
|
763
1811
|
)
|
|
764
1812
|
)
|
|
765
1813
|
),
|
|
766
|
-
errorMsg &&
|
|
1814
|
+
errorMsg && React__default.createElement(
|
|
767
1815
|
'p',
|
|
768
1816
|
{ className: 'error' },
|
|
769
1817
|
errorMsg
|
|
770
1818
|
),
|
|
771
|
-
|
|
1819
|
+
React__default.createElement(
|
|
772
1820
|
'style',
|
|
773
1821
|
{ jsx: 'true'.toString() },
|
|
774
1822
|
' \n .login {\n margin: 0 auto;\n padding: 1rem;\n border: 1px solid #ccc;\n border-radius: 4px;\n }\n .error {\n color: red;\n margin: 1rem 0 0;\n }\n '
|
|
@@ -778,7 +1826,7 @@ var SignupForm$1 = function SignupForm(props) {
|
|
|
778
1826
|
|
|
779
1827
|
var _this$2 = undefined;
|
|
780
1828
|
|
|
781
|
-
var SignupForm = function SignupForm(props) {
|
|
1829
|
+
var SignupForm$1 = function SignupForm(props) {
|
|
782
1830
|
var handleSubmit = function () {
|
|
783
1831
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee3(e) {
|
|
784
1832
|
var formData, body, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, key, res;
|
|
@@ -1058,32 +2106,32 @@ var SignupForm = function SignupForm(props) {
|
|
|
1058
2106
|
loading = _useState18[0],
|
|
1059
2107
|
setLoading = _useState18[1];
|
|
1060
2108
|
|
|
1061
|
-
return
|
|
2109
|
+
return React__default.createElement(
|
|
1062
2110
|
Form,
|
|
1063
2111
|
{ className: 'login', id: 'signupForm', onSubmit: handleSubmit },
|
|
1064
|
-
|
|
2112
|
+
React__default.createElement(
|
|
1065
2113
|
'h1',
|
|
1066
2114
|
null,
|
|
1067
2115
|
'Profile'
|
|
1068
2116
|
),
|
|
1069
|
-
|
|
1070
|
-
userData ?
|
|
1071
|
-
|
|
2117
|
+
React__default.createElement('hr', null),
|
|
2118
|
+
userData ? React__default.createElement(
|
|
2119
|
+
React__default.Fragment,
|
|
1072
2120
|
null,
|
|
1073
2121
|
returnFormField({ name: 'email', label: 'Email', type: 'email', required: true, readonly: true, default_value: userData.email }),
|
|
1074
|
-
|
|
2122
|
+
React__default.createElement(
|
|
1075
2123
|
Form.Row,
|
|
1076
2124
|
null,
|
|
1077
2125
|
returnFormField({ name: 'password', label: 'Password', type: 'password', groupType: Col, required: false }),
|
|
1078
2126
|
returnFormField({ name: 'rpassword', label: 'Retype Password', type: 'password', groupType: Col, required: false })
|
|
1079
2127
|
),
|
|
1080
|
-
|
|
2128
|
+
React__default.createElement(
|
|
1081
2129
|
Form.Row,
|
|
1082
2130
|
null,
|
|
1083
2131
|
returnFormField({ name: 'first_name', label: 'First Name', type: 'text', groupType: Col, required: true, default_value: userData.shared.first_name }),
|
|
1084
2132
|
returnFormField({ name: 'last_name', label: 'Last Name', type: 'text', groupType: Col, required: true, default_value: userData.shared.last_name })
|
|
1085
2133
|
),
|
|
1086
|
-
|
|
2134
|
+
React__default.createElement(
|
|
1087
2135
|
Form.Row,
|
|
1088
2136
|
null,
|
|
1089
2137
|
returnFormField({
|
|
@@ -1098,7 +2146,7 @@ var SignupForm = function SignupForm(props) {
|
|
|
1098
2146
|
}),
|
|
1099
2147
|
countryUS && returnFormField({ name: 'state', label: 'State', type: 'select', required: true, groupType: Col, options: states, default_value: userData.shared.state })
|
|
1100
2148
|
),
|
|
1101
|
-
|
|
2149
|
+
React__default.createElement(
|
|
1102
2150
|
Form.Row,
|
|
1103
2151
|
null,
|
|
1104
2152
|
countryUS && returnFormField({ name: 'zip', label: 'Working Zip Code', type: 'text', required: true, groupType: Col, default_value: userData.shared.zip }),
|
|
@@ -1148,29 +2196,29 @@ var SignupForm = function SignupForm(props) {
|
|
|
1148
2196
|
required: true,
|
|
1149
2197
|
options: [{ label: 'By registering you agree to our <a href="/terms">Terms and Conditions</a> and <a href="/privacy">Privacy Policy</a> and understand that you will be receiving email communications', value: 'Y' }]
|
|
1150
2198
|
}),
|
|
1151
|
-
|
|
1152
|
-
|
|
2199
|
+
React__default.createElement('hr', null),
|
|
2200
|
+
React__default.createElement(
|
|
1153
2201
|
Form.Row,
|
|
1154
2202
|
null,
|
|
1155
|
-
|
|
2203
|
+
React__default.createElement(
|
|
1156
2204
|
Form.Group,
|
|
1157
2205
|
{ as: Col },
|
|
1158
|
-
!loading &&
|
|
2206
|
+
!loading && React__default.createElement(
|
|
1159
2207
|
Button,
|
|
1160
2208
|
{ type: 'submit' },
|
|
1161
2209
|
'Update'
|
|
1162
2210
|
),
|
|
1163
|
-
loading &&
|
|
2211
|
+
loading && React__default.createElement(
|
|
1164
2212
|
Button,
|
|
1165
2213
|
{ variant: 'primary', disabled: true },
|
|
1166
|
-
|
|
2214
|
+
React__default.createElement(Spinner, {
|
|
1167
2215
|
as: 'span',
|
|
1168
2216
|
animation: 'border',
|
|
1169
2217
|
role: 'status',
|
|
1170
2218
|
'aria-hidden': 'true',
|
|
1171
2219
|
size: 'sm'
|
|
1172
2220
|
}),
|
|
1173
|
-
|
|
2221
|
+
React__default.createElement(
|
|
1174
2222
|
'span',
|
|
1175
2223
|
{ className: 'sr-only' },
|
|
1176
2224
|
'Loading...'
|
|
@@ -1178,24 +2226,24 @@ var SignupForm = function SignupForm(props) {
|
|
|
1178
2226
|
)
|
|
1179
2227
|
)
|
|
1180
2228
|
)
|
|
1181
|
-
) :
|
|
2229
|
+
) : React__default.createElement(Spinner, {
|
|
1182
2230
|
as: 'span',
|
|
1183
2231
|
animation: 'border',
|
|
1184
2232
|
role: 'status',
|
|
1185
2233
|
'aria-hidden': 'true',
|
|
1186
2234
|
size: 'sm'
|
|
1187
2235
|
}),
|
|
1188
|
-
errorMsg &&
|
|
2236
|
+
errorMsg && React__default.createElement(
|
|
1189
2237
|
'p',
|
|
1190
2238
|
{ className: 'error' },
|
|
1191
2239
|
errorMsg
|
|
1192
2240
|
),
|
|
1193
|
-
successMsg &&
|
|
2241
|
+
successMsg && React__default.createElement(
|
|
1194
2242
|
'p',
|
|
1195
2243
|
{ className: 'success' },
|
|
1196
2244
|
successMsg
|
|
1197
2245
|
),
|
|
1198
|
-
|
|
2246
|
+
React__default.createElement(
|
|
1199
2247
|
'style',
|
|
1200
2248
|
{ jsx: 'true'.toString() },
|
|
1201
2249
|
' \n .login {\n margin: 0 auto;\n padding: 1rem;\n border: 1px solid #ccc;\n border-radius: 4px;\n }\n .error {\n color: red;\n margin: 1rem 0 0;\n }\n .success {\n color: green;\n margin: 1rem 0 0;\n }\n '
|
|
@@ -1313,10 +2361,10 @@ var iron = /*#__PURE__*/Object.freeze({
|
|
|
1313
2361
|
getSession: getSession
|
|
1314
2362
|
});
|
|
1315
2363
|
|
|
1316
|
-
var toStr
|
|
2364
|
+
var toStr = Object.prototype.toString;
|
|
1317
2365
|
|
|
1318
2366
|
var isArguments = function isArguments(value) {
|
|
1319
|
-
var str = toStr
|
|
2367
|
+
var str = toStr.call(value);
|
|
1320
2368
|
var isArgs = str === '[object Arguments]';
|
|
1321
2369
|
if (!isArgs) {
|
|
1322
2370
|
isArgs = str !== '[object Array]' &&
|
|
@@ -1324,16 +2372,16 @@ var isArguments = function isArguments(value) {
|
|
|
1324
2372
|
typeof value === 'object' &&
|
|
1325
2373
|
typeof value.length === 'number' &&
|
|
1326
2374
|
value.length >= 0 &&
|
|
1327
|
-
toStr
|
|
2375
|
+
toStr.call(value.callee) === '[object Function]';
|
|
1328
2376
|
}
|
|
1329
2377
|
return isArgs;
|
|
1330
2378
|
};
|
|
1331
2379
|
|
|
1332
|
-
var keysShim
|
|
2380
|
+
var keysShim;
|
|
1333
2381
|
if (!Object.keys) {
|
|
1334
2382
|
// modified from https://github.com/es-shims/es5-shim
|
|
1335
2383
|
var has$1 = Object.prototype.hasOwnProperty;
|
|
1336
|
-
var toStr$
|
|
2384
|
+
var toStr$1 = Object.prototype.toString;
|
|
1337
2385
|
var isArgs = isArguments; // eslint-disable-line global-require
|
|
1338
2386
|
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
|
1339
2387
|
var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
|
|
@@ -1406,11 +2454,11 @@ if (!Object.keys) {
|
|
|
1406
2454
|
}
|
|
1407
2455
|
};
|
|
1408
2456
|
|
|
1409
|
-
keysShim
|
|
2457
|
+
keysShim = function keys(object) {
|
|
1410
2458
|
var isObject = object !== null && typeof object === 'object';
|
|
1411
|
-
var isFunction = toStr$
|
|
2459
|
+
var isFunction = toStr$1.call(object) === '[object Function]';
|
|
1412
2460
|
var isArguments = isArgs(object);
|
|
1413
|
-
var isString = isObject && toStr$
|
|
2461
|
+
var isString = isObject && toStr$1.call(object) === '[object String]';
|
|
1414
2462
|
var theKeys = [];
|
|
1415
2463
|
|
|
1416
2464
|
if (!isObject && !isFunction && !isArguments) {
|
|
@@ -1448,17 +2496,17 @@ if (!Object.keys) {
|
|
|
1448
2496
|
return theKeys;
|
|
1449
2497
|
};
|
|
1450
2498
|
}
|
|
1451
|
-
var implementation
|
|
2499
|
+
var implementation = keysShim;
|
|
1452
2500
|
|
|
1453
|
-
var slice
|
|
2501
|
+
var slice = Array.prototype.slice;
|
|
1454
2502
|
|
|
1455
2503
|
|
|
1456
2504
|
var origKeys = Object.keys;
|
|
1457
|
-
var keysShim = origKeys ? function keys(o) { return origKeys(o); } : implementation
|
|
2505
|
+
var keysShim$1 = origKeys ? function keys(o) { return origKeys(o); } : implementation;
|
|
1458
2506
|
|
|
1459
2507
|
var originalKeys = Object.keys;
|
|
1460
2508
|
|
|
1461
|
-
keysShim.shim = function shimObjectKeys() {
|
|
2509
|
+
keysShim$1.shim = function shimObjectKeys() {
|
|
1462
2510
|
if (Object.keys) {
|
|
1463
2511
|
var keysWorksWithArguments = (function () {
|
|
1464
2512
|
// Safari 5.0 bug
|
|
@@ -1468,27 +2516,27 @@ keysShim.shim = function shimObjectKeys() {
|
|
|
1468
2516
|
if (!keysWorksWithArguments) {
|
|
1469
2517
|
Object.keys = function keys(object) { // eslint-disable-line func-name-matching
|
|
1470
2518
|
if (isArguments(object)) {
|
|
1471
|
-
return originalKeys(slice
|
|
2519
|
+
return originalKeys(slice.call(object));
|
|
1472
2520
|
}
|
|
1473
2521
|
return originalKeys(object);
|
|
1474
2522
|
};
|
|
1475
2523
|
}
|
|
1476
2524
|
} else {
|
|
1477
|
-
Object.keys = keysShim;
|
|
2525
|
+
Object.keys = keysShim$1;
|
|
1478
2526
|
}
|
|
1479
|
-
return Object.keys || keysShim;
|
|
2527
|
+
return Object.keys || keysShim$1;
|
|
1480
2528
|
};
|
|
1481
2529
|
|
|
1482
|
-
var objectKeys = keysShim;
|
|
2530
|
+
var objectKeys = keysShim$1;
|
|
1483
2531
|
|
|
1484
|
-
var hasSymbols
|
|
2532
|
+
var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
|
|
1485
2533
|
|
|
1486
|
-
var toStr$
|
|
2534
|
+
var toStr$2 = Object.prototype.toString;
|
|
1487
2535
|
var concat = Array.prototype.concat;
|
|
1488
2536
|
var origDefineProperty = Object.defineProperty;
|
|
1489
2537
|
|
|
1490
2538
|
var isFunction = function (fn) {
|
|
1491
|
-
return typeof fn === 'function' && toStr$
|
|
2539
|
+
return typeof fn === 'function' && toStr$2.call(fn) === '[object Function]';
|
|
1492
2540
|
};
|
|
1493
2541
|
|
|
1494
2542
|
var arePropertyDescriptorsSupported = function () {
|
|
@@ -1525,7 +2573,7 @@ var defineProperty = function (object, name, value, predicate) {
|
|
|
1525
2573
|
var defineProperties = function (object, map) {
|
|
1526
2574
|
var predicates = arguments.length > 2 ? arguments[2] : {};
|
|
1527
2575
|
var props = objectKeys(map);
|
|
1528
|
-
if (hasSymbols
|
|
2576
|
+
if (hasSymbols) {
|
|
1529
2577
|
props = concat.call(props, Object.getOwnPropertySymbols(map));
|
|
1530
2578
|
}
|
|
1531
2579
|
for (var i = 0; i < props.length; i += 1) {
|
|
@@ -1537,59 +2585,6 @@ defineProperties.supportsDescriptors = !!supportsDescriptors;
|
|
|
1537
2585
|
|
|
1538
2586
|
var defineProperties_1 = defineProperties;
|
|
1539
2587
|
|
|
1540
|
-
/* eslint no-invalid-this: 1 */
|
|
1541
|
-
|
|
1542
|
-
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
|
|
1543
|
-
var slice = Array.prototype.slice;
|
|
1544
|
-
var toStr$2 = Object.prototype.toString;
|
|
1545
|
-
var funcType = '[object Function]';
|
|
1546
|
-
|
|
1547
|
-
var implementation$2 = function bind(that) {
|
|
1548
|
-
var target = this;
|
|
1549
|
-
if (typeof target !== 'function' || toStr$2.call(target) !== funcType) {
|
|
1550
|
-
throw new TypeError(ERROR_MESSAGE + target);
|
|
1551
|
-
}
|
|
1552
|
-
var args = slice.call(arguments, 1);
|
|
1553
|
-
|
|
1554
|
-
var bound;
|
|
1555
|
-
var binder = function () {
|
|
1556
|
-
if (this instanceof bound) {
|
|
1557
|
-
var result = target.apply(
|
|
1558
|
-
this,
|
|
1559
|
-
args.concat(slice.call(arguments))
|
|
1560
|
-
);
|
|
1561
|
-
if (Object(result) === result) {
|
|
1562
|
-
return result;
|
|
1563
|
-
}
|
|
1564
|
-
return this;
|
|
1565
|
-
} else {
|
|
1566
|
-
return target.apply(
|
|
1567
|
-
that,
|
|
1568
|
-
args.concat(slice.call(arguments))
|
|
1569
|
-
);
|
|
1570
|
-
}
|
|
1571
|
-
};
|
|
1572
|
-
|
|
1573
|
-
var boundLength = Math.max(0, target.length - args.length);
|
|
1574
|
-
var boundArgs = [];
|
|
1575
|
-
for (var i = 0; i < boundLength; i++) {
|
|
1576
|
-
boundArgs.push('$' + i);
|
|
1577
|
-
}
|
|
1578
|
-
|
|
1579
|
-
bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
|
|
1580
|
-
|
|
1581
|
-
if (target.prototype) {
|
|
1582
|
-
var Empty = function Empty() {};
|
|
1583
|
-
Empty.prototype = target.prototype;
|
|
1584
|
-
bound.prototype = new Empty();
|
|
1585
|
-
Empty.prototype = null;
|
|
1586
|
-
}
|
|
1587
|
-
|
|
1588
|
-
return bound;
|
|
1589
|
-
};
|
|
1590
|
-
|
|
1591
|
-
var functionBind = Function.prototype.bind || implementation$2;
|
|
1592
|
-
|
|
1593
2588
|
/* eslint complexity: [2, 18], max-statements: [2, 33] */
|
|
1594
2589
|
var shams = function hasSymbols() {
|
|
1595
2590
|
if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
|
|
@@ -1613,7 +2608,7 @@ var shams = function hasSymbols() {
|
|
|
1613
2608
|
|
|
1614
2609
|
var symVal = 42;
|
|
1615
2610
|
obj[sym] = symVal;
|
|
1616
|
-
for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax
|
|
2611
|
+
for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax
|
|
1617
2612
|
if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
|
|
1618
2613
|
|
|
1619
2614
|
if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
|
|
@@ -1631,10 +2626,10 @@ var shams = function hasSymbols() {
|
|
|
1631
2626
|
return true;
|
|
1632
2627
|
};
|
|
1633
2628
|
|
|
1634
|
-
var origSymbol =
|
|
2629
|
+
var origSymbol = commonjsGlobal.Symbol;
|
|
1635
2630
|
|
|
1636
2631
|
|
|
1637
|
-
var hasSymbols$
|
|
2632
|
+
var hasSymbols$1 = function hasNativeSymbols() {
|
|
1638
2633
|
if (typeof origSymbol !== 'function') { return false; }
|
|
1639
2634
|
if (typeof Symbol !== 'function') { return false; }
|
|
1640
2635
|
if (typeof origSymbol('foo') !== 'symbol') { return false; }
|
|
@@ -1643,34 +2638,79 @@ var hasSymbols$3 = function hasNativeSymbols() {
|
|
|
1643
2638
|
return shams();
|
|
1644
2639
|
};
|
|
1645
2640
|
|
|
1646
|
-
|
|
2641
|
+
/* eslint no-invalid-this: 1 */
|
|
1647
2642
|
|
|
1648
|
-
var
|
|
2643
|
+
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
|
|
2644
|
+
var slice$1 = Array.prototype.slice;
|
|
2645
|
+
var toStr$3 = Object.prototype.toString;
|
|
2646
|
+
var funcType = '[object Function]';
|
|
1649
2647
|
|
|
1650
|
-
var $
|
|
1651
|
-
var
|
|
1652
|
-
|
|
2648
|
+
var implementation$1 = function bind(that) {
|
|
2649
|
+
var target = this;
|
|
2650
|
+
if (typeof target !== 'function' || toStr$3.call(target) !== funcType) {
|
|
2651
|
+
throw new TypeError(ERROR_MESSAGE + target);
|
|
2652
|
+
}
|
|
2653
|
+
var args = slice$1.call(arguments, 1);
|
|
1653
2654
|
|
|
1654
|
-
|
|
1655
|
-
var
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
2655
|
+
var bound;
|
|
2656
|
+
var binder = function () {
|
|
2657
|
+
if (this instanceof bound) {
|
|
2658
|
+
var result = target.apply(
|
|
2659
|
+
this,
|
|
2660
|
+
args.concat(slice$1.call(arguments))
|
|
2661
|
+
);
|
|
2662
|
+
if (Object(result) === result) {
|
|
2663
|
+
return result;
|
|
2664
|
+
}
|
|
2665
|
+
return this;
|
|
2666
|
+
} else {
|
|
2667
|
+
return target.apply(
|
|
2668
|
+
that,
|
|
2669
|
+
args.concat(slice$1.call(arguments))
|
|
2670
|
+
);
|
|
2671
|
+
}
|
|
2672
|
+
};
|
|
2673
|
+
|
|
2674
|
+
var boundLength = Math.max(0, target.length - args.length);
|
|
2675
|
+
var boundArgs = [];
|
|
2676
|
+
for (var i = 0; i < boundLength; i++) {
|
|
2677
|
+
boundArgs.push('$' + i);
|
|
2678
|
+
}
|
|
2679
|
+
|
|
2680
|
+
bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
|
|
2681
|
+
|
|
2682
|
+
if (target.prototype) {
|
|
2683
|
+
var Empty = function Empty() {};
|
|
2684
|
+
Empty.prototype = target.prototype;
|
|
2685
|
+
bound.prototype = new Empty();
|
|
2686
|
+
Empty.prototype = null;
|
|
2687
|
+
}
|
|
2688
|
+
|
|
2689
|
+
return bound;
|
|
1659
2690
|
};
|
|
1660
2691
|
|
|
1661
|
-
var
|
|
1662
|
-
|
|
2692
|
+
var functionBind = Function.prototype.bind || implementation$1;
|
|
2693
|
+
|
|
2694
|
+
/* globals
|
|
2695
|
+
Atomics,
|
|
2696
|
+
SharedArrayBuffer,
|
|
2697
|
+
*/
|
|
2698
|
+
|
|
2699
|
+
var undefined$1;
|
|
2700
|
+
|
|
2701
|
+
var $TypeError = TypeError;
|
|
2702
|
+
|
|
2703
|
+
var $gOPD = Object.getOwnPropertyDescriptor;
|
|
2704
|
+
if ($gOPD) {
|
|
1663
2705
|
try {
|
|
1664
|
-
$gOPD
|
|
2706
|
+
$gOPD({}, '');
|
|
1665
2707
|
} catch (e) {
|
|
1666
|
-
$gOPD
|
|
2708
|
+
$gOPD = null; // this is IE 8, which has a broken gOPD
|
|
1667
2709
|
}
|
|
1668
2710
|
}
|
|
1669
2711
|
|
|
1670
|
-
var throwTypeError = function () {
|
|
1671
|
-
|
|
1672
|
-
};
|
|
1673
|
-
var ThrowTypeError = $gOPD$2
|
|
2712
|
+
var throwTypeError = function () { throw new $TypeError(); };
|
|
2713
|
+
var ThrowTypeError = $gOPD
|
|
1674
2714
|
? (function () {
|
|
1675
2715
|
try {
|
|
1676
2716
|
// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
|
|
@@ -1679,7 +2719,7 @@ var ThrowTypeError = $gOPD$2
|
|
|
1679
2719
|
} catch (calleeThrows) {
|
|
1680
2720
|
try {
|
|
1681
2721
|
// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
|
|
1682
|
-
return $gOPD
|
|
2722
|
+
return $gOPD(arguments, 'callee').get;
|
|
1683
2723
|
} catch (gOPDthrows) {
|
|
1684
2724
|
return throwTypeError;
|
|
1685
2725
|
}
|
|
@@ -1687,354 +2727,206 @@ var ThrowTypeError = $gOPD$2
|
|
|
1687
2727
|
}())
|
|
1688
2728
|
: throwTypeError;
|
|
1689
2729
|
|
|
1690
|
-
var hasSymbols$2 = hasSymbols$
|
|
2730
|
+
var hasSymbols$2 = hasSymbols$1();
|
|
1691
2731
|
|
|
1692
2732
|
var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
|
|
1693
|
-
|
|
1694
|
-
var
|
|
2733
|
+
var generatorFunction = undefined$1;
|
|
2734
|
+
var asyncFunction = undefined$1;
|
|
2735
|
+
var asyncGenFunction = undefined$1;
|
|
1695
2736
|
|
|
1696
2737
|
var TypedArray = typeof Uint8Array === 'undefined' ? undefined$1 : getProto(Uint8Array);
|
|
1697
2738
|
|
|
1698
2739
|
var INTRINSICS = {
|
|
1699
|
-
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
|
|
1700
2740
|
'%Array%': Array,
|
|
1701
2741
|
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
|
|
2742
|
+
'%ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer.prototype,
|
|
1702
2743
|
'%ArrayIteratorPrototype%': hasSymbols$2 ? getProto([][Symbol.iterator]()) : undefined$1,
|
|
2744
|
+
'%ArrayPrototype%': Array.prototype,
|
|
2745
|
+
'%ArrayProto_entries%': Array.prototype.entries,
|
|
2746
|
+
'%ArrayProto_forEach%': Array.prototype.forEach,
|
|
2747
|
+
'%ArrayProto_keys%': Array.prototype.keys,
|
|
2748
|
+
'%ArrayProto_values%': Array.prototype.values,
|
|
1703
2749
|
'%AsyncFromSyncIteratorPrototype%': undefined$1,
|
|
1704
|
-
'%AsyncFunction%':
|
|
1705
|
-
'%
|
|
1706
|
-
'%
|
|
1707
|
-
'%
|
|
2750
|
+
'%AsyncFunction%': asyncFunction,
|
|
2751
|
+
'%AsyncFunctionPrototype%': undefined$1,
|
|
2752
|
+
'%AsyncGenerator%': undefined$1,
|
|
2753
|
+
'%AsyncGeneratorFunction%': asyncGenFunction,
|
|
2754
|
+
'%AsyncGeneratorPrototype%': undefined$1,
|
|
2755
|
+
'%AsyncIteratorPrototype%': undefined$1,
|
|
1708
2756
|
'%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
|
|
1709
|
-
'%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
|
|
1710
2757
|
'%Boolean%': Boolean,
|
|
2758
|
+
'%BooleanPrototype%': Boolean.prototype,
|
|
1711
2759
|
'%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
|
|
2760
|
+
'%DataViewPrototype%': typeof DataView === 'undefined' ? undefined$1 : DataView.prototype,
|
|
1712
2761
|
'%Date%': Date,
|
|
2762
|
+
'%DatePrototype%': Date.prototype,
|
|
1713
2763
|
'%decodeURI%': decodeURI,
|
|
1714
2764
|
'%decodeURIComponent%': decodeURIComponent,
|
|
1715
2765
|
'%encodeURI%': encodeURI,
|
|
1716
2766
|
'%encodeURIComponent%': encodeURIComponent,
|
|
1717
2767
|
'%Error%': Error,
|
|
2768
|
+
'%ErrorPrototype%': Error.prototype,
|
|
1718
2769
|
'%eval%': eval, // eslint-disable-line no-eval
|
|
1719
2770
|
'%EvalError%': EvalError,
|
|
2771
|
+
'%EvalErrorPrototype%': EvalError.prototype,
|
|
1720
2772
|
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
|
|
2773
|
+
'%Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array.prototype,
|
|
1721
2774
|
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
|
|
1722
|
-
'%
|
|
1723
|
-
'%Function%':
|
|
1724
|
-
'%
|
|
2775
|
+
'%Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array.prototype,
|
|
2776
|
+
'%Function%': Function,
|
|
2777
|
+
'%FunctionPrototype%': Function.prototype,
|
|
2778
|
+
'%Generator%': undefined$1,
|
|
2779
|
+
'%GeneratorFunction%': generatorFunction,
|
|
2780
|
+
'%GeneratorPrototype%': undefined$1,
|
|
1725
2781
|
'%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
|
|
2782
|
+
'%Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array.prototype,
|
|
1726
2783
|
'%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
|
|
2784
|
+
'%Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined$1 : Int8Array.prototype,
|
|
1727
2785
|
'%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
|
|
2786
|
+
'%Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array.prototype,
|
|
1728
2787
|
'%isFinite%': isFinite,
|
|
1729
2788
|
'%isNaN%': isNaN,
|
|
1730
2789
|
'%IteratorPrototype%': hasSymbols$2 ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
|
|
1731
2790
|
'%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
|
|
2791
|
+
'%JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined$1,
|
|
1732
2792
|
'%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
|
|
1733
2793
|
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$2 ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
|
|
2794
|
+
'%MapPrototype%': typeof Map === 'undefined' ? undefined$1 : Map.prototype,
|
|
1734
2795
|
'%Math%': Math,
|
|
1735
2796
|
'%Number%': Number,
|
|
2797
|
+
'%NumberPrototype%': Number.prototype,
|
|
1736
2798
|
'%Object%': Object,
|
|
2799
|
+
'%ObjectPrototype%': Object.prototype,
|
|
2800
|
+
'%ObjProto_toString%': Object.prototype.toString,
|
|
2801
|
+
'%ObjProto_valueOf%': Object.prototype.valueOf,
|
|
1737
2802
|
'%parseFloat%': parseFloat,
|
|
1738
2803
|
'%parseInt%': parseInt,
|
|
1739
2804
|
'%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
|
|
2805
|
+
'%PromisePrototype%': typeof Promise === 'undefined' ? undefined$1 : Promise.prototype,
|
|
2806
|
+
'%PromiseProto_then%': typeof Promise === 'undefined' ? undefined$1 : Promise.prototype.then,
|
|
2807
|
+
'%Promise_all%': typeof Promise === 'undefined' ? undefined$1 : Promise.all,
|
|
2808
|
+
'%Promise_reject%': typeof Promise === 'undefined' ? undefined$1 : Promise.reject,
|
|
2809
|
+
'%Promise_resolve%': typeof Promise === 'undefined' ? undefined$1 : Promise.resolve,
|
|
1740
2810
|
'%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
|
|
1741
2811
|
'%RangeError%': RangeError,
|
|
2812
|
+
'%RangeErrorPrototype%': RangeError.prototype,
|
|
1742
2813
|
'%ReferenceError%': ReferenceError,
|
|
2814
|
+
'%ReferenceErrorPrototype%': ReferenceError.prototype,
|
|
1743
2815
|
'%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
|
|
1744
2816
|
'%RegExp%': RegExp,
|
|
2817
|
+
'%RegExpPrototype%': RegExp.prototype,
|
|
1745
2818
|
'%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
|
|
1746
2819
|
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$2 ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
|
|
2820
|
+
'%SetPrototype%': typeof Set === 'undefined' ? undefined$1 : Set.prototype,
|
|
1747
2821
|
'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
|
|
2822
|
+
'%SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer.prototype,
|
|
1748
2823
|
'%String%': String,
|
|
1749
2824
|
'%StringIteratorPrototype%': hasSymbols$2 ? getProto(''[Symbol.iterator]()) : undefined$1,
|
|
2825
|
+
'%StringPrototype%': String.prototype,
|
|
1750
2826
|
'%Symbol%': hasSymbols$2 ? Symbol : undefined$1,
|
|
1751
|
-
'%
|
|
2827
|
+
'%SymbolPrototype%': hasSymbols$2 ? Symbol.prototype : undefined$1,
|
|
2828
|
+
'%SyntaxError%': SyntaxError,
|
|
2829
|
+
'%SyntaxErrorPrototype%': SyntaxError.prototype,
|
|
1752
2830
|
'%ThrowTypeError%': ThrowTypeError,
|
|
1753
2831
|
'%TypedArray%': TypedArray,
|
|
1754
|
-
'%
|
|
2832
|
+
'%TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined$1,
|
|
2833
|
+
'%TypeError%': $TypeError,
|
|
2834
|
+
'%TypeErrorPrototype%': $TypeError.prototype,
|
|
1755
2835
|
'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
|
|
2836
|
+
'%Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array.prototype,
|
|
1756
2837
|
'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
|
|
2838
|
+
'%Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray.prototype,
|
|
1757
2839
|
'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
|
|
2840
|
+
'%Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array.prototype,
|
|
1758
2841
|
'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
|
|
2842
|
+
'%Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array.prototype,
|
|
1759
2843
|
'%URIError%': URIError,
|
|
2844
|
+
'%URIErrorPrototype%': URIError.prototype,
|
|
1760
2845
|
'%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
|
|
1761
|
-
'%
|
|
1762
|
-
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
var doEval = function doEval(name) {
|
|
1766
|
-
var value;
|
|
1767
|
-
if (name === '%AsyncFunction%') {
|
|
1768
|
-
value = getEvalledConstructor('async function () {}');
|
|
1769
|
-
} else if (name === '%GeneratorFunction%') {
|
|
1770
|
-
value = getEvalledConstructor('function* () {}');
|
|
1771
|
-
} else if (name === '%AsyncGeneratorFunction%') {
|
|
1772
|
-
value = getEvalledConstructor('async function* () {}');
|
|
1773
|
-
} else if (name === '%AsyncGenerator%') {
|
|
1774
|
-
var fn = doEval('%AsyncGeneratorFunction%');
|
|
1775
|
-
if (fn) {
|
|
1776
|
-
value = fn.prototype;
|
|
1777
|
-
}
|
|
1778
|
-
} else if (name === '%AsyncIteratorPrototype%') {
|
|
1779
|
-
var gen = doEval('%AsyncGenerator%');
|
|
1780
|
-
if (gen) {
|
|
1781
|
-
value = getProto(gen.prototype);
|
|
1782
|
-
}
|
|
1783
|
-
}
|
|
1784
|
-
|
|
1785
|
-
INTRINSICS[name] = value;
|
|
1786
|
-
|
|
1787
|
-
return value;
|
|
2846
|
+
'%WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap.prototype,
|
|
2847
|
+
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet,
|
|
2848
|
+
'%WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet.prototype
|
|
1788
2849
|
};
|
|
1789
2850
|
|
|
1790
|
-
|
|
1791
|
-
'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
|
|
1792
|
-
'%ArrayPrototype%': ['Array', 'prototype'],
|
|
1793
|
-
'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
|
|
1794
|
-
'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
|
|
1795
|
-
'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
|
|
1796
|
-
'%ArrayProto_values%': ['Array', 'prototype', 'values'],
|
|
1797
|
-
'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
|
|
1798
|
-
'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
|
|
1799
|
-
'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
|
|
1800
|
-
'%BooleanPrototype%': ['Boolean', 'prototype'],
|
|
1801
|
-
'%DataViewPrototype%': ['DataView', 'prototype'],
|
|
1802
|
-
'%DatePrototype%': ['Date', 'prototype'],
|
|
1803
|
-
'%ErrorPrototype%': ['Error', 'prototype'],
|
|
1804
|
-
'%EvalErrorPrototype%': ['EvalError', 'prototype'],
|
|
1805
|
-
'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
|
|
1806
|
-
'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
|
|
1807
|
-
'%FunctionPrototype%': ['Function', 'prototype'],
|
|
1808
|
-
'%Generator%': ['GeneratorFunction', 'prototype'],
|
|
1809
|
-
'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
|
|
1810
|
-
'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
|
|
1811
|
-
'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
|
|
1812
|
-
'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
|
|
1813
|
-
'%JSONParse%': ['JSON', 'parse'],
|
|
1814
|
-
'%JSONStringify%': ['JSON', 'stringify'],
|
|
1815
|
-
'%MapPrototype%': ['Map', 'prototype'],
|
|
1816
|
-
'%NumberPrototype%': ['Number', 'prototype'],
|
|
1817
|
-
'%ObjectPrototype%': ['Object', 'prototype'],
|
|
1818
|
-
'%ObjProto_toString%': ['Object', 'prototype', 'toString'],
|
|
1819
|
-
'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
|
|
1820
|
-
'%PromisePrototype%': ['Promise', 'prototype'],
|
|
1821
|
-
'%PromiseProto_then%': ['Promise', 'prototype', 'then'],
|
|
1822
|
-
'%Promise_all%': ['Promise', 'all'],
|
|
1823
|
-
'%Promise_reject%': ['Promise', 'reject'],
|
|
1824
|
-
'%Promise_resolve%': ['Promise', 'resolve'],
|
|
1825
|
-
'%RangeErrorPrototype%': ['RangeError', 'prototype'],
|
|
1826
|
-
'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
|
|
1827
|
-
'%RegExpPrototype%': ['RegExp', 'prototype'],
|
|
1828
|
-
'%SetPrototype%': ['Set', 'prototype'],
|
|
1829
|
-
'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
|
|
1830
|
-
'%StringPrototype%': ['String', 'prototype'],
|
|
1831
|
-
'%SymbolPrototype%': ['Symbol', 'prototype'],
|
|
1832
|
-
'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
|
|
1833
|
-
'%TypedArrayPrototype%': ['TypedArray', 'prototype'],
|
|
1834
|
-
'%TypeErrorPrototype%': ['TypeError', 'prototype'],
|
|
1835
|
-
'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
|
|
1836
|
-
'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
|
|
1837
|
-
'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
|
|
1838
|
-
'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
|
|
1839
|
-
'%URIErrorPrototype%': ['URIError', 'prototype'],
|
|
1840
|
-
'%WeakMapPrototype%': ['WeakMap', 'prototype'],
|
|
1841
|
-
'%WeakSetPrototype%': ['WeakSet', 'prototype']
|
|
1842
|
-
};
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
var $concat$2 = functionBind.call(Function.call, Array.prototype.concat);
|
|
1847
|
-
var $spliceApply = functionBind.call(Function.apply, Array.prototype.splice);
|
|
2851
|
+
|
|
1848
2852
|
var $replace = functionBind.call(Function.call, String.prototype.replace);
|
|
1849
|
-
var $strSlice = functionBind.call(Function.call, String.prototype.slice);
|
|
1850
2853
|
|
|
1851
2854
|
/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
|
|
1852
2855
|
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
|
1853
2856
|
var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
|
|
1854
2857
|
var stringToPath = function stringToPath(string) {
|
|
1855
|
-
var first = $strSlice(string, 0, 1);
|
|
1856
|
-
var last = $strSlice(string, -1);
|
|
1857
|
-
if (first === '%' && last !== '%') {
|
|
1858
|
-
throw new $SyntaxError$1('invalid intrinsic syntax, expected closing `%`');
|
|
1859
|
-
} else if (last === '%' && first !== '%') {
|
|
1860
|
-
throw new $SyntaxError$1('invalid intrinsic syntax, expected opening `%`');
|
|
1861
|
-
}
|
|
1862
2858
|
var result = [];
|
|
1863
2859
|
$replace(string, rePropName, function (match, number, quote, subString) {
|
|
1864
|
-
result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
|
|
2860
|
+
result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : (number || match);
|
|
1865
2861
|
});
|
|
1866
2862
|
return result;
|
|
1867
2863
|
};
|
|
1868
2864
|
/* end adaptation */
|
|
1869
2865
|
|
|
1870
2866
|
var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
if (src(LEGACY_ALIASES, intrinsicName)) {
|
|
1874
|
-
alias = LEGACY_ALIASES[intrinsicName];
|
|
1875
|
-
intrinsicName = '%' + alias[0] + '%';
|
|
2867
|
+
if (!(name in INTRINSICS)) {
|
|
2868
|
+
throw new SyntaxError('intrinsic ' + name + ' does not exist!');
|
|
1876
2869
|
}
|
|
1877
2870
|
|
|
1878
|
-
if
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
value = doEval(intrinsicName);
|
|
1882
|
-
}
|
|
1883
|
-
if (typeof value === 'undefined' && !allowMissing) {
|
|
1884
|
-
throw new $TypeError$5('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
|
|
1885
|
-
}
|
|
1886
|
-
|
|
1887
|
-
return {
|
|
1888
|
-
alias: alias,
|
|
1889
|
-
name: intrinsicName,
|
|
1890
|
-
value: value
|
|
1891
|
-
};
|
|
2871
|
+
// istanbul ignore if // hopefully this is impossible to test :-)
|
|
2872
|
+
if (typeof INTRINSICS[name] === 'undefined' && !allowMissing) {
|
|
2873
|
+
throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
|
|
1892
2874
|
}
|
|
1893
2875
|
|
|
1894
|
-
|
|
2876
|
+
return INTRINSICS[name];
|
|
1895
2877
|
};
|
|
1896
2878
|
|
|
1897
|
-
var
|
|
2879
|
+
var GetIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
1898
2880
|
if (typeof name !== 'string' || name.length === 0) {
|
|
1899
|
-
throw new
|
|
2881
|
+
throw new TypeError('intrinsic name must be a non-empty string');
|
|
1900
2882
|
}
|
|
1901
2883
|
if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
|
|
1902
|
-
throw new
|
|
2884
|
+
throw new TypeError('"allowMissing" argument must be a boolean');
|
|
1903
2885
|
}
|
|
1904
2886
|
|
|
1905
2887
|
var parts = stringToPath(name);
|
|
1906
|
-
var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
|
|
1907
|
-
|
|
1908
|
-
var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
|
|
1909
|
-
var intrinsicRealName = intrinsic.name;
|
|
1910
|
-
var value = intrinsic.value;
|
|
1911
|
-
var skipFurtherCaching = false;
|
|
1912
|
-
|
|
1913
|
-
var alias = intrinsic.alias;
|
|
1914
|
-
if (alias) {
|
|
1915
|
-
intrinsicBaseName = alias[0];
|
|
1916
|
-
$spliceApply(parts, $concat$2([0, 1], alias));
|
|
1917
|
-
}
|
|
1918
|
-
|
|
1919
|
-
for (var i = 1, isOwn = true; i < parts.length; i += 1) {
|
|
1920
|
-
var part = parts[i];
|
|
1921
|
-
var first = $strSlice(part, 0, 1);
|
|
1922
|
-
var last = $strSlice(part, -1);
|
|
1923
|
-
if (
|
|
1924
|
-
(
|
|
1925
|
-
(first === '"' || first === "'" || first === '`')
|
|
1926
|
-
|| (last === '"' || last === "'" || last === '`')
|
|
1927
|
-
)
|
|
1928
|
-
&& first !== last
|
|
1929
|
-
) {
|
|
1930
|
-
throw new $SyntaxError$1('property names with quotes must have matching quotes');
|
|
1931
|
-
}
|
|
1932
|
-
if (part === 'constructor' || !isOwn) {
|
|
1933
|
-
skipFurtherCaching = true;
|
|
1934
|
-
}
|
|
1935
|
-
|
|
1936
|
-
intrinsicBaseName += '.' + part;
|
|
1937
|
-
intrinsicRealName = '%' + intrinsicBaseName + '%';
|
|
1938
2888
|
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
if (
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
return void undefined$1;
|
|
1947
|
-
}
|
|
1948
|
-
if ($gOPD$2 && (i + 1) >= parts.length) {
|
|
1949
|
-
var desc = $gOPD$2(value, part);
|
|
1950
|
-
isOwn = !!desc;
|
|
1951
|
-
|
|
1952
|
-
// By convention, when a data property is converted to an accessor
|
|
1953
|
-
// property to emulate a data property that does not suffer from
|
|
1954
|
-
// the override mistake, that accessor's getter is marked with
|
|
1955
|
-
// an `originalValue` property. Here, when we detect this, we
|
|
1956
|
-
// uphold the illusion by pretending to see that original data
|
|
1957
|
-
// property, i.e., returning the value rather than the getter
|
|
1958
|
-
// itself.
|
|
1959
|
-
if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
|
|
1960
|
-
value = desc.get;
|
|
1961
|
-
} else {
|
|
1962
|
-
value = value[part];
|
|
2889
|
+
var value = getBaseIntrinsic('%' + (parts.length > 0 ? parts[0] : '') + '%', allowMissing);
|
|
2890
|
+
for (var i = 1; i < parts.length; i += 1) {
|
|
2891
|
+
if (value != null) {
|
|
2892
|
+
if ($gOPD && (i + 1) >= parts.length) {
|
|
2893
|
+
var desc = $gOPD(value, parts[i]);
|
|
2894
|
+
if (!allowMissing && !(parts[i] in value)) {
|
|
2895
|
+
throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
|
|
1963
2896
|
}
|
|
2897
|
+
value = desc ? (desc.get || desc.value) : value[parts[i]];
|
|
1964
2898
|
} else {
|
|
1965
|
-
|
|
1966
|
-
value = value[part];
|
|
1967
|
-
}
|
|
1968
|
-
|
|
1969
|
-
if (isOwn && !skipFurtherCaching) {
|
|
1970
|
-
INTRINSICS[intrinsicRealName] = value;
|
|
2899
|
+
value = value[parts[i]];
|
|
1971
2900
|
}
|
|
1972
2901
|
}
|
|
1973
2902
|
}
|
|
1974
2903
|
return value;
|
|
1975
2904
|
};
|
|
1976
2905
|
|
|
1977
|
-
var
|
|
1978
|
-
|
|
2906
|
+
var $Function = GetIntrinsic('%Function%');
|
|
2907
|
+
var $apply = $Function.apply;
|
|
2908
|
+
var $call = $Function.call;
|
|
1979
2909
|
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
var $apply = getIntrinsic('%Function.prototype.apply%');
|
|
1983
|
-
var $call = getIntrinsic('%Function.prototype.call%');
|
|
1984
|
-
var $reflectApply = getIntrinsic('%Reflect.apply%', true) || functionBind.call($call, $apply);
|
|
1985
|
-
|
|
1986
|
-
var $gOPD = getIntrinsic('%Object.getOwnPropertyDescriptor%', true);
|
|
1987
|
-
var $defineProperty = getIntrinsic('%Object.defineProperty%', true);
|
|
1988
|
-
var $max = getIntrinsic('%Math.max%');
|
|
1989
|
-
|
|
1990
|
-
if ($defineProperty) {
|
|
1991
|
-
try {
|
|
1992
|
-
$defineProperty({}, 'a', { value: 1 });
|
|
1993
|
-
} catch (e) {
|
|
1994
|
-
// IE 8 has a broken defineProperty
|
|
1995
|
-
$defineProperty = null;
|
|
1996
|
-
}
|
|
1997
|
-
}
|
|
1998
|
-
|
|
1999
|
-
module.exports = function callBind(originalFunction) {
|
|
2000
|
-
var func = $reflectApply(functionBind, $call, arguments);
|
|
2001
|
-
if ($gOPD && $defineProperty) {
|
|
2002
|
-
var desc = $gOPD(func, 'length');
|
|
2003
|
-
if (desc.configurable) {
|
|
2004
|
-
// original length, plus the receiver, minus any additional arguments (after the receiver)
|
|
2005
|
-
$defineProperty(
|
|
2006
|
-
func,
|
|
2007
|
-
'length',
|
|
2008
|
-
{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
|
|
2009
|
-
);
|
|
2010
|
-
}
|
|
2011
|
-
}
|
|
2012
|
-
return func;
|
|
2910
|
+
var callBind = function callBind() {
|
|
2911
|
+
return functionBind.apply($call, arguments);
|
|
2013
2912
|
};
|
|
2014
2913
|
|
|
2015
|
-
var
|
|
2016
|
-
return
|
|
2914
|
+
var apply = function applyBind() {
|
|
2915
|
+
return functionBind.apply($apply, arguments);
|
|
2017
2916
|
};
|
|
2917
|
+
callBind.apply = apply;
|
|
2018
2918
|
|
|
2019
|
-
|
|
2020
|
-
$defineProperty(module.exports, 'apply', { value: applyBind });
|
|
2021
|
-
} else {
|
|
2022
|
-
module.exports.apply = applyBind;
|
|
2023
|
-
}
|
|
2024
|
-
});
|
|
2025
|
-
callBind.apply;
|
|
2026
|
-
|
|
2027
|
-
var $indexOf = callBind(getIntrinsic('String.prototype.indexOf'));
|
|
2919
|
+
var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
|
|
2028
2920
|
|
|
2029
|
-
var callBound
|
|
2030
|
-
var intrinsic =
|
|
2031
|
-
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.')
|
|
2921
|
+
var callBound = function callBoundIntrinsic(name, allowMissing) {
|
|
2922
|
+
var intrinsic = GetIntrinsic(name, !!allowMissing);
|
|
2923
|
+
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.')) {
|
|
2032
2924
|
return callBind(intrinsic);
|
|
2033
2925
|
}
|
|
2034
2926
|
return intrinsic;
|
|
2035
2927
|
};
|
|
2036
2928
|
|
|
2037
|
-
var $defineProperty =
|
|
2929
|
+
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
|
|
2038
2930
|
|
|
2039
2931
|
if ($defineProperty) {
|
|
2040
2932
|
try {
|
|
@@ -2047,7 +2939,7 @@ if ($defineProperty) {
|
|
|
2047
2939
|
|
|
2048
2940
|
|
|
2049
2941
|
|
|
2050
|
-
var $isEnumerable
|
|
2942
|
+
var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
|
|
2051
2943
|
|
|
2052
2944
|
// eslint-disable-next-line max-params
|
|
2053
2945
|
var DefineOwnProperty = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) {
|
|
@@ -2061,7 +2953,7 @@ var DefineOwnProperty = function DefineOwnProperty(IsDataDescriptor, SameValue,
|
|
|
2061
2953
|
}
|
|
2062
2954
|
|
|
2063
2955
|
// fallback for ES3
|
|
2064
|
-
if (P in O && $isEnumerable
|
|
2956
|
+
if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) {
|
|
2065
2957
|
// a non-enumerable existing property
|
|
2066
2958
|
return false;
|
|
2067
2959
|
}
|
|
@@ -2076,13 +2968,15 @@ var DefineOwnProperty = function DefineOwnProperty(IsDataDescriptor, SameValue,
|
|
|
2076
2968
|
return true;
|
|
2077
2969
|
};
|
|
2078
2970
|
|
|
2079
|
-
var
|
|
2080
|
-
|
|
2971
|
+
var src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
|
|
2972
|
+
|
|
2973
|
+
var $TypeError$1 = GetIntrinsic('%TypeError%');
|
|
2974
|
+
var $SyntaxError = GetIntrinsic('%SyntaxError%');
|
|
2081
2975
|
|
|
2082
2976
|
|
|
2083
2977
|
|
|
2084
2978
|
var predicates = {
|
|
2085
|
-
// https://
|
|
2979
|
+
// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type
|
|
2086
2980
|
'Property Descriptor': function isPropertyDescriptor(Type, Desc) {
|
|
2087
2981
|
if (Type(Desc) !== 'Object') {
|
|
2088
2982
|
return false;
|
|
@@ -2105,7 +2999,7 @@ var predicates = {
|
|
|
2105
2999
|
var isData = src(Desc, '[[Value]]');
|
|
2106
3000
|
var IsAccessor = src(Desc, '[[Get]]') || src(Desc, '[[Set]]');
|
|
2107
3001
|
if (isData && IsAccessor) {
|
|
2108
|
-
throw new $TypeError$
|
|
3002
|
+
throw new $TypeError$1('Property Descriptors may not be both accessor and data descriptors');
|
|
2109
3003
|
}
|
|
2110
3004
|
return true;
|
|
2111
3005
|
}
|
|
@@ -2117,13 +3011,13 @@ var assertRecord = function assertRecord(Type, recordType, argumentName, value)
|
|
|
2117
3011
|
throw new $SyntaxError('unknown record type: ' + recordType);
|
|
2118
3012
|
}
|
|
2119
3013
|
if (!predicate(Type, value)) {
|
|
2120
|
-
throw new $TypeError$
|
|
3014
|
+
throw new $TypeError$1(argumentName + ' must be a ' + recordType);
|
|
2121
3015
|
}
|
|
2122
3016
|
};
|
|
2123
3017
|
|
|
2124
|
-
// https://
|
|
3018
|
+
// https://www.ecma-international.org/ecma-262/5.1/#sec-8
|
|
2125
3019
|
|
|
2126
|
-
var Type
|
|
3020
|
+
var Type = function Type(x) {
|
|
2127
3021
|
if (x === null) {
|
|
2128
3022
|
return 'Null';
|
|
2129
3023
|
}
|
|
@@ -2144,26 +3038,23 @@ var Type$1 = function Type(x) {
|
|
|
2144
3038
|
}
|
|
2145
3039
|
};
|
|
2146
3040
|
|
|
2147
|
-
// https://
|
|
3041
|
+
// https://www.ecma-international.org/ecma-262/6.0/#sec-tostring
|
|
2148
3042
|
|
|
2149
|
-
var Type = function Type(x) {
|
|
3043
|
+
var Type$1 = function Type$1(x) {
|
|
2150
3044
|
if (typeof x === 'symbol') {
|
|
2151
3045
|
return 'Symbol';
|
|
2152
3046
|
}
|
|
2153
|
-
|
|
2154
|
-
return 'BigInt';
|
|
2155
|
-
}
|
|
2156
|
-
return Type$1(x);
|
|
3047
|
+
return Type(x);
|
|
2157
3048
|
};
|
|
2158
3049
|
|
|
2159
|
-
// https://ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor
|
|
3050
|
+
// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor
|
|
2160
3051
|
|
|
2161
3052
|
var FromPropertyDescriptor = function FromPropertyDescriptor(Desc) {
|
|
2162
3053
|
if (typeof Desc === 'undefined') {
|
|
2163
3054
|
return Desc;
|
|
2164
3055
|
}
|
|
2165
3056
|
|
|
2166
|
-
assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
|
|
3057
|
+
assertRecord(Type$1, 'Property Descriptor', 'Desc', Desc);
|
|
2167
3058
|
|
|
2168
3059
|
var obj = {};
|
|
2169
3060
|
if ('[[Value]]' in Desc) {
|
|
@@ -2187,7 +3078,7 @@ var FromPropertyDescriptor = function FromPropertyDescriptor(Desc) {
|
|
|
2187
3078
|
return obj;
|
|
2188
3079
|
};
|
|
2189
3080
|
|
|
2190
|
-
var $gOPD$1 =
|
|
3081
|
+
var $gOPD$1 = GetIntrinsic('%Object.getOwnPropertyDescriptor%');
|
|
2191
3082
|
if ($gOPD$1) {
|
|
2192
3083
|
try {
|
|
2193
3084
|
$gOPD$1([], 'length');
|
|
@@ -2199,85 +3090,65 @@ if ($gOPD$1) {
|
|
|
2199
3090
|
|
|
2200
3091
|
var getOwnPropertyDescriptor = $gOPD$1;
|
|
2201
3092
|
|
|
2202
|
-
var $Array =
|
|
3093
|
+
var $Array = GetIntrinsic('%Array%');
|
|
2203
3094
|
|
|
2204
3095
|
// eslint-disable-next-line global-require
|
|
2205
|
-
var toStr$
|
|
3096
|
+
var toStr$4 = !$Array.isArray && callBound('Object.prototype.toString');
|
|
2206
3097
|
|
|
2207
|
-
// https://ecma-international.org/ecma-262/6.0/#sec-isarray
|
|
3098
|
+
// https://www.ecma-international.org/ecma-262/6.0/#sec-isarray
|
|
2208
3099
|
|
|
2209
3100
|
var IsArray = $Array.isArray || function IsArray(argument) {
|
|
2210
|
-
return toStr$
|
|
3101
|
+
return toStr$4(argument) === '[object Array]';
|
|
2211
3102
|
};
|
|
2212
3103
|
|
|
2213
|
-
// https://ecma-international.org/ecma-262/6.0/#sec-ispropertykey
|
|
3104
|
+
// https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey
|
|
2214
3105
|
|
|
2215
3106
|
var IsPropertyKey = function IsPropertyKey(argument) {
|
|
2216
3107
|
return typeof argument === 'string' || typeof argument === 'symbol';
|
|
2217
3108
|
};
|
|
2218
3109
|
|
|
2219
|
-
var
|
|
2220
|
-
var
|
|
2221
|
-
var has;
|
|
2222
|
-
var $exec;
|
|
2223
|
-
var isRegexMarker;
|
|
2224
|
-
var badStringifier;
|
|
2225
|
-
|
|
2226
|
-
if (hasToStringTag$1) {
|
|
2227
|
-
has = callBound$1('Object.prototype.hasOwnProperty');
|
|
2228
|
-
$exec = callBound$1('RegExp.prototype.exec');
|
|
2229
|
-
isRegexMarker = {};
|
|
3110
|
+
var regexExec = RegExp.prototype.exec;
|
|
3111
|
+
var gOPD = Object.getOwnPropertyDescriptor;
|
|
2230
3112
|
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
toString: throwRegexMarker,
|
|
2236
|
-
valueOf: throwRegexMarker
|
|
2237
|
-
};
|
|
3113
|
+
var tryRegexExecCall = function tryRegexExec(value) {
|
|
3114
|
+
try {
|
|
3115
|
+
var lastIndex = value.lastIndex;
|
|
3116
|
+
value.lastIndex = 0; // eslint-disable-line no-param-reassign
|
|
2238
3117
|
|
|
2239
|
-
|
|
2240
|
-
|
|
3118
|
+
regexExec.call(value);
|
|
3119
|
+
return true;
|
|
3120
|
+
} catch (e) {
|
|
3121
|
+
return false;
|
|
3122
|
+
} finally {
|
|
3123
|
+
value.lastIndex = lastIndex; // eslint-disable-line no-param-reassign
|
|
2241
3124
|
}
|
|
2242
|
-
}
|
|
2243
|
-
|
|
2244
|
-
var $toString = callBound$1('Object.prototype.toString');
|
|
2245
|
-
var gOPD = Object.getOwnPropertyDescriptor;
|
|
3125
|
+
};
|
|
3126
|
+
var toStr$5 = Object.prototype.toString;
|
|
2246
3127
|
var regexClass = '[object RegExp]';
|
|
3128
|
+
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
|
|
2247
3129
|
|
|
2248
|
-
var isRegex =
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
var descriptor = gOPD(value, 'lastIndex');
|
|
2256
|
-
var hasLastIndexDataProperty = descriptor && has(descriptor, 'value');
|
|
2257
|
-
if (!hasLastIndexDataProperty) {
|
|
2258
|
-
return false;
|
|
2259
|
-
}
|
|
3130
|
+
var isRegex = function isRegex(value) {
|
|
3131
|
+
if (!value || typeof value !== 'object') {
|
|
3132
|
+
return false;
|
|
3133
|
+
}
|
|
3134
|
+
if (!hasToStringTag) {
|
|
3135
|
+
return toStr$5.call(value) === regexClass;
|
|
3136
|
+
}
|
|
2260
3137
|
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
}
|
|
3138
|
+
var descriptor = gOPD(value, 'lastIndex');
|
|
3139
|
+
var hasLastIndexDataProperty = descriptor && src(descriptor, 'value');
|
|
3140
|
+
if (!hasLastIndexDataProperty) {
|
|
3141
|
+
return false;
|
|
2266
3142
|
}
|
|
2267
|
-
: function isRegex(value) {
|
|
2268
|
-
// In older browsers, typeof regex incorrectly returns 'function'
|
|
2269
|
-
if (!value || (typeof value !== 'object' && typeof value !== 'function')) {
|
|
2270
|
-
return false;
|
|
2271
|
-
}
|
|
2272
3143
|
|
|
2273
|
-
|
|
2274
|
-
|
|
3144
|
+
return tryRegexExecCall(value);
|
|
3145
|
+
};
|
|
2275
3146
|
|
|
2276
|
-
// http://
|
|
3147
|
+
// http://www.ecma-international.org/ecma-262/5.1/#sec-9.2
|
|
2277
3148
|
|
|
2278
3149
|
var ToBoolean = function ToBoolean(value) { return !!value; };
|
|
2279
3150
|
|
|
2280
|
-
var $match =
|
|
3151
|
+
var $match = GetIntrinsic('%Symbol.match%', true);
|
|
2281
3152
|
|
|
2282
3153
|
|
|
2283
3154
|
|
|
@@ -2299,27 +3170,6 @@ var IsRegExp = function IsRegExp(argument) {
|
|
|
2299
3170
|
};
|
|
2300
3171
|
|
|
2301
3172
|
var fnToStr = Function.prototype.toString;
|
|
2302
|
-
var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;
|
|
2303
|
-
var badArrayLike;
|
|
2304
|
-
var isCallableMarker;
|
|
2305
|
-
if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {
|
|
2306
|
-
try {
|
|
2307
|
-
badArrayLike = Object.defineProperty({}, 'length', {
|
|
2308
|
-
get: function () {
|
|
2309
|
-
throw isCallableMarker;
|
|
2310
|
-
}
|
|
2311
|
-
});
|
|
2312
|
-
isCallableMarker = {};
|
|
2313
|
-
// eslint-disable-next-line no-throw-literal
|
|
2314
|
-
reflectApply(function () { throw 42; }, null, badArrayLike);
|
|
2315
|
-
} catch (_) {
|
|
2316
|
-
if (_ !== isCallableMarker) {
|
|
2317
|
-
reflectApply = null;
|
|
2318
|
-
}
|
|
2319
|
-
}
|
|
2320
|
-
} else {
|
|
2321
|
-
reflectApply = null;
|
|
2322
|
-
}
|
|
2323
3173
|
|
|
2324
3174
|
var constructorRegex = /^\s*class\b/;
|
|
2325
3175
|
var isES6ClassFn = function isES6ClassFunction(value) {
|
|
@@ -2340,52 +3190,36 @@ var tryFunctionObject = function tryFunctionToStr(value) {
|
|
|
2340
3190
|
return false;
|
|
2341
3191
|
}
|
|
2342
3192
|
};
|
|
2343
|
-
var toStr = Object.prototype.toString;
|
|
3193
|
+
var toStr$6 = Object.prototype.toString;
|
|
2344
3194
|
var fnClass = '[object Function]';
|
|
2345
3195
|
var genClass = '[object GeneratorFunction]';
|
|
2346
|
-
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
|
|
2347
|
-
|
|
2348
|
-
var
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
reflectApply(value, null, badArrayLike);
|
|
2358
|
-
} catch (e) {
|
|
2359
|
-
if (e !== isCallableMarker) { return false; }
|
|
2360
|
-
}
|
|
2361
|
-
return !isES6ClassFn(value);
|
|
2362
|
-
}
|
|
2363
|
-
: function isCallable(value) {
|
|
2364
|
-
if (value === documentDotAll) { return true; }
|
|
2365
|
-
if (!value) { return false; }
|
|
2366
|
-
if (typeof value !== 'function' && typeof value !== 'object') { return false; }
|
|
2367
|
-
if (typeof value === 'function' && !value.prototype) { return true; }
|
|
2368
|
-
if (hasToStringTag) { return tryFunctionObject(value); }
|
|
2369
|
-
if (isES6ClassFn(value)) { return false; }
|
|
2370
|
-
var strClass = toStr.call(value);
|
|
2371
|
-
return strClass === fnClass || strClass === genClass;
|
|
2372
|
-
};
|
|
3196
|
+
var hasToStringTag$1 = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
|
|
3197
|
+
|
|
3198
|
+
var isCallable = function isCallable(value) {
|
|
3199
|
+
if (!value) { return false; }
|
|
3200
|
+
if (typeof value !== 'function' && typeof value !== 'object') { return false; }
|
|
3201
|
+
if (typeof value === 'function' && !value.prototype) { return true; }
|
|
3202
|
+
if (hasToStringTag$1) { return tryFunctionObject(value); }
|
|
3203
|
+
if (isES6ClassFn(value)) { return false; }
|
|
3204
|
+
var strClass = toStr$6.call(value);
|
|
3205
|
+
return strClass === fnClass || strClass === genClass;
|
|
3206
|
+
};
|
|
2373
3207
|
|
|
2374
|
-
// http://
|
|
3208
|
+
// http://www.ecma-international.org/ecma-262/5.1/#sec-9.11
|
|
2375
3209
|
|
|
2376
3210
|
var IsCallable = isCallable;
|
|
2377
3211
|
|
|
2378
|
-
var $TypeError$
|
|
3212
|
+
var $TypeError$2 = GetIntrinsic('%TypeError%');
|
|
2379
3213
|
|
|
2380
3214
|
|
|
2381
3215
|
|
|
2382
3216
|
|
|
2383
3217
|
|
|
2384
|
-
// https://
|
|
3218
|
+
// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5
|
|
2385
3219
|
|
|
2386
3220
|
var ToPropertyDescriptor = function ToPropertyDescriptor(Obj) {
|
|
2387
|
-
if (Type(Obj) !== 'Object') {
|
|
2388
|
-
throw new $TypeError$
|
|
3221
|
+
if (Type$1(Obj) !== 'Object') {
|
|
3222
|
+
throw new $TypeError$2('ToPropertyDescriptor requires an object');
|
|
2389
3223
|
}
|
|
2390
3224
|
|
|
2391
3225
|
var desc = {};
|
|
@@ -2404,29 +3238,29 @@ var ToPropertyDescriptor = function ToPropertyDescriptor(Obj) {
|
|
|
2404
3238
|
if (src(Obj, 'get')) {
|
|
2405
3239
|
var getter = Obj.get;
|
|
2406
3240
|
if (typeof getter !== 'undefined' && !IsCallable(getter)) {
|
|
2407
|
-
throw new
|
|
3241
|
+
throw new TypeError('getter must be a function');
|
|
2408
3242
|
}
|
|
2409
3243
|
desc['[[Get]]'] = getter;
|
|
2410
3244
|
}
|
|
2411
3245
|
if (src(Obj, 'set')) {
|
|
2412
3246
|
var setter = Obj.set;
|
|
2413
3247
|
if (typeof setter !== 'undefined' && !IsCallable(setter)) {
|
|
2414
|
-
throw new $TypeError$
|
|
3248
|
+
throw new $TypeError$2('setter must be a function');
|
|
2415
3249
|
}
|
|
2416
3250
|
desc['[[Set]]'] = setter;
|
|
2417
3251
|
}
|
|
2418
3252
|
|
|
2419
3253
|
if ((src(desc, '[[Get]]') || src(desc, '[[Set]]')) && (src(desc, '[[Value]]') || src(desc, '[[Writable]]'))) {
|
|
2420
|
-
throw new $TypeError$
|
|
3254
|
+
throw new $TypeError$2('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');
|
|
2421
3255
|
}
|
|
2422
3256
|
return desc;
|
|
2423
3257
|
};
|
|
2424
3258
|
|
|
2425
|
-
var $TypeError$
|
|
3259
|
+
var $TypeError$3 = GetIntrinsic('%TypeError%');
|
|
2426
3260
|
|
|
2427
3261
|
|
|
2428
3262
|
|
|
2429
|
-
var $isEnumerable = callBound
|
|
3263
|
+
var $isEnumerable$1 = callBound('Object.prototype.propertyIsEnumerable');
|
|
2430
3264
|
|
|
2431
3265
|
|
|
2432
3266
|
|
|
@@ -2436,14 +3270,14 @@ var $isEnumerable = callBound$1('Object.prototype.propertyIsEnumerable');
|
|
|
2436
3270
|
|
|
2437
3271
|
|
|
2438
3272
|
|
|
2439
|
-
// https://ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty
|
|
3273
|
+
// https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty
|
|
2440
3274
|
|
|
2441
3275
|
var OrdinaryGetOwnProperty = function OrdinaryGetOwnProperty(O, P) {
|
|
2442
|
-
if (Type(O) !== 'Object') {
|
|
2443
|
-
throw new $TypeError$
|
|
3276
|
+
if (Type$1(O) !== 'Object') {
|
|
3277
|
+
throw new $TypeError$3('Assertion failed: O must be an Object');
|
|
2444
3278
|
}
|
|
2445
3279
|
if (!IsPropertyKey(P)) {
|
|
2446
|
-
throw new $TypeError$
|
|
3280
|
+
throw new $TypeError$3('Assertion failed: P must be a Property Key');
|
|
2447
3281
|
}
|
|
2448
3282
|
if (!src(O, P)) {
|
|
2449
3283
|
return void 0;
|
|
@@ -2454,7 +3288,7 @@ var OrdinaryGetOwnProperty = function OrdinaryGetOwnProperty(O, P) {
|
|
|
2454
3288
|
var regexLastIndex = IsRegExp(O) && P === 'lastIndex';
|
|
2455
3289
|
return {
|
|
2456
3290
|
'[[Configurable]]': !(arrayLength || regexLastIndex),
|
|
2457
|
-
'[[Enumerable]]': $isEnumerable(O, P),
|
|
3291
|
+
'[[Enumerable]]': $isEnumerable$1(O, P),
|
|
2458
3292
|
'[[Value]]': O[P],
|
|
2459
3293
|
'[[Writable]]': true
|
|
2460
3294
|
};
|
|
@@ -2462,14 +3296,14 @@ var OrdinaryGetOwnProperty = function OrdinaryGetOwnProperty(O, P) {
|
|
|
2462
3296
|
return ToPropertyDescriptor(getOwnPropertyDescriptor(O, P));
|
|
2463
3297
|
};
|
|
2464
3298
|
|
|
2465
|
-
// https://ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor
|
|
3299
|
+
// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor
|
|
2466
3300
|
|
|
2467
3301
|
var IsDataDescriptor = function IsDataDescriptor(Desc) {
|
|
2468
3302
|
if (typeof Desc === 'undefined') {
|
|
2469
3303
|
return false;
|
|
2470
3304
|
}
|
|
2471
3305
|
|
|
2472
|
-
assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
|
|
3306
|
+
assertRecord(Type$1, 'Property Descriptor', 'Desc', Desc);
|
|
2473
3307
|
|
|
2474
3308
|
if (!src(Desc, '[[Value]]') && !src(Desc, '[[Writable]]')) {
|
|
2475
3309
|
return false;
|
|
@@ -2482,14 +3316,14 @@ var isPrimitive = function isPrimitive(value) {
|
|
|
2482
3316
|
return value === null || (typeof value !== 'function' && typeof value !== 'object');
|
|
2483
3317
|
};
|
|
2484
3318
|
|
|
2485
|
-
var $Object
|
|
3319
|
+
var $Object = GetIntrinsic('%Object%');
|
|
2486
3320
|
|
|
2487
3321
|
|
|
2488
3322
|
|
|
2489
|
-
var $preventExtensions = $Object
|
|
2490
|
-
var $isExtensible = $Object
|
|
3323
|
+
var $preventExtensions = $Object.preventExtensions;
|
|
3324
|
+
var $isExtensible = $Object.isExtensible;
|
|
2491
3325
|
|
|
2492
|
-
// https://ecma-international.org/ecma-262/6.0/#sec-isextensible-o
|
|
3326
|
+
// https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o
|
|
2493
3327
|
|
|
2494
3328
|
var IsExtensible = $preventExtensions
|
|
2495
3329
|
? function IsExtensible(obj) {
|
|
@@ -2503,7 +3337,7 @@ var _isNaN = Number.isNaN || function isNaN(a) {
|
|
|
2503
3337
|
return a !== a;
|
|
2504
3338
|
};
|
|
2505
3339
|
|
|
2506
|
-
// http://
|
|
3340
|
+
// http://www.ecma-international.org/ecma-262/5.1/#sec-9.12
|
|
2507
3341
|
|
|
2508
3342
|
var SameValue = function SameValue(x, y) {
|
|
2509
3343
|
if (x === y) { // 0 === -0, but they are not identical.
|
|
@@ -2513,7 +3347,7 @@ var SameValue = function SameValue(x, y) {
|
|
|
2513
3347
|
return _isNaN(x) && _isNaN(y);
|
|
2514
3348
|
};
|
|
2515
3349
|
|
|
2516
|
-
var $TypeError$
|
|
3350
|
+
var $TypeError$4 = GetIntrinsic('%TypeError%');
|
|
2517
3351
|
|
|
2518
3352
|
|
|
2519
3353
|
|
|
@@ -2525,18 +3359,18 @@ var $TypeError$1 = getIntrinsic('%TypeError%');
|
|
|
2525
3359
|
|
|
2526
3360
|
|
|
2527
3361
|
|
|
2528
|
-
// https://ecma-international.org/ecma-262/6.0/#sec-createdataproperty
|
|
3362
|
+
// https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty
|
|
2529
3363
|
|
|
2530
3364
|
var CreateDataProperty = function CreateDataProperty(O, P, V) {
|
|
2531
|
-
if (Type(O) !== 'Object') {
|
|
2532
|
-
throw new $TypeError$
|
|
3365
|
+
if (Type$1(O) !== 'Object') {
|
|
3366
|
+
throw new $TypeError$4('Assertion failed: Type(O) is not Object');
|
|
2533
3367
|
}
|
|
2534
3368
|
if (!IsPropertyKey(P)) {
|
|
2535
|
-
throw new $TypeError$
|
|
3369
|
+
throw new $TypeError$4('Assertion failed: IsPropertyKey(P) is not true');
|
|
2536
3370
|
}
|
|
2537
3371
|
var oldDesc = OrdinaryGetOwnProperty(O, P);
|
|
2538
|
-
var extensible =
|
|
2539
|
-
var immutable = oldDesc && (!oldDesc
|
|
3372
|
+
var extensible = oldDesc || IsExtensible(O);
|
|
3373
|
+
var immutable = oldDesc && (!oldDesc.writable || !oldDesc.configurable);
|
|
2540
3374
|
if (immutable || !extensible) {
|
|
2541
3375
|
return false;
|
|
2542
3376
|
}
|
|
@@ -2555,44 +3389,44 @@ var CreateDataProperty = function CreateDataProperty(O, P, V) {
|
|
|
2555
3389
|
);
|
|
2556
3390
|
};
|
|
2557
3391
|
|
|
2558
|
-
var $TypeError =
|
|
3392
|
+
var $TypeError$5 = GetIntrinsic('%TypeError%');
|
|
2559
3393
|
|
|
2560
|
-
// http://
|
|
3394
|
+
// http://www.ecma-international.org/ecma-262/5.1/#sec-9.10
|
|
2561
3395
|
|
|
2562
3396
|
var CheckObjectCoercible = function CheckObjectCoercible(value, optMessage) {
|
|
2563
3397
|
if (value == null) {
|
|
2564
|
-
throw new $TypeError(optMessage || ('Cannot call method on ' + value));
|
|
3398
|
+
throw new $TypeError$5(optMessage || ('Cannot call method on ' + value));
|
|
2565
3399
|
}
|
|
2566
3400
|
return value;
|
|
2567
3401
|
};
|
|
2568
3402
|
|
|
2569
3403
|
var RequireObjectCoercible = CheckObjectCoercible;
|
|
2570
3404
|
|
|
2571
|
-
var $Object =
|
|
3405
|
+
var $Object$1 = GetIntrinsic('%Object%');
|
|
2572
3406
|
|
|
2573
3407
|
|
|
2574
3408
|
|
|
2575
|
-
// https://ecma-international.org/ecma-262/6.0/#sec-toobject
|
|
3409
|
+
// https://www.ecma-international.org/ecma-262/6.0/#sec-toobject
|
|
2576
3410
|
|
|
2577
3411
|
var ToObject = function ToObject(value) {
|
|
2578
3412
|
RequireObjectCoercible(value);
|
|
2579
|
-
return $Object(value);
|
|
3413
|
+
return $Object$1(value);
|
|
2580
3414
|
};
|
|
2581
3415
|
|
|
2582
|
-
var $gOPD = Object.getOwnPropertyDescriptor;
|
|
3416
|
+
var $gOPD$2 = Object.getOwnPropertyDescriptor;
|
|
2583
3417
|
var $getOwnNames = Object.getOwnPropertyNames;
|
|
2584
3418
|
var $getSymbols = Object.getOwnPropertySymbols;
|
|
2585
|
-
var $concat
|
|
2586
|
-
var $reduce = callBound
|
|
3419
|
+
var $concat = callBound('Array.prototype.concat');
|
|
3420
|
+
var $reduce = callBound('Array.prototype.reduce');
|
|
2587
3421
|
var getAll = $getSymbols ? function (obj) {
|
|
2588
|
-
return $concat
|
|
3422
|
+
return $concat($getOwnNames(obj), $getSymbols(obj));
|
|
2589
3423
|
} : $getOwnNames;
|
|
2590
3424
|
|
|
2591
|
-
var isES5
|
|
3425
|
+
var isES5 = IsCallable($gOPD$2) && IsCallable($getOwnNames);
|
|
2592
3426
|
|
|
2593
|
-
var implementation$
|
|
3427
|
+
var implementation$2 = function getOwnPropertyDescriptors(value) {
|
|
2594
3428
|
RequireObjectCoercible(value);
|
|
2595
|
-
if (!isES5
|
|
3429
|
+
if (!isES5) {
|
|
2596
3430
|
throw new TypeError('getOwnPropertyDescriptors requires Object.getOwnPropertyDescriptor');
|
|
2597
3431
|
}
|
|
2598
3432
|
|
|
@@ -2600,7 +3434,7 @@ var implementation$1 = function getOwnPropertyDescriptors(value) {
|
|
|
2600
3434
|
return $reduce(
|
|
2601
3435
|
getAll(O),
|
|
2602
3436
|
function (acc, key) {
|
|
2603
|
-
var descriptor = $gOPD(O, key);
|
|
3437
|
+
var descriptor = $gOPD$2(O, key);
|
|
2604
3438
|
if (typeof descriptor !== 'undefined') {
|
|
2605
3439
|
CreateDataProperty(acc, key, descriptor);
|
|
2606
3440
|
}
|
|
@@ -2610,40 +3444,34 @@ var implementation$1 = function getOwnPropertyDescriptors(value) {
|
|
|
2610
3444
|
);
|
|
2611
3445
|
};
|
|
2612
3446
|
|
|
2613
|
-
var polyfill
|
|
2614
|
-
return typeof Object.getOwnPropertyDescriptors === 'function' ? Object.getOwnPropertyDescriptors : implementation$
|
|
3447
|
+
var polyfill = function getPolyfill() {
|
|
3448
|
+
return typeof Object.getOwnPropertyDescriptors === 'function' ? Object.getOwnPropertyDescriptors : implementation$2;
|
|
2615
3449
|
};
|
|
2616
3450
|
|
|
2617
|
-
var shim
|
|
2618
|
-
var polyfill = polyfill
|
|
3451
|
+
var shim = function shimGetOwnPropertyDescriptors() {
|
|
3452
|
+
var polyfill$1 = polyfill();
|
|
2619
3453
|
defineProperties_1(
|
|
2620
3454
|
Object,
|
|
2621
|
-
{ getOwnPropertyDescriptors: polyfill },
|
|
2622
|
-
{ getOwnPropertyDescriptors: function () { return Object.getOwnPropertyDescriptors !== polyfill; } }
|
|
3455
|
+
{ getOwnPropertyDescriptors: polyfill$1 },
|
|
3456
|
+
{ getOwnPropertyDescriptors: function () { return Object.getOwnPropertyDescriptors !== polyfill$1; } }
|
|
2623
3457
|
);
|
|
2624
|
-
return polyfill;
|
|
3458
|
+
return polyfill$1;
|
|
2625
3459
|
};
|
|
2626
3460
|
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
implementation: implementation$1,
|
|
2632
|
-
shim: shim$1
|
|
3461
|
+
defineProperties_1(implementation$2, {
|
|
3462
|
+
getPolyfill: polyfill,
|
|
3463
|
+
implementation: implementation$2,
|
|
3464
|
+
shim: shim
|
|
2633
3465
|
});
|
|
2634
3466
|
|
|
2635
|
-
var object_getownpropertydescriptors =
|
|
2636
|
-
|
|
2637
|
-
// TODO; semver-major: remove
|
|
3467
|
+
var object_getownpropertydescriptors = implementation$2;
|
|
2638
3468
|
|
|
2639
|
-
var
|
|
2640
|
-
|
|
2641
|
-
var isES5 = typeof Object.defineProperty === 'function'
|
|
3469
|
+
var isES5$1 = typeof Object.defineProperty === 'function'
|
|
2642
3470
|
&& typeof Object.defineProperties === 'function';
|
|
2643
3471
|
|
|
2644
3472
|
var hasProto = [].__proto__ === Array.prototype; // eslint-disable-line no-proto
|
|
2645
3473
|
|
|
2646
|
-
if (!isES5 || !hasProto) {
|
|
3474
|
+
if (!isES5$1 || !hasProto) {
|
|
2647
3475
|
throw new TypeError('util.promisify requires a true ES5 environment, that also supports `__proto__`');
|
|
2648
3476
|
}
|
|
2649
3477
|
|
|
@@ -2656,15 +3484,15 @@ if (typeof Promise !== 'function') {
|
|
|
2656
3484
|
|
|
2657
3485
|
|
|
2658
3486
|
var $slice = callBound('Array.prototype.slice');
|
|
2659
|
-
var $concat = callBound('Array.prototype.concat');
|
|
3487
|
+
var $concat$1 = callBound('Array.prototype.concat');
|
|
2660
3488
|
var $forEach = callBound('Array.prototype.forEach');
|
|
2661
3489
|
|
|
2662
|
-
var hasSymbols = hasSymbols$
|
|
3490
|
+
var hasSymbols$3 = hasSymbols$1();
|
|
2663
3491
|
|
|
2664
|
-
var kCustomPromisifiedSymbol = hasSymbols ? Symbol('util.promisify.custom') : null;
|
|
2665
|
-
var kCustomPromisifyArgsSymbol = hasSymbols ? Symbol('customPromisifyArgs') : null;
|
|
3492
|
+
var kCustomPromisifiedSymbol = hasSymbols$3 ? Symbol('util.promisify.custom') : null;
|
|
3493
|
+
var kCustomPromisifyArgsSymbol = hasSymbols$3 ? Symbol('customPromisifyArgs') : null;
|
|
2666
3494
|
|
|
2667
|
-
var implementation = function promisify(orig) {
|
|
3495
|
+
var implementation$3 = function promisify(orig) {
|
|
2668
3496
|
if (typeof orig !== 'function') {
|
|
2669
3497
|
var error = new TypeError('The "original" argument must be of type function');
|
|
2670
3498
|
error.name = 'TypeError [ERR_INVALID_ARG_TYPE]';
|
|
@@ -2672,7 +3500,7 @@ var implementation = function promisify(orig) {
|
|
|
2672
3500
|
throw error;
|
|
2673
3501
|
}
|
|
2674
3502
|
|
|
2675
|
-
if (hasSymbols && orig[kCustomPromisifiedSymbol]) {
|
|
3503
|
+
if (hasSymbols$3 && orig[kCustomPromisifiedSymbol]) {
|
|
2676
3504
|
var customFunction = orig[kCustomPromisifiedSymbol];
|
|
2677
3505
|
if (typeof customFunction !== 'function') {
|
|
2678
3506
|
throw new TypeError('The [util.promisify.custom] property must be a function');
|
|
@@ -2694,7 +3522,7 @@ var implementation = function promisify(orig) {
|
|
|
2694
3522
|
var args = $slice(arguments);
|
|
2695
3523
|
var self = this; // eslint-disable-line no-invalid-this
|
|
2696
3524
|
return new Promise(function (resolve, reject) {
|
|
2697
|
-
orig.apply(self, $concat(args, function (err) {
|
|
3525
|
+
orig.apply(self, $concat$1(args, function (err) {
|
|
2698
3526
|
var values = arguments.length > 1 ? $slice(arguments, 1) : [];
|
|
2699
3527
|
if (err) {
|
|
2700
3528
|
reject(err);
|
|
@@ -2724,17 +3552,17 @@ var implementation = function promisify(orig) {
|
|
|
2724
3552
|
|
|
2725
3553
|
var custom = kCustomPromisifiedSymbol;
|
|
2726
3554
|
var customPromisifyArgs = kCustomPromisifyArgsSymbol;
|
|
2727
|
-
implementation.custom = custom;
|
|
2728
|
-
implementation.customPromisifyArgs = customPromisifyArgs;
|
|
3555
|
+
implementation$3.custom = custom;
|
|
3556
|
+
implementation$3.customPromisifyArgs = customPromisifyArgs;
|
|
2729
3557
|
|
|
2730
3558
|
var polyfill$1 = function getPolyfill() {
|
|
2731
3559
|
if (typeof util.promisify === 'function') {
|
|
2732
3560
|
return util.promisify;
|
|
2733
3561
|
}
|
|
2734
|
-
return implementation;
|
|
3562
|
+
return implementation$3;
|
|
2735
3563
|
};
|
|
2736
3564
|
|
|
2737
|
-
var shim = function shimUtilPromisify() {
|
|
3565
|
+
var shim$1 = function shimUtilPromisify() {
|
|
2738
3566
|
var polyfill = polyfill$1();
|
|
2739
3567
|
if (polyfill !== util.promisify) {
|
|
2740
3568
|
Object.defineProperty(util, 'promisify', {
|
|
@@ -2747,20 +3575,20 @@ var shim = function shimUtilPromisify() {
|
|
|
2747
3575
|
return polyfill;
|
|
2748
3576
|
};
|
|
2749
3577
|
|
|
2750
|
-
var polyfill = polyfill$1();
|
|
3578
|
+
var polyfill$2 = polyfill$1();
|
|
2751
3579
|
|
|
2752
3580
|
|
|
2753
3581
|
/* eslint-disable no-unused-vars */
|
|
2754
3582
|
var boundPromisify = function promisify(orig) {
|
|
2755
3583
|
/* eslint-enable no-unused-vars */
|
|
2756
|
-
return polyfill.apply(util, arguments);
|
|
3584
|
+
return polyfill$2.apply(util, arguments);
|
|
2757
3585
|
};
|
|
2758
3586
|
defineProperties_1(boundPromisify, {
|
|
2759
|
-
custom: polyfill.custom,
|
|
2760
|
-
customPromisifyArgs: polyfill.customPromisifyArgs,
|
|
3587
|
+
custom: polyfill$2.custom,
|
|
3588
|
+
customPromisifyArgs: polyfill$2.customPromisifyArgs,
|
|
2761
3589
|
getPolyfill: polyfill$1,
|
|
2762
|
-
implementation: implementation,
|
|
2763
|
-
shim: shim
|
|
3590
|
+
implementation: implementation$3,
|
|
3591
|
+
shim: shim$1
|
|
2764
3592
|
});
|
|
2765
3593
|
|
|
2766
3594
|
var util_promisify = boundPromisify;
|
|
@@ -2801,16 +3629,16 @@ function connect() {
|
|
|
2801
3629
|
|
|
2802
3630
|
var db = connect;
|
|
2803
3631
|
|
|
2804
|
-
var _this$
|
|
3632
|
+
var _this$3 = undefined;
|
|
2805
3633
|
|
|
2806
|
-
var config
|
|
3634
|
+
var config = {
|
|
2807
3635
|
host: 'sanity-datasource.cluster-crao688bsrdh.us-east-1.rds.amazonaws.com',
|
|
2808
3636
|
user: 'nasp',
|
|
2809
3637
|
password: 'uRNkF9SkfXQs6AKK',
|
|
2810
3638
|
database: 'user'
|
|
2811
3639
|
};
|
|
2812
3640
|
|
|
2813
|
-
var findUser
|
|
3641
|
+
var findUser = function () {
|
|
2814
3642
|
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(email) {
|
|
2815
3643
|
var password = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
2816
3644
|
var db$1, query, res, user, hash, passwordsMatch, user_shared, occupation_id;
|
|
@@ -2822,7 +3650,7 @@ var findUser$1 = function () {
|
|
|
2822
3650
|
_context.prev = 1;
|
|
2823
3651
|
|
|
2824
3652
|
|
|
2825
|
-
db$1 = db(config
|
|
3653
|
+
db$1 = db(config);
|
|
2826
3654
|
|
|
2827
3655
|
query = '\n select * \n from user \n where trim(lower(email)) = ?\n ';
|
|
2828
3656
|
_context.next = 6;
|
|
@@ -2918,7 +3746,7 @@ var findUser$1 = function () {
|
|
|
2918
3746
|
};
|
|
2919
3747
|
}();
|
|
2920
3748
|
|
|
2921
|
-
var updateUser
|
|
3749
|
+
var updateUser = function () {
|
|
2922
3750
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(data) {
|
|
2923
3751
|
var db$1, query, res, hash, columns, i, column, occupation_name;
|
|
2924
3752
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
@@ -2931,7 +3759,7 @@ var updateUser$1 = function () {
|
|
|
2931
3759
|
|
|
2932
3760
|
validateUserData(data);
|
|
2933
3761
|
|
|
2934
|
-
db$1 = db(config
|
|
3762
|
+
db$1 = db(config);
|
|
2935
3763
|
|
|
2936
3764
|
_context2.next = 6;
|
|
2937
3765
|
return db$1.beginTransaction();
|
|
@@ -3038,7 +3866,7 @@ var updateUser$1 = function () {
|
|
|
3038
3866
|
|
|
3039
3867
|
return _context2.abrupt('return', {
|
|
3040
3868
|
error: '',
|
|
3041
|
-
user: findUser
|
|
3869
|
+
user: findUser(data.email)
|
|
3042
3870
|
});
|
|
3043
3871
|
|
|
3044
3872
|
case 45:
|
|
@@ -3150,7 +3978,7 @@ var getOccupationNameById = function () {
|
|
|
3150
3978
|
return _context3.stop();
|
|
3151
3979
|
}
|
|
3152
3980
|
}
|
|
3153
|
-
}, _callee3, _this$
|
|
3981
|
+
}, _callee3, _this$3);
|
|
3154
3982
|
}));
|
|
3155
3983
|
|
|
3156
3984
|
return function getOccupationNameById(_x5, _x6) {
|
|
@@ -3158,7 +3986,7 @@ var getOccupationNameById = function () {
|
|
|
3158
3986
|
};
|
|
3159
3987
|
}();
|
|
3160
3988
|
|
|
3161
|
-
var createUser
|
|
3989
|
+
var createUser = function () {
|
|
3162
3990
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee4(data) {
|
|
3163
3991
|
var db$1, query, res, hash, columns, i, column, user_id, occupation_name;
|
|
3164
3992
|
return regenerator.wrap(function _callee4$(_context4) {
|
|
@@ -3171,7 +3999,7 @@ var createUser$1 = function () {
|
|
|
3171
3999
|
|
|
3172
4000
|
validateUserData(data, true);
|
|
3173
4001
|
|
|
3174
|
-
db$1 = db(config
|
|
4002
|
+
db$1 = db(config);
|
|
3175
4003
|
|
|
3176
4004
|
_context4.next = 6;
|
|
3177
4005
|
return db$1.beginTransaction();
|
|
@@ -3267,7 +4095,7 @@ var createUser$1 = function () {
|
|
|
3267
4095
|
case 39:
|
|
3268
4096
|
return _context4.abrupt('return', {
|
|
3269
4097
|
error: '',
|
|
3270
|
-
user: findUser
|
|
4098
|
+
user: findUser(data.email)
|
|
3271
4099
|
});
|
|
3272
4100
|
|
|
3273
4101
|
case 42:
|
|
@@ -3305,7 +4133,7 @@ var createUser$1 = function () {
|
|
|
3305
4133
|
};
|
|
3306
4134
|
}();
|
|
3307
4135
|
|
|
3308
|
-
var createUser = function () {
|
|
4136
|
+
var createUser$1 = function () {
|
|
3309
4137
|
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(data) {
|
|
3310
4138
|
var res;
|
|
3311
4139
|
return regenerator.wrap(function _callee$(_context) {
|
|
@@ -3313,7 +4141,7 @@ var createUser = function () {
|
|
|
3313
4141
|
switch (_context.prev = _context.next) {
|
|
3314
4142
|
case 0:
|
|
3315
4143
|
_context.next = 2;
|
|
3316
|
-
return createUser
|
|
4144
|
+
return createUser(data);
|
|
3317
4145
|
|
|
3318
4146
|
case 2:
|
|
3319
4147
|
res = _context.sent;
|
|
@@ -3341,7 +4169,7 @@ var createUser = function () {
|
|
|
3341
4169
|
};
|
|
3342
4170
|
}();
|
|
3343
4171
|
|
|
3344
|
-
var updateUser = function () {
|
|
4172
|
+
var updateUser$1 = function () {
|
|
3345
4173
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(data) {
|
|
3346
4174
|
var res;
|
|
3347
4175
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
@@ -3349,7 +4177,7 @@ var updateUser = function () {
|
|
|
3349
4177
|
switch (_context2.prev = _context2.next) {
|
|
3350
4178
|
case 0:
|
|
3351
4179
|
_context2.next = 2;
|
|
3352
|
-
return updateUser
|
|
4180
|
+
return updateUser(data);
|
|
3353
4181
|
|
|
3354
4182
|
case 2:
|
|
3355
4183
|
res = _context2.sent;
|
|
@@ -3377,7 +4205,7 @@ var updateUser = function () {
|
|
|
3377
4205
|
};
|
|
3378
4206
|
}();
|
|
3379
4207
|
|
|
3380
|
-
var findUser = function () {
|
|
4208
|
+
var findUser$1 = function () {
|
|
3381
4209
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee3(_ref4) {
|
|
3382
4210
|
var email = _ref4.email,
|
|
3383
4211
|
password = _ref4.password;
|
|
@@ -3387,7 +4215,7 @@ var findUser = function () {
|
|
|
3387
4215
|
switch (_context3.prev = _context3.next) {
|
|
3388
4216
|
case 0:
|
|
3389
4217
|
_context3.next = 2;
|
|
3390
|
-
return findUser
|
|
4218
|
+
return findUser(email, password);
|
|
3391
4219
|
|
|
3392
4220
|
case 2:
|
|
3393
4221
|
res = _context3.sent;
|
|
@@ -3417,9 +4245,9 @@ var findUser = function () {
|
|
|
3417
4245
|
|
|
3418
4246
|
var user = /*#__PURE__*/Object.freeze({
|
|
3419
4247
|
__proto__: null,
|
|
3420
|
-
createUser: createUser,
|
|
3421
|
-
updateUser: updateUser,
|
|
3422
|
-
findUser: findUser
|
|
4248
|
+
createUser: createUser$1,
|
|
4249
|
+
updateUser: updateUser$1,
|
|
4250
|
+
findUser: findUser$1
|
|
3423
4251
|
});
|
|
3424
4252
|
|
|
3425
4253
|
var localStrategy = new Local.Strategy({
|
|
@@ -3427,7 +4255,7 @@ var localStrategy = new Local.Strategy({
|
|
|
3427
4255
|
passwordField: 'password'
|
|
3428
4256
|
}, function (email, password, done) {
|
|
3429
4257
|
|
|
3430
|
-
findUser({ email: email, password: password }).then(function (user) {
|
|
4258
|
+
findUser$1({ email: email, password: password }).then(function (user) {
|
|
3431
4259
|
done(null, user);
|
|
3432
4260
|
}).catch(function (error) {
|
|
3433
4261
|
done(error);
|
|
@@ -3439,9 +4267,9 @@ var passportLocal = /*#__PURE__*/Object.freeze({
|
|
|
3439
4267
|
localStrategy: localStrategy
|
|
3440
4268
|
});
|
|
3441
4269
|
|
|
3442
|
-
var _this = undefined;
|
|
4270
|
+
var _this$4 = undefined;
|
|
3443
4271
|
|
|
3444
|
-
var config = {
|
|
4272
|
+
var config$1 = {
|
|
3445
4273
|
host: 'sanity-datasource.cluster-crao688bsrdh.us-east-1.rds.amazonaws.com',
|
|
3446
4274
|
user: 'nasp',
|
|
3447
4275
|
password: 'uRNkF9SkfXQs6AKK',
|
|
@@ -3455,7 +4283,7 @@ var getOccupation = function () {
|
|
|
3455
4283
|
while (1) {
|
|
3456
4284
|
switch (_context.prev = _context.next) {
|
|
3457
4285
|
case 0:
|
|
3458
|
-
db$1 = db(config);
|
|
4286
|
+
db$1 = db(config$1);
|
|
3459
4287
|
query = '\n select name as label, id as value\n from occupation\n where type = ?\n ';
|
|
3460
4288
|
_context.next = 4;
|
|
3461
4289
|
return db$1.query(query, [type]);
|
|
@@ -3473,7 +4301,7 @@ var getOccupation = function () {
|
|
|
3473
4301
|
return _context.stop();
|
|
3474
4302
|
}
|
|
3475
4303
|
}
|
|
3476
|
-
}, _callee, _this);
|
|
4304
|
+
}, _callee, _this$4);
|
|
3477
4305
|
}));
|
|
3478
4306
|
|
|
3479
4307
|
return function getOccupation(_x) {
|
|
@@ -3488,7 +4316,7 @@ var getFieldsAndOptions = function () {
|
|
|
3488
4316
|
while (1) {
|
|
3489
4317
|
switch (_context2.prev = _context2.next) {
|
|
3490
4318
|
case 0:
|
|
3491
|
-
db$1 = db(config);
|
|
4319
|
+
db$1 = db(config$1);
|
|
3492
4320
|
query = '\n select * \n from field\n where occupation_id = ?\n order by sorting\n ';
|
|
3493
4321
|
_context2.next = 4;
|
|
3494
4322
|
return db$1.query(query, [occupation]);
|
|
@@ -3536,7 +4364,7 @@ var getFieldsAndOptions = function () {
|
|
|
3536
4364
|
return _context2.stop();
|
|
3537
4365
|
}
|
|
3538
4366
|
}
|
|
3539
|
-
}, _callee2, _this);
|
|
4367
|
+
}, _callee2, _this$4);
|
|
3540
4368
|
}));
|
|
3541
4369
|
|
|
3542
4370
|
return function getFieldsAndOptions(_x2) {
|
|
@@ -3607,8 +4435,8 @@ var ProcessData = (function () {
|
|
|
3607
4435
|
})();
|
|
3608
4436
|
|
|
3609
4437
|
var LoginForm_1 = LoginForm;
|
|
3610
|
-
var SignupForm_1 = SignupForm
|
|
3611
|
-
var ProfileForm_1 = SignupForm;
|
|
4438
|
+
var SignupForm_1 = SignupForm;
|
|
4439
|
+
var ProfileForm_1 = SignupForm$1;
|
|
3612
4440
|
var AuthCookies_1 = authCookies;
|
|
3613
4441
|
var AuthHooks_1 = hooks;
|
|
3614
4442
|
var Iron_1 = iron;
|