@mjhls/mjh-framework 1.0.861 → 1.0.862-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 +11 -11
- package/dist/cjs/AD300x250x600.js +11 -11
- package/dist/cjs/AD728x90.js +12 -12
- package/dist/cjs/ADFloatingFooter.js +13 -13
- package/dist/cjs/ADFooter.js +8 -9
- package/dist/cjs/ADGutter.js +13 -13
- package/dist/cjs/{ADInfeed-ff26342c.js → ADInfeed-98c71bcd.js} +9 -11
- package/dist/cjs/ADSkyscraper.js +13 -13
- package/dist/cjs/ADSponsoredResources.js +13 -13
- package/dist/cjs/ADWebcast.js +13 -13
- package/dist/cjs/ADWelcome.js +17 -17
- package/dist/cjs/{ADlgInfeed-ad4953d4.js → ADlgInfeed-9de32585.js} +6 -7
- package/dist/cjs/AccordionPanel.js +22 -24
- package/dist/cjs/AdSlot.js +15 -15
- package/dist/cjs/AdSlotsProvider.js +903 -11
- package/dist/cjs/AlgoliaSearch.js +14012 -49
- package/dist/cjs/AlphabeticList.js +16 -17
- package/dist/cjs/ArticleCarousel.js +11 -12
- package/dist/cjs/ArticleProgramLandingPage.js +28 -29
- package/dist/cjs/ArticleSeriesLandingPage.js +24 -24
- package/dist/cjs/ArticleSeriesListing.js +41 -41
- package/dist/cjs/Auth.js +1197 -237
- package/dist/cjs/AuthWrapper.js +561 -26
- package/dist/cjs/{AuthorComponent-ac8972ce.js → AuthorComponent-bb831b74.js} +12 -13
- package/dist/cjs/{BlockContent-8b494587.js → BlockContent-091a991f.js} +24 -25
- package/dist/cjs/Breadcrumbs.js +21 -23
- package/dist/cjs/CMEDeck.js +65 -64
- package/dist/cjs/Column1.js +11 -14
- package/dist/cjs/Column2.js +19 -22
- package/dist/cjs/Column3.js +34 -36
- package/dist/cjs/ConferenceArticleCard.js +32 -33
- package/dist/cjs/ConferenceBanner-4a16fddc.js +23 -0
- package/dist/cjs/DeckContent.js +82 -85
- package/dist/cjs/DeckQueue.js +70 -73
- package/dist/cjs/{Dfp-0bf098b5.js → Dfp-26baccf1.js} +23 -23
- package/dist/cjs/EventsDeck.js +134 -141
- package/dist/cjs/ExternalResources.js +48 -49
- package/dist/cjs/Feature.js +23 -25
- package/dist/cjs/ForbesHero.js +34 -35
- package/dist/cjs/GridContent.js +205 -209
- package/dist/cjs/GridHero.js +35 -36
- package/dist/cjs/GroupDeck.js +48 -49
- package/dist/cjs/HamMagazine.js +125 -130
- package/dist/cjs/Header.js +12 -14
- package/dist/cjs/Hero.js +9 -10
- package/dist/cjs/HighlightenVideo.js +16 -17
- package/dist/cjs/HorizontalArticleListing.js +38 -39
- package/dist/cjs/HorizontalHero.js +23 -24
- package/dist/cjs/IssueContentDeck.js +65 -70
- package/dist/cjs/IssueDeck.js +61 -66
- package/dist/cjs/IssueLanding.js +59 -60
- package/dist/cjs/KMTracker.js +15 -15
- package/dist/cjs/LeftNav.js +22 -23
- package/dist/cjs/MasterDeck.js +59 -59
- package/dist/cjs/MediaSeriesLanding.js +914 -806
- package/dist/cjs/NavDvm.js +63 -68
- package/dist/cjs/{NavFooter-3dcd99a8.js → NavFooter-76c913e3.js} +14 -15
- package/dist/cjs/NavMagazine.js +126 -131
- package/dist/cjs/NavNative.js +117 -125
- package/dist/cjs/OncliveHero.js +17 -17
- package/dist/cjs/OncliveLargeHero.js +63 -64
- package/dist/cjs/PageFilter.js +8 -9
- package/dist/cjs/PartnerDetailListing.js +3071 -449
- package/dist/cjs/PdfDownload.js +8 -9
- package/dist/cjs/PopUpModal.js +13 -15
- package/dist/cjs/PubSection.js +21 -21
- package/dist/cjs/PubToc.js +7 -8
- package/dist/cjs/PublicationDeck.js +59 -64
- package/dist/cjs/PublicationLanding.js +110 -114
- package/dist/cjs/QueueDeckExpanded.js +287 -286
- package/dist/cjs/RecentNews.js +19 -20
- package/dist/cjs/RelatedContent.js +50 -51
- package/dist/cjs/RelatedTopicsDropdown.js +29 -32
- package/dist/cjs/RolesDeck.js +27 -32
- package/dist/cjs/Search.js +12 -16
- package/dist/cjs/SeriesListingDeck.js +27 -26
- package/dist/cjs/{SeriesSlider-60fa1342.js → SeriesSlider-8bbc989f.js} +37 -38
- package/dist/cjs/SideFooter.js +25 -26
- package/dist/cjs/SocialIcons.js +9 -10
- package/dist/cjs/{SocialSearchComponent-19548e2a.js → SocialSearchComponent-cea213aa.js} +34 -38
- package/dist/cjs/SocialShare.js +29 -31
- package/dist/cjs/TaxonomyCard.js +55 -60
- package/dist/cjs/TaxonomyDescription.js +23 -24
- package/dist/cjs/TemplateNormal.js +36 -36
- package/dist/cjs/ThumbnailCard.js +17 -19
- package/dist/cjs/Ustream.js +21 -22
- package/dist/cjs/VerticalHero.js +15 -16
- package/dist/cjs/VideoProgramLandingPage.js +44 -48
- package/dist/cjs/VideoSeriesCard.js +23 -24
- package/dist/cjs/VideoSeriesFilter.js +9 -9
- package/dist/cjs/VideoSeriesLandingPage.js +29 -29
- package/dist/cjs/VideoSeriesListing.js +58 -58
- package/dist/cjs/View.js +202 -206
- package/dist/cjs/YahooHero.js +30 -31
- package/dist/cjs/YoutubeGroup.js +54 -55
- package/dist/cjs/{brightcove-react-player-loader.es-5c98aec7.js → brightcove-react-player-loader.es-156bd4d6.js} +8 -10
- package/dist/cjs/events-1b438fe7.js +469 -0
- package/dist/cjs/{extends-60837c34.js → extends-0a918631.js} +1 -0
- package/dist/cjs/faundadb.js +16 -16
- package/dist/cjs/getRelatedArticle.js +131 -67
- package/dist/cjs/getRootDocGroup.js +3 -3
- package/dist/cjs/getSerializers.js +13 -13
- package/dist/cjs/{getTargeting-3e45e4d4.js → getTargeting-f1821260.js} +11 -11
- package/dist/cjs/getTargeting.js +2 -2
- package/dist/cjs/iconBase-68959171.js +3 -0
- package/dist/cjs/{index-99edf08a.js → index-3294d3bc.js} +1 -1
- package/dist/cjs/{index-9d365128.js → index-96b3db50.js} +10 -12
- package/dist/cjs/{index-44481153.js → index-98e01cb9.js} +47 -494
- package/dist/cjs/{index-87d0db67.js → index-a1e54356.js} +1178 -954
- package/dist/cjs/{index-b5eb3ff8.js → index-be0c82be.js} +19 -20
- package/dist/cjs/index-e2e62963.js +89 -0
- package/dist/cjs/{index.es-f3e47207.js → index.es-9110add6.js} +12 -31
- package/dist/cjs/{index.esm-3ffa049c.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 +61 -65
- package/dist/cjs/{inherits-87492b40.js → inherits-1f5a1c72.js} +6 -3
- package/dist/cjs/inherits-8d29278d.js +110 -0
- package/dist/cjs/{lodash-7fd85bcf.js → lodash-fc2922d0.js} +22 -71
- package/dist/cjs/{main-7b5e57b0.js → main-02daeefe.js} +54 -90
- package/dist/cjs/{md5-e1ca5797.js → md5-5039b1a6.js} +1 -1
- package/dist/cjs/{moment-ca3bd9fb.js → moment-575fe24c.js} +8 -10
- package/dist/cjs/{react-social-icons-07939b41.js → react-social-icons-f7f48f71.js} +11 -12
- package/dist/cjs/timeDifferenceCalc.js +1 -1
- package/dist/cjs/{typeof-9d7f610f.js → typeof-725500bc.js} +1 -1
- package/dist/cjs/urlFor.js +3 -3
- package/dist/cjs/{visibility-sensor-eb2c5b69.js → visibility-sensor-ad5e3116.js} +5 -7
- package/dist/esm/AD.js +7 -7
- package/dist/esm/AD300x250.js +9 -8
- package/dist/esm/AD300x250x600.js +9 -8
- package/dist/esm/AD728x90.js +10 -9
- package/dist/esm/ADFloatingFooter.js +11 -10
- package/dist/esm/ADFooter.js +6 -6
- package/dist/esm/ADGutter.js +11 -10
- package/dist/esm/{ADInfeed-422ad6e6.js → ADInfeed-1cc9d817.js} +7 -7
- package/dist/esm/ADSkyscraper.js +11 -10
- package/dist/esm/ADSponsoredResources.js +11 -10
- package/dist/esm/ADWebcast.js +11 -10
- package/dist/esm/ADWelcome.js +15 -14
- package/dist/esm/{ADlgInfeed-f7468db8.js → ADlgInfeed-8c4f129e.js} +4 -4
- package/dist/esm/AccordionPanel.js +17 -17
- package/dist/esm/AdSlot.js +7 -6
- package/dist/esm/AdSlotsProvider.js +903 -10
- package/dist/esm/AlgoliaSearch.js +14005 -41
- package/dist/esm/AlphabeticList.js +14 -14
- package/dist/esm/ArticleCarousel.js +9 -9
- package/dist/esm/ArticleProgramLandingPage.js +22 -22
- package/dist/esm/ArticleSeriesLandingPage.js +19 -18
- package/dist/esm/ArticleSeriesListing.js +38 -37
- package/dist/esm/Auth.js +1181 -217
- package/dist/esm/AuthWrapper.js +561 -24
- package/dist/esm/{AuthorComponent-8ffd4679.js → AuthorComponent-34b16174.js} +10 -10
- package/dist/esm/{BlockContent-d05b5b23.js → BlockContent-e9b4ddcf.js} +4 -4
- package/dist/esm/Breadcrumbs.js +11 -11
- package/dist/esm/CMEDeck.js +62 -61
- package/dist/esm/Column1.js +9 -9
- package/dist/esm/Column2.js +17 -17
- package/dist/esm/Column3.js +32 -31
- package/dist/esm/ConferenceArticleCard.js +30 -30
- package/dist/esm/{ConferenceBanner-9162d0ca.js → ConferenceBanner-8792ebd2.js} +4 -4
- package/dist/esm/DeckContent.js +78 -77
- package/dist/esm/DeckQueue.js +66 -65
- package/dist/esm/{Dfp-85c9513e.js → Dfp-b7236041.js} +11 -10
- package/dist/esm/EventsDeck.js +110 -110
- package/dist/esm/ExternalResources.js +43 -43
- package/dist/esm/Feature.js +17 -17
- package/dist/esm/ForbesHero.js +28 -28
- package/dist/esm/GridContent.js +174 -173
- package/dist/esm/GridHero.js +29 -29
- package/dist/esm/GroupDeck.js +36 -36
- package/dist/esm/HamMagazine.js +100 -100
- package/dist/esm/Header.js +8 -8
- package/dist/esm/Hero.js +7 -7
- package/dist/esm/HighlightenVideo.js +14 -14
- package/dist/esm/HorizontalArticleListing.js +36 -36
- package/dist/esm/HorizontalHero.js +21 -21
- package/dist/esm/IssueContentDeck.js +53 -53
- package/dist/esm/IssueDeck.js +55 -55
- package/dist/esm/IssueLanding.js +57 -57
- package/dist/esm/KMTracker.js +15 -15
- package/dist/esm/LeftNav.js +18 -17
- package/dist/esm/MasterDeck.js +56 -55
- package/dist/esm/MediaSeriesLanding.js +672 -561
- package/dist/esm/NavDvm.js +46 -46
- package/dist/esm/{NavFooter-c29526b7.js → NavFooter-e27bd93b.js} +12 -12
- package/dist/esm/NavMagazine.js +103 -103
- package/dist/esm/NavNative.js +92 -92
- package/dist/esm/OncliveHero.js +15 -14
- package/dist/esm/OncliveLargeHero.js +52 -52
- package/dist/esm/PageFilter.js +6 -6
- package/dist/esm/PartnerDetailListing.js +2967 -344
- package/dist/esm/PdfDownload.js +6 -6
- package/dist/esm/PopUpModal.js +8 -8
- package/dist/esm/PubSection.js +19 -18
- package/dist/esm/PubToc.js +5 -5
- package/dist/esm/PublicationDeck.js +51 -51
- package/dist/esm/PublicationLanding.js +96 -96
- package/dist/esm/QueueDeckExpanded.js +253 -252
- package/dist/esm/RecentNews.js +17 -17
- package/dist/esm/RelatedContent.js +45 -45
- package/dist/esm/RelatedTopicsDropdown.js +21 -21
- package/dist/esm/RolesDeck.js +25 -25
- package/dist/esm/Search.js +7 -7
- package/dist/esm/SeriesListingDeck.js +22 -21
- package/dist/esm/{SeriesSlider-05ecb544.js → SeriesSlider-a866bb21.js} +28 -28
- package/dist/esm/SideFooter.js +21 -21
- package/dist/esm/SocialIcons.js +7 -7
- package/dist/esm/{SocialSearchComponent-47815365.js → SocialSearchComponent-03c3e869.js} +28 -28
- package/dist/esm/SocialShare.js +25 -25
- package/dist/esm/TaxonomyCard.js +51 -51
- package/dist/esm/TaxonomyDescription.js +18 -18
- package/dist/esm/TemplateNormal.js +33 -32
- package/dist/esm/ThumbnailCard.js +10 -10
- package/dist/esm/Ustream.js +18 -18
- package/dist/esm/VerticalHero.js +13 -13
- package/dist/esm/VideoProgramLandingPage.js +34 -34
- package/dist/esm/VideoSeriesCard.js +18 -18
- package/dist/esm/VideoSeriesFilter.js +6 -6
- package/dist/esm/VideoSeriesLandingPage.js +19 -18
- package/dist/esm/VideoSeriesListing.js +55 -54
- package/dist/esm/View.js +185 -185
- package/dist/esm/YahooHero.js +25 -25
- package/dist/esm/YoutubeGroup.js +39 -39
- package/dist/esm/{brightcove-react-player-loader.es-4abff0b1.js → brightcove-react-player-loader.es-83f53e4e.js} +6 -7
- package/dist/esm/events-6c3a7a63.js +467 -0
- package/dist/esm/{extends-eb69e8ac.js → extends-6f2fcc99.js} +1 -1
- package/dist/esm/faundadb.js +1 -1
- package/dist/esm/getRelatedArticle.js +126 -62
- package/dist/esm/getSerializers.js +13 -13
- package/dist/esm/{getTargeting-9cb7e014.js → getTargeting-bd800589.js} +10 -10
- package/dist/esm/getTargeting.js +2 -2
- package/dist/esm/{index-1819118a.js → index-41a678ea.js} +41 -487
- package/dist/esm/{index-6c12bdd5.js → index-5f7e79e7.js} +4 -4
- package/dist/esm/{index-51a80699.js → index-73819142.js} +19 -20
- package/dist/esm/{index-20e503c9.js → index-a1c5f00a.js} +1135 -900
- package/dist/esm/index-aaa2dae0.js +85 -0
- package/dist/esm/{index-fa2ffe86.js → index-ef6d5dcf.js} +1 -1
- 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-8ee5ff72.js → index.esm-fd746768.js} +18 -17
- package/dist/esm/index.js +53 -54
- package/dist/esm/inherits-77d5e4fc.js +101 -0
- package/dist/esm/{inherits-0d8cda6e.js → inherits-cf8dde54.js} +2 -2
- package/dist/esm/{lodash-ec8c6b48.js → lodash-17fdfebb.js} +22 -71
- package/dist/esm/{main-747e7d25.js → main-e4a934b2.js} +52 -87
- package/dist/esm/{md5-4e42248e.js → md5-9be0e905.js} +1 -1
- package/dist/esm/{moment-b6f49411.js → moment-e2f9b20c.js} +8 -10
- package/dist/esm/{react-social-icons-3822f1ce.js → react-social-icons-a7d5c5c7.js} +5 -5
- package/dist/esm/timeDifferenceCalc.js +1 -1
- package/dist/esm/{typeof-af9c50d8.js → typeof-6435ba1c.js} +1 -1
- package/dist/esm/urlFor.js +1 -1
- package/dist/esm/{visibility-sensor-f40c2564.js → visibility-sensor-72fd8f8b.js} +2 -2
- package/package.json +111 -110
- package/dist/cjs/ConferenceBanner-6c9e718a.js +0 -24
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as createCommonjsModule, u as unwrapExports } from './_commonjsHelpers-0c4b6f40.js';
|
|
1
|
+
import { c as createCommonjsModule, u as unwrapExports, a as commonjsGlobal } from './_commonjsHelpers-0c4b6f40.js';
|
|
2
2
|
import './_to-object-a4107da3.js';
|
|
3
3
|
import './es6.string.iterator-c990c18c.js';
|
|
4
4
|
import './_library-528f1934.js';
|
|
@@ -6,45 +6,47 @@ import './_iter-detect-5d49a330.js';
|
|
|
6
6
|
import './toConsumableArray-43aa614d.js';
|
|
7
7
|
import './core.get-iterator-method-e1de7503.js';
|
|
8
8
|
import './_object-pie-33c40e79.js';
|
|
9
|
-
import { _ as _extends } from './extends-
|
|
9
|
+
import { _ as _extends } from './extends-6f2fcc99.js';
|
|
10
10
|
import './_object-sap-964b6feb.js';
|
|
11
|
-
import './inherits-
|
|
11
|
+
import './inherits-cf8dde54.js';
|
|
12
12
|
import './define-property-8af5f002.js';
|
|
13
13
|
import './web.dom.iterable-4439f05a.js';
|
|
14
|
-
import './typeof-
|
|
14
|
+
import './typeof-6435ba1c.js';
|
|
15
15
|
import './_is-array-58e95429.js';
|
|
16
|
-
import
|
|
17
|
-
import './
|
|
16
|
+
import React__default, { Component, createContext, forwardRef, PureComponent, useRef, useState, useEffect } from 'react';
|
|
17
|
+
import './events-6c3a7a63.js';
|
|
18
|
+
import './index-41a678ea.js';
|
|
18
19
|
import PropTypes from 'prop-types';
|
|
19
20
|
import 'react-bootstrap/Row';
|
|
20
21
|
import 'react-bootstrap/Col';
|
|
21
22
|
import 'react-bootstrap/Card';
|
|
22
|
-
import { m as moment } from './moment-
|
|
23
|
+
import { m as moment } from './moment-e2f9b20c.js';
|
|
23
24
|
import 'next/router';
|
|
24
25
|
import './isSymbol-1981418f.js';
|
|
25
26
|
import './debounce-9207d8ee.js';
|
|
26
27
|
import './toNumber-2f7a84cd.js';
|
|
27
|
-
import './index.es-
|
|
28
|
+
import './index.es-29c1cef5.js';
|
|
28
29
|
import 'react-dom';
|
|
29
|
-
import './visibility-sensor-
|
|
30
|
-
import './index-
|
|
30
|
+
import './visibility-sensor-72fd8f8b.js';
|
|
31
|
+
import './index-73819142.js';
|
|
31
32
|
import urlFor from './urlFor.js';
|
|
32
|
-
import './index-
|
|
33
|
-
import './main-
|
|
33
|
+
import './index-5f7e79e7.js';
|
|
34
|
+
import './main-e4a934b2.js';
|
|
34
35
|
import './entities-7cc3bf45.js';
|
|
35
36
|
import { _ as _slicedToArray } from './slicedToArray-641f241f.js';
|
|
36
37
|
import './stringify-4330ccdc.js';
|
|
37
|
-
import { a as _asyncToGenerator, r as regenerator, _ as _Promise } from './asyncToGenerator-fc1c2e29.js';
|
|
38
|
+
import { a as _asyncToGenerator$1, r as regenerator, _ as _Promise } from './asyncToGenerator-fc1c2e29.js';
|
|
38
39
|
import './Segment.js';
|
|
39
40
|
import './Beam.js';
|
|
40
41
|
import './AdSlot.js';
|
|
41
|
-
import './ADInfeed-
|
|
42
|
-
import './lodash-
|
|
43
|
-
import './ADlgInfeed-
|
|
42
|
+
import './ADInfeed-1cc9d817.js';
|
|
43
|
+
import './lodash-17fdfebb.js';
|
|
44
|
+
import './ADlgInfeed-8c4f129e.js';
|
|
44
45
|
import './getContentCategory-15dcc413.js';
|
|
45
|
-
import './AuthorComponent-
|
|
46
|
+
import './AuthorComponent-34b16174.js';
|
|
46
47
|
import 'react-bootstrap/Button';
|
|
47
|
-
import { B as BlockContent } from './BlockContent-
|
|
48
|
+
import { B as BlockContent } from './BlockContent-e9b4ddcf.js';
|
|
49
|
+
import { r as reactSocialIcons_1 } from './react-social-icons-a7d5c5c7.js';
|
|
48
50
|
import './index-c7e2ac95.js';
|
|
49
51
|
import { s as smoothscroll } from './smoothscroll-0cd4c7a6.js';
|
|
50
52
|
import './GroupDeck.js';
|
|
@@ -52,10 +54,10 @@ import 'react-bootstrap';
|
|
|
52
54
|
import './timeDifferenceCalc.js';
|
|
53
55
|
import QueueDeckExpanded from './QueueDeckExpanded.js';
|
|
54
56
|
import './iconBase-602d52fe.js';
|
|
55
|
-
import './index.esm-
|
|
56
|
-
import { g as getSerializers } from './index-
|
|
57
|
+
import './index.esm-29e48d38.js';
|
|
58
|
+
import { g as getSerializers } from './index-a1c5f00a.js';
|
|
57
59
|
import './util-7700fc59.js';
|
|
58
|
-
import './brightcove-react-player-loader.es-
|
|
60
|
+
import './brightcove-react-player-loader.es-83f53e4e.js';
|
|
59
61
|
import 'next/head';
|
|
60
62
|
import 'react-share';
|
|
61
63
|
import './SocialShare.js';
|
|
@@ -65,112 +67,12 @@ import 'react-bootstrap/Figure';
|
|
|
65
67
|
import 'react-bootstrap/OverlayTrigger';
|
|
66
68
|
import 'react-bootstrap/Tooltip';
|
|
67
69
|
import 'react-bootstrap/Popover';
|
|
68
|
-
import '
|
|
70
|
+
import { _ as _defineProperty$1, b as _inherits, c as _classCallCheck, d as _possibleConstructorReturn, e as _getPrototypeOf, g as _createClass } from './inherits-77d5e4fc.js';
|
|
69
71
|
import 'react-bootstrap/Carousel';
|
|
70
72
|
import Feature from './Feature.js';
|
|
71
73
|
import 'react-bootstrap/Breadcrumb';
|
|
72
74
|
import Breadcrumbs from './Breadcrumbs.js';
|
|
73
75
|
|
|
74
|
-
function _classCallCheck(instance, Constructor) {
|
|
75
|
-
if (!(instance instanceof Constructor)) {
|
|
76
|
-
throw new TypeError("Cannot call a class as a function");
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function _defineProperties(target, props) {
|
|
81
|
-
for (var i = 0; i < props.length; i++) {
|
|
82
|
-
var descriptor = props[i];
|
|
83
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
84
|
-
descriptor.configurable = true;
|
|
85
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
86
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
|
91
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
92
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
93
|
-
return Constructor;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function _typeof(obj) {
|
|
97
|
-
"@babel/helpers - typeof";
|
|
98
|
-
|
|
99
|
-
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
100
|
-
_typeof = function _typeof(obj) {
|
|
101
|
-
return typeof obj;
|
|
102
|
-
};
|
|
103
|
-
} else {
|
|
104
|
-
_typeof = function _typeof(obj) {
|
|
105
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
return _typeof(obj);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function _assertThisInitialized(self) {
|
|
113
|
-
if (self === void 0) {
|
|
114
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
return self;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function _possibleConstructorReturn(self, call) {
|
|
121
|
-
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
122
|
-
return call;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return _assertThisInitialized(self);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function _getPrototypeOf(o) {
|
|
129
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
130
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
131
|
-
};
|
|
132
|
-
return _getPrototypeOf(o);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function _setPrototypeOf(o, p) {
|
|
136
|
-
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
137
|
-
o.__proto__ = p;
|
|
138
|
-
return o;
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
return _setPrototypeOf(o, p);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
function _inherits(subClass, superClass) {
|
|
145
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
146
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
150
|
-
constructor: {
|
|
151
|
-
value: subClass,
|
|
152
|
-
writable: true,
|
|
153
|
-
configurable: true
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
function _defineProperty(obj, key, value) {
|
|
160
|
-
if (key in obj) {
|
|
161
|
-
Object.defineProperty(obj, key, {
|
|
162
|
-
value: value,
|
|
163
|
-
enumerable: true,
|
|
164
|
-
configurable: true,
|
|
165
|
-
writable: true
|
|
166
|
-
});
|
|
167
|
-
} else {
|
|
168
|
-
obj[key] = value;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
return obj;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
76
|
var isRequiredIf_1 = createCommonjsModule(function (module, exports) {
|
|
175
77
|
Object.defineProperty(exports,'__esModule',{value:!0});var VALIDATOR_ARG_ERROR_MESSAGE='The typeValidator argument must be a function with the signature function(props, propName, componentName).',MESSAGE_ARG_ERROR_MESSAGE='The error message is optional, but must be a string if provided.',propIsRequired=function propIsRequired(a,b,c,d){if('boolean'==typeof a)return a;return 'function'==typeof a?a(b,c,d):!(!0!==!!a)&&!!a},propExists=function propExists(a,b){return Object.hasOwnProperty.call(a,b)},missingPropError=function missingPropError(a,b,c,d){return d?new Error(d):new Error('Required '+a[b]+' `'+b+'`'+(' was not specified in `'+c+'`.'))},guardAgainstInvalidArgTypes=function guardAgainstInvalidArgTypes(a,b){if('function'!=typeof a)throw new TypeError(VALIDATOR_ARG_ERROR_MESSAGE);if(!!b&&'string'!=typeof b)throw new TypeError(MESSAGE_ARG_ERROR_MESSAGE)},isRequiredIf=function isRequiredIf(a,b,c){return guardAgainstInvalidArgTypes(a,c),function(d,e,f){for(var _len=arguments.length,g=Array(3<_len?_len-3:0),_key=3;_key<_len;_key++)g[_key-3]=arguments[_key];return propIsRequired(b,d,e,f)?propExists(d,e)?a.apply(void 0,[d,e,f].concat(g)):missingPropError(d,e,f,c):a.apply(void 0,[d,e,f].concat(g));// Is not required, so just run typeValidator.
|
|
176
78
|
}};exports.default=isRequiredIf;
|
|
@@ -342,7 +244,7 @@ function (_Component) {
|
|
|
342
244
|
value: function render() {
|
|
343
245
|
var isLoading = this.state.isLoading;
|
|
344
246
|
var placeholder = this.props.placeholder;
|
|
345
|
-
return
|
|
247
|
+
return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
|
|
346
248
|
ref: "embedContainer"
|
|
347
249
|
}));
|
|
348
250
|
}
|
|
@@ -351,7 +253,7 @@ function (_Component) {
|
|
|
351
253
|
return TwitterTimelineEmbed;
|
|
352
254
|
}(Component);
|
|
353
255
|
|
|
354
|
-
_defineProperty(TwitterTimelineEmbed, "propTypes", {
|
|
256
|
+
_defineProperty$1(TwitterTimelineEmbed, "propTypes", {
|
|
355
257
|
/**
|
|
356
258
|
* This can be either of profile, likes, list, collection, URL, widget
|
|
357
259
|
*/
|
|
@@ -531,7 +433,7 @@ function (_Component) {
|
|
|
531
433
|
value: function render() {
|
|
532
434
|
var isLoading = this.state.isLoading;
|
|
533
435
|
var placeholder = this.props.placeholder;
|
|
534
|
-
return
|
|
436
|
+
return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
|
|
535
437
|
ref: "embedContainer"
|
|
536
438
|
}));
|
|
537
439
|
}
|
|
@@ -540,7 +442,7 @@ function (_Component) {
|
|
|
540
442
|
return TwitterShareButton;
|
|
541
443
|
}(Component);
|
|
542
444
|
|
|
543
|
-
_defineProperty(TwitterShareButton, "propTypes", {
|
|
445
|
+
_defineProperty$1(TwitterShareButton, "propTypes", {
|
|
544
446
|
/**
|
|
545
447
|
* Url for sharing
|
|
546
448
|
*/
|
|
@@ -619,7 +521,7 @@ function (_Component) {
|
|
|
619
521
|
value: function render() {
|
|
620
522
|
var isLoading = this.state.isLoading;
|
|
621
523
|
var placeholder = this.props.placeholder;
|
|
622
|
-
return
|
|
524
|
+
return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
|
|
623
525
|
ref: "embedContainer"
|
|
624
526
|
}));
|
|
625
527
|
}
|
|
@@ -628,7 +530,7 @@ function (_Component) {
|
|
|
628
530
|
return TwitterFollowButton;
|
|
629
531
|
}(Component);
|
|
630
532
|
|
|
631
|
-
_defineProperty(TwitterFollowButton, "propTypes", {
|
|
533
|
+
_defineProperty$1(TwitterFollowButton, "propTypes", {
|
|
632
534
|
/**
|
|
633
535
|
* Username of twitter user which will be followed on click
|
|
634
536
|
*/
|
|
@@ -707,7 +609,7 @@ function (_Component) {
|
|
|
707
609
|
value: function render() {
|
|
708
610
|
var isLoading = this.state.isLoading;
|
|
709
611
|
var placeholder = this.props.placeholder;
|
|
710
|
-
return
|
|
612
|
+
return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
|
|
711
613
|
ref: "embedContainer"
|
|
712
614
|
}));
|
|
713
615
|
}
|
|
@@ -716,7 +618,7 @@ function (_Component) {
|
|
|
716
618
|
return TwitterHashtagButton;
|
|
717
619
|
}(Component);
|
|
718
620
|
|
|
719
|
-
_defineProperty(TwitterHashtagButton, "propTypes", {
|
|
621
|
+
_defineProperty$1(TwitterHashtagButton, "propTypes", {
|
|
720
622
|
/**
|
|
721
623
|
* Tag name for hashtag button
|
|
722
624
|
*/
|
|
@@ -795,7 +697,7 @@ function (_Component) {
|
|
|
795
697
|
value: function render() {
|
|
796
698
|
var isLoading = this.state.isLoading;
|
|
797
699
|
var placeholder = this.props.placeholder;
|
|
798
|
-
return
|
|
700
|
+
return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
|
|
799
701
|
ref: "embedContainer"
|
|
800
702
|
}));
|
|
801
703
|
}
|
|
@@ -804,7 +706,7 @@ function (_Component) {
|
|
|
804
706
|
return TwitterMentionButton;
|
|
805
707
|
}(Component);
|
|
806
708
|
|
|
807
|
-
_defineProperty(TwitterMentionButton, "propTypes", {
|
|
709
|
+
_defineProperty$1(TwitterMentionButton, "propTypes", {
|
|
808
710
|
/**
|
|
809
711
|
* Username to which you will need to tweet
|
|
810
712
|
*/
|
|
@@ -890,7 +792,7 @@ function (_Component) {
|
|
|
890
792
|
value: function render() {
|
|
891
793
|
var isLoading = this.state.isLoading;
|
|
892
794
|
var placeholder = this.props.placeholder;
|
|
893
|
-
return
|
|
795
|
+
return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
|
|
894
796
|
ref: "embedContainer"
|
|
895
797
|
}));
|
|
896
798
|
}
|
|
@@ -899,7 +801,7 @@ function (_Component) {
|
|
|
899
801
|
return TwitterTweetEmbed;
|
|
900
802
|
}(Component);
|
|
901
803
|
|
|
902
|
-
_defineProperty(TwitterTweetEmbed, "propTypes", {
|
|
804
|
+
_defineProperty$1(TwitterTweetEmbed, "propTypes", {
|
|
903
805
|
/**
|
|
904
806
|
* Tweet id that needs to be shown
|
|
905
807
|
*/
|
|
@@ -978,7 +880,7 @@ function (_Component) {
|
|
|
978
880
|
value: function render() {
|
|
979
881
|
var isLoading = this.state.isLoading;
|
|
980
882
|
var placeholder = this.props.placeholder;
|
|
981
|
-
return
|
|
883
|
+
return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
|
|
982
884
|
ref: "shareMoment"
|
|
983
885
|
}));
|
|
984
886
|
}
|
|
@@ -987,7 +889,7 @@ function (_Component) {
|
|
|
987
889
|
return TwitterMomentShare;
|
|
988
890
|
}(Component);
|
|
989
891
|
|
|
990
|
-
_defineProperty(TwitterMomentShare, "propTypes", {
|
|
892
|
+
_defineProperty$1(TwitterMomentShare, "propTypes", {
|
|
991
893
|
/**
|
|
992
894
|
* id of Twitter moment to show
|
|
993
895
|
*/
|
|
@@ -1066,7 +968,7 @@ function (_Component) {
|
|
|
1066
968
|
value: function render() {
|
|
1067
969
|
var isLoading = this.state.isLoading;
|
|
1068
970
|
var placeholder = this.props.placeholder;
|
|
1069
|
-
return
|
|
971
|
+
return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
|
|
1070
972
|
ref: "embedContainer"
|
|
1071
973
|
}));
|
|
1072
974
|
}
|
|
@@ -1075,7 +977,7 @@ function (_Component) {
|
|
|
1075
977
|
return TwitterDMButton;
|
|
1076
978
|
}(Component);
|
|
1077
979
|
|
|
1078
|
-
_defineProperty(TwitterDMButton, "propTypes", {
|
|
980
|
+
_defineProperty$1(TwitterDMButton, "propTypes", {
|
|
1079
981
|
/**
|
|
1080
982
|
* Twitter user id for DM button
|
|
1081
983
|
*/
|
|
@@ -1154,7 +1056,7 @@ function (_Component) {
|
|
|
1154
1056
|
value: function render() {
|
|
1155
1057
|
var isLoading = this.state.isLoading;
|
|
1156
1058
|
var placeholder = this.props.placeholder;
|
|
1157
|
-
return
|
|
1059
|
+
return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
|
|
1158
1060
|
ref: "embedContainer"
|
|
1159
1061
|
}));
|
|
1160
1062
|
}
|
|
@@ -1163,7 +1065,7 @@ function (_Component) {
|
|
|
1163
1065
|
return TwitterVideoEmbed;
|
|
1164
1066
|
}(Component);
|
|
1165
1067
|
|
|
1166
|
-
_defineProperty(TwitterVideoEmbed, "propTypes", {
|
|
1068
|
+
_defineProperty$1(TwitterVideoEmbed, "propTypes", {
|
|
1167
1069
|
/**
|
|
1168
1070
|
* Id of video tweet.
|
|
1169
1071
|
*/
|
|
@@ -1237,7 +1139,7 @@ function (_Component) {
|
|
|
1237
1139
|
value: function render() {
|
|
1238
1140
|
var isLoading = this.state.isLoading;
|
|
1239
1141
|
var placeholder = this.props.placeholder;
|
|
1240
|
-
return
|
|
1142
|
+
return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
|
|
1241
1143
|
ref: "embedContainer"
|
|
1242
1144
|
}));
|
|
1243
1145
|
}
|
|
@@ -1246,7 +1148,7 @@ function (_Component) {
|
|
|
1246
1148
|
return TwitterOnAirButton;
|
|
1247
1149
|
}(Component);
|
|
1248
1150
|
|
|
1249
|
-
_defineProperty(TwitterOnAirButton, "propTypes", {
|
|
1151
|
+
_defineProperty$1(TwitterOnAirButton, "propTypes", {
|
|
1250
1152
|
/**
|
|
1251
1153
|
* Username for which you require periscope on air button
|
|
1252
1154
|
*/
|
|
@@ -1268,279 +1170,3000 @@ _defineProperty(TwitterOnAirButton, "propTypes", {
|
|
|
1268
1170
|
onLoad: PropTypes.func
|
|
1269
1171
|
});
|
|
1270
1172
|
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1173
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
1174
|
+
try {
|
|
1175
|
+
var info = gen[key](arg);
|
|
1176
|
+
var value = info.value;
|
|
1177
|
+
} catch (error) {
|
|
1178
|
+
reject(error);
|
|
1179
|
+
return;
|
|
1180
|
+
}
|
|
1275
1181
|
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1182
|
+
if (info.done) {
|
|
1183
|
+
resolve(value);
|
|
1184
|
+
} else {
|
|
1185
|
+
Promise.resolve(value).then(_next, _throw);
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1280
1188
|
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1189
|
+
function _asyncToGenerator(fn) {
|
|
1190
|
+
return function () {
|
|
1191
|
+
var self = this,
|
|
1192
|
+
args = arguments;
|
|
1193
|
+
return new Promise(function (resolve, reject) {
|
|
1194
|
+
var gen = fn.apply(self, args);
|
|
1285
1195
|
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
setScrollPosition = _useState6[1];
|
|
1196
|
+
function _next(value) {
|
|
1197
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
1198
|
+
}
|
|
1290
1199
|
|
|
1291
|
-
|
|
1200
|
+
function _throw(err) {
|
|
1201
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
1202
|
+
}
|
|
1292
1203
|
|
|
1204
|
+
_next(undefined);
|
|
1205
|
+
});
|
|
1206
|
+
};
|
|
1207
|
+
}
|
|
1293
1208
|
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
if (scrollOffset + viewableWidth + 25 >= innerSlider.current.offsetWidth) {
|
|
1304
|
-
scrollDirection = 0;
|
|
1305
|
-
}
|
|
1306
|
-
}
|
|
1307
|
-
if (direction === 'prev') {
|
|
1308
|
-
scrollDirection = scrollOffset - numberOfSlidesToScroll;
|
|
1309
|
-
if (scrollOffset === 0) {
|
|
1310
|
-
if (window.innerWidth > 1399) {
|
|
1311
|
-
scrollDirection = innerSlider.current.offsetWidth - tileSize * 3 - 70;
|
|
1312
|
-
}
|
|
1313
|
-
if (window.innerWidth < 1399 && window.innerWidth > 592) {
|
|
1314
|
-
scrollDirection = innerSlider.current.offsetWidth - tileSize * 2 - 40;
|
|
1315
|
-
}
|
|
1316
|
-
if (window.innerWidth < 592) {
|
|
1317
|
-
scrollDirection = innerSlider.current.offsetWidth - tileSize * 1 - 24;
|
|
1318
|
-
}
|
|
1319
|
-
}
|
|
1320
|
-
}
|
|
1321
|
-
slide.scrollTo({
|
|
1322
|
-
left: scrollDirection,
|
|
1323
|
-
behavior: 'smooth'
|
|
1209
|
+
var asyncToGenerator = _asyncToGenerator;
|
|
1210
|
+
|
|
1211
|
+
function _defineProperty(obj, key, value) {
|
|
1212
|
+
if (key in obj) {
|
|
1213
|
+
Object.defineProperty(obj, key, {
|
|
1214
|
+
value: value,
|
|
1215
|
+
enumerable: true,
|
|
1216
|
+
configurable: true,
|
|
1217
|
+
writable: true
|
|
1324
1218
|
});
|
|
1325
|
-
|
|
1219
|
+
} else {
|
|
1220
|
+
obj[key] = value;
|
|
1326
1221
|
}
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1222
|
+
|
|
1223
|
+
return obj;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
var defineProperty = _defineProperty;
|
|
1227
|
+
|
|
1228
|
+
var canUseDOM = !!(
|
|
1229
|
+
typeof window !== 'undefined' &&
|
|
1230
|
+
window.document &&
|
|
1231
|
+
window.document.createElement
|
|
1232
|
+
);
|
|
1233
|
+
|
|
1234
|
+
var canUseDom = canUseDOM;
|
|
1235
|
+
|
|
1236
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
1237
|
+
if (source == null) return {};
|
|
1238
|
+
var target = {};
|
|
1239
|
+
var sourceKeys = Object.keys(source);
|
|
1240
|
+
var key, i;
|
|
1241
|
+
|
|
1242
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
1243
|
+
key = sourceKeys[i];
|
|
1244
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1245
|
+
target[key] = source[key];
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
return target;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
var objectWithoutPropertiesLoose = _objectWithoutPropertiesLoose;
|
|
1252
|
+
|
|
1253
|
+
function _objectWithoutProperties(source, excluded) {
|
|
1254
|
+
if (source == null) return {};
|
|
1255
|
+
var target = objectWithoutPropertiesLoose(source, excluded);
|
|
1256
|
+
var key, i;
|
|
1257
|
+
|
|
1258
|
+
if (Object.getOwnPropertySymbols) {
|
|
1259
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
1260
|
+
|
|
1261
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
1262
|
+
key = sourceSymbolKeys[i];
|
|
1263
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1264
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
1265
|
+
target[key] = source[key];
|
|
1339
1266
|
}
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
return target;
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
var objectWithoutProperties = _objectWithoutProperties;
|
|
1273
|
+
|
|
1274
|
+
var LoginStatus = {
|
|
1275
|
+
CONNECTED: 'connected',
|
|
1276
|
+
AUTHORIZATION_EXPIRED: 'authorization_expired',
|
|
1277
|
+
NOT_AUTHORIZED: 'not_authorized',
|
|
1278
|
+
UNKNOWN: 'unknown'
|
|
1279
|
+
};
|
|
1280
|
+
|
|
1281
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
1282
|
+
|
|
1283
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
1284
|
+
const Method = {
|
|
1285
|
+
GET: 'get',
|
|
1286
|
+
POST: 'post',
|
|
1287
|
+
DELETE: 'delete'
|
|
1288
|
+
};
|
|
1289
|
+
class Facebook {
|
|
1290
|
+
constructor(options = {}) {
|
|
1291
|
+
this.options = _objectSpread({
|
|
1292
|
+
domain: 'connect.facebook.net',
|
|
1293
|
+
version: 'v3.2',
|
|
1294
|
+
cookie: false,
|
|
1295
|
+
status: false,
|
|
1296
|
+
xfbml: false,
|
|
1297
|
+
language: 'en_US',
|
|
1298
|
+
frictionlessRequests: false,
|
|
1299
|
+
debug: false,
|
|
1300
|
+
chatSupport: false
|
|
1301
|
+
}, options);
|
|
1302
|
+
|
|
1303
|
+
if (!this.options.appId) {
|
|
1304
|
+
throw new Error('You need to set appId');
|
|
1345
1305
|
}
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
scrollerVisible = true;
|
|
1350
|
-
}
|
|
1306
|
+
|
|
1307
|
+
if (!this.options.wait) {
|
|
1308
|
+
this.init();
|
|
1351
1309
|
}
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
getAppId() {
|
|
1313
|
+
return this.options.appId;
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
init() {
|
|
1317
|
+
var _this = this;
|
|
1318
|
+
|
|
1319
|
+
return asyncToGenerator(function* () {
|
|
1320
|
+
if (_this.loadingPromise) {
|
|
1321
|
+
return _this.loadingPromise;
|
|
1362
1322
|
}
|
|
1363
|
-
}
|
|
1364
|
-
};
|
|
1365
|
-
useEffect(function () {
|
|
1366
|
-
//IE11 Polyfill
|
|
1367
|
-
smoothscroll.polyfill();
|
|
1368
|
-
setThumbSize();
|
|
1369
1323
|
|
|
1370
|
-
|
|
1324
|
+
_this.loadingPromise = new Promise(resolve => {
|
|
1325
|
+
const _this$options = _this.options,
|
|
1326
|
+
{
|
|
1327
|
+
domain,
|
|
1328
|
+
language,
|
|
1329
|
+
debug,
|
|
1330
|
+
chatSupport
|
|
1331
|
+
} = _this$options,
|
|
1332
|
+
restOptions = objectWithoutProperties(_this$options, ["domain", "language", "debug", "chatSupport"]);
|
|
1333
|
+
|
|
1334
|
+
window.fbAsyncInit = () => {
|
|
1335
|
+
window.FB.init({
|
|
1336
|
+
appId: restOptions.appId,
|
|
1337
|
+
version: restOptions.version,
|
|
1338
|
+
cookie: restOptions.cookie,
|
|
1339
|
+
status: restOptions.status,
|
|
1340
|
+
xfbml: restOptions.xfbml,
|
|
1341
|
+
frictionlessRequests: _this.frictionlessRequests
|
|
1342
|
+
});
|
|
1343
|
+
resolve(window.FB);
|
|
1344
|
+
};
|
|
1371
1345
|
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
}, []);
|
|
1346
|
+
if (window.document.getElementById('facebook-jssdk')) {
|
|
1347
|
+
return resolve(window.FB);
|
|
1348
|
+
}
|
|
1376
1349
|
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
showScroller && React.createElement(
|
|
1388
|
-
'div',
|
|
1389
|
-
{ onClick: function onClick(e) {
|
|
1390
|
-
return scrollSlider(e, 'prev');
|
|
1391
|
-
}, className: 'tile__slider-prev', style: { color: variant } },
|
|
1392
|
-
React.createElement('i', { style: { border: 'solid ' + variant, borderWidth: '0 4px 4px 0' }, className: 'arrow left' })
|
|
1393
|
-
),
|
|
1394
|
-
showScroller && React.createElement(
|
|
1395
|
-
'div',
|
|
1396
|
-
{ onClick: function onClick(e) {
|
|
1397
|
-
return scrollSlider(e, 'next');
|
|
1398
|
-
}, className: 'tile__slider-next', style: { color: variant } },
|
|
1399
|
-
React.createElement('i', { style: { border: 'solid ' + variant, borderWidth: '0 4px 4px 0' }, className: 'arrow right' })
|
|
1400
|
-
),
|
|
1401
|
-
React.createElement(
|
|
1402
|
-
'div',
|
|
1403
|
-
{ ref: innerSlider, className: 'row__inner' },
|
|
1404
|
-
props.data.slides.map(function (img, index) {
|
|
1405
|
-
var thumbnail = urlFor({ client: client, source: img.slideshowImage, imageWidth: 250 });
|
|
1406
|
-
if (!img.slideshowImage.link) {
|
|
1407
|
-
return React.createElement(
|
|
1408
|
-
'div',
|
|
1409
|
-
{ ref: tile, key: index, className: 'tile', style: { width: tileSize + 'px' } },
|
|
1410
|
-
React.createElement(
|
|
1411
|
-
'div',
|
|
1412
|
-
{ className: 'tile__media' },
|
|
1413
|
-
React.createElement('img', { className: 'tile__img', src: thumbnail, alt: img.slideshowImage.alt ? img.slideshowImage.alt : '', style: { width: tileSize + 'px' } })
|
|
1414
|
-
),
|
|
1415
|
-
React.createElement('div', { style: { color: variant }, className: 'tile__info' })
|
|
1416
|
-
);
|
|
1417
|
-
} else {
|
|
1418
|
-
return React.createElement(
|
|
1419
|
-
'a',
|
|
1420
|
-
{ ref: tile, key: index, href: img.slideshowImage.link, target: img.slideshowImage.blank ? '_target' : '_self', className: 'tile', style: { width: tileSize + 'px' } },
|
|
1421
|
-
React.createElement(
|
|
1422
|
-
'div',
|
|
1423
|
-
{ className: 'tile__media' },
|
|
1424
|
-
React.createElement('img', { className: 'tile__img', src: thumbnail, alt: img.slideshowImage.alt ? img.slideshowImage.alt : '', style: { width: tileSize + 'px' } })
|
|
1425
|
-
),
|
|
1426
|
-
React.createElement('div', { style: { color: variant }, className: 'tile__info' })
|
|
1427
|
-
);
|
|
1428
|
-
}
|
|
1429
|
-
})
|
|
1430
|
-
)
|
|
1431
|
-
),
|
|
1432
|
-
React.createElement(
|
|
1433
|
-
'style',
|
|
1434
|
-
{ jsx: 'true' },
|
|
1435
|
-
'\n #vid-slider * {\n box-sizing: border-box;\n -ms-overflow-style: none;\n }\n #vid-slider::-webkit-scrollbar-thumb {\n display: none;\n }\n #vid-slider::-webkit-scrollbar {\n display: none;\n }\n #vid-slider .row::-webkit-scrollbar {\n display: none;\n }\n #vid-slider .row::-webkit-scrollbar-thumb {\n display: none;\n }\n #vid-slider {\n position: relative;\n -ms-overflow-style: none;\n padding: 0 1.5rem;\n margin-bottom: 0 !important;\n }\n #vid-slider .now-playing {\n position: absolute;\n top: 0.5rem;\n left: 1rem;\n color: white;\n background: rgba(0, 0, 0, 0.75);\n }\n #vid-slider h1,\n #vid-slider p {\n text-align: center;\n width: 100%;\n max-width: 500px;\n margin: auto;\n }\n #vid-slider,\n #vidHolder {\n max-width: 805px;\n }\n #vid-slider a:link,\n #vid-slider a:hover,\n #vid-slider a:active,\n #vid-slider a:visited {\n transition: color 150ms;\n color: #95a5a6;\n text-decoration: none;\n }\n #vid-slider a:hover {\n color: #7f8c8d;\n text-decoration: underline;\n }\n #vid-slider .contain {\n width: 100%;\n }\n #vid-slider .row {\n overflow-x: scroll;\n width: 100%;\n -ms-overflow-style: none;\n overflow-y: hidden !important;\n }\n #vid-slider .tile__info {\n white-space: normal !important;\n position: absolute;\n text-align: center;\n color: ' + (props.dark ? 'white' : '#383838') + ';\n opacity: 1;\n font-size: 0.9rem;\n font-weight: bold;\n transition: opacity 0.25s;\n }\n #vid-slider .row__inner {\n transition: 450ms -webkit-transform;\n transition: 450ms transform;\n transition: 450ms transform, 450ms -webkit-transform;\n font-size: 0;\n white-space: nowrap;\n margin: 25px 0 70px !important;\n padding-bottom: 10px;\n padding-left: 0;\n }\n #vid-slider .tile {\n position: relative;\n display: inline-block;\n margin: 0 12px;\n font-size: 20px;\n transition: 450ms all;\n -webkit-transform-origin: center left;\n transform-origin: center left;\n }\n \n #vid-slider .tile:first-child {\n margin-left: 15px;\n }\n #vid-slider .tile__img {\n height: auto;\n -o-object-fit: contain;\n object-fit: contain;\n object-position: center;\n }\n #vid-slider .tile__details {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n top: 0;\n font-size: 10px;\n opacity: 0;\n background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);\n transition: 450ms opacity;\n }\n #vid-slider .tile__details:after,\n #vid-slider .tile__details:before {\n content: \'\';\n \n position: absolute;\n top: 50%;\n left: 50%;\n display: #000;\n }\n #vid-slider .tile__details:after {\n margin-top: -25px;\n margin-left: -25px;\n width: 50px;\n height: 50px;\n border: 3px solid #ecf0f1;\n line-height: 50px;\n text-align: center;\n border-radius: 100%;\n background: rgba(0, 0, 0, 0.5);\n z-index: 1;\n }\n #vid-slider .tile__details:before {\n content: \'\';\n background: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 64 64\' width=\'64\' height=\'64\' fill=\'white\'><path d=\'M26 46 L46 32 L26 18 Z\'/></svg>")\n no-repeat center center;\n left: 0;\n width: 100%;\n height: 3rem;\n font-size: 30px;\n margin-right: 12px;\n margin-top: -24px;\n text-align: center;\n z-index: 2;\n color: white;\n }\n \n #vid-slider .tile__title {\n position: absolute;\n bottom: 0;\n padding: 10px;\n max-width: 250px;\n }\n #vid-slider .tile__title_text {\n position: relative;\n left: 0;\n white-space: normal;\n }\n \n #vid-slider .tile__slider-prev,\n #vid-slider .tile__slider-next {\n width: 30px;\n background: transparent;\n border: none;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n z-index: 99;\n cursor: pointer;\n color: ' + (props.dark ? 'white' : 'black') + ';\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 2rem;\n }\n #vid-slider .tile__slider-prev {\n left: -0.5rem;\n padding: 1rem;\n }\n #vid-slider .tile__slider-next {\n right: -0.5rem;\n padding: 1rem;\n }\n #vid-slider,\n #vid-slider .row {\n margin: 0;\n }\n \n #vid-slider .row::-webkit-scrollbar-thumb {\n background-color: transparent !important;\n }\n #vid-slider i {\n border: solid ' + (props.dark ? 'white' : 'black') + ';\n border-width: 0 4px 4px 0;\n display: inline-block;\n padding: 4px;\n pointer-events: none;\n }\n #vid-slider .right {\n transform: rotate(-45deg);\n -webkit-transform: rotate(-45deg);\n }\n #vid-slider .left {\n transform: rotate(135deg);\n -webkit-transform: rotate(135deg);\n }\n @media screen and (min-width: 1399px) {\n .block-content #vid-slider .tile__img {\n height: auto;\n }\n .block-content #vid-slider .tile {\n height: auto;\n }\n }\n \n @media screen and (max-width: 1399px) {\n #vid-slider,\n #vidHolder {\n max-width: 620px;\n }\n }\n @media screen and (max-width: 1200px) {\n #vid-slider,\n #vidHolder {\n max-width: 580px;\n }\n }\n @media screen and (max-width: 967px) {\n #vid-slider {\n max-width: 100%;\n }\n \n #vid-slider .row__inner {\n margin: 60px 0 50px !important;\n }\n }\n \n @media screen and (max-width: 768px) {\n #vidHolder {\n position: unset;\n width: 100%;\n }\n }\n @media screen and (max-width: 568px) {\n #vidHolder {\n position: unset;\n width: 100%;\n }\n \n #vid-slider .row__inner {\n margin: 30px 0 70px;\n }\n }\n '
|
|
1436
|
-
)
|
|
1437
|
-
)
|
|
1438
|
-
);
|
|
1439
|
-
};
|
|
1350
|
+
const js = window.document.createElement('script');
|
|
1351
|
+
js.id = 'facebook-jssdk';
|
|
1352
|
+
js.async = true;
|
|
1353
|
+
js.defer = true;
|
|
1354
|
+
js.src = `https://${domain}/${language}/sdk${chatSupport ? '/xfbml.customerchat' : ''}${debug ? '/debug' : ''}.js`;
|
|
1355
|
+
window.document.body.appendChild(js);
|
|
1356
|
+
});
|
|
1357
|
+
return _this.loadingPromise;
|
|
1358
|
+
})();
|
|
1359
|
+
}
|
|
1440
1360
|
|
|
1441
|
-
|
|
1361
|
+
process(method, before = [], after = []) {
|
|
1362
|
+
var _this2 = this;
|
|
1363
|
+
|
|
1364
|
+
return asyncToGenerator(function* () {
|
|
1365
|
+
const fb = yield _this2.init();
|
|
1366
|
+
return new Promise((resolve, reject) => {
|
|
1367
|
+
fb[method](...before, response => {
|
|
1368
|
+
if (!response) {
|
|
1369
|
+
if (method === 'ui') return;
|
|
1370
|
+
reject(new Error('Response is undefined'));
|
|
1371
|
+
} else if (response.error) {
|
|
1372
|
+
const {
|
|
1373
|
+
code,
|
|
1374
|
+
type,
|
|
1375
|
+
message
|
|
1376
|
+
} = response.error;
|
|
1377
|
+
const error = new Error(message);
|
|
1378
|
+
error.code = code;
|
|
1379
|
+
error.type = type;
|
|
1380
|
+
reject(error);
|
|
1381
|
+
} else {
|
|
1382
|
+
resolve(response);
|
|
1383
|
+
}
|
|
1384
|
+
}, ...after);
|
|
1385
|
+
});
|
|
1386
|
+
})();
|
|
1387
|
+
}
|
|
1442
1388
|
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
query = _ref.query,
|
|
1446
|
-
params = _ref.params,
|
|
1447
|
-
features = _ref.features,
|
|
1448
|
-
currentPage = _ref.currentPage,
|
|
1449
|
-
partnerDetails = _ref.partnerDetails,
|
|
1450
|
-
client = _ref.client,
|
|
1451
|
-
Settings = _ref.Settings,
|
|
1452
|
-
pageview = _ref.pageview,
|
|
1453
|
-
page = _ref.page;
|
|
1389
|
+
ui(options) {
|
|
1390
|
+
var _this3 = this;
|
|
1454
1391
|
|
|
1455
|
-
|
|
1456
|
-
|
|
1392
|
+
return asyncToGenerator(function* () {
|
|
1393
|
+
return _this3.process('ui', [options]);
|
|
1394
|
+
})();
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
api(path, method = Method.GET, params = {}) {
|
|
1398
|
+
var _this4 = this;
|
|
1399
|
+
|
|
1400
|
+
return asyncToGenerator(function* () {
|
|
1401
|
+
return _this4.process('api', [path, method, params]);
|
|
1402
|
+
})();
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
login(opts = null) {
|
|
1406
|
+
var _this5 = this;
|
|
1407
|
+
|
|
1408
|
+
return asyncToGenerator(function* () {
|
|
1409
|
+
return _this5.process('login', [], [opts]);
|
|
1410
|
+
})();
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
logout() {
|
|
1414
|
+
var _this6 = this;
|
|
1415
|
+
|
|
1416
|
+
return asyncToGenerator(function* () {
|
|
1417
|
+
return _this6.process('logout');
|
|
1418
|
+
})();
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
getLoginStatus() {
|
|
1422
|
+
var _this7 = this;
|
|
1423
|
+
|
|
1424
|
+
return asyncToGenerator(function* () {
|
|
1425
|
+
return _this7.process('getLoginStatus');
|
|
1426
|
+
})();
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
getAuthResponse() {
|
|
1430
|
+
var _this8 = this;
|
|
1431
|
+
|
|
1432
|
+
return asyncToGenerator(function* () {
|
|
1433
|
+
return _this8.process('getAuthResponse');
|
|
1434
|
+
})();
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
getTokenDetail(loginResponse) {
|
|
1438
|
+
var _this9 = this;
|
|
1439
|
+
|
|
1440
|
+
return asyncToGenerator(function* () {
|
|
1441
|
+
if (loginResponse.status === LoginStatus.CONNECTED && loginResponse.authResponse) {
|
|
1442
|
+
return loginResponse.authResponse;
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
const response = yield _this9.getLoginStatus();
|
|
1446
|
+
|
|
1447
|
+
if (response.status === LoginStatus.CONNECTED && response.authResponse) {
|
|
1448
|
+
return response.authResponse;
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
throw new Error('Token is undefined');
|
|
1452
|
+
})();
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
getProfile(params) {
|
|
1456
|
+
var _this10 = this;
|
|
1457
|
+
|
|
1458
|
+
return asyncToGenerator(function* () {
|
|
1459
|
+
return _this10.api('/me', Method.GET, params);
|
|
1460
|
+
})();
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
getTokenDetailWithProfile(params, response) {
|
|
1464
|
+
var _this11 = this;
|
|
1465
|
+
|
|
1466
|
+
return asyncToGenerator(function* () {
|
|
1467
|
+
const tokenDetail = yield _this11.getTokenDetail(response);
|
|
1468
|
+
const profile = yield _this11.getProfile(params);
|
|
1469
|
+
return {
|
|
1470
|
+
profile,
|
|
1471
|
+
tokenDetail
|
|
1472
|
+
};
|
|
1473
|
+
})();
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
getToken() {
|
|
1477
|
+
var _this12 = this;
|
|
1478
|
+
|
|
1479
|
+
return asyncToGenerator(function* () {
|
|
1480
|
+
const authResponse = yield _this12.getTokenDetail();
|
|
1481
|
+
return authResponse.accessToken;
|
|
1482
|
+
})();
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
getUserId() {
|
|
1486
|
+
var _this13 = this;
|
|
1487
|
+
|
|
1488
|
+
return asyncToGenerator(function* () {
|
|
1489
|
+
const authResponse = yield _this13.getTokenDetail();
|
|
1490
|
+
return authResponse.userID;
|
|
1491
|
+
})();
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
sendInvite(to, options) {
|
|
1495
|
+
var _this14 = this;
|
|
1496
|
+
|
|
1497
|
+
return asyncToGenerator(function* () {
|
|
1498
|
+
return _this14.ui(_objectSpread({
|
|
1499
|
+
to,
|
|
1500
|
+
method: 'apprequests'
|
|
1501
|
+
}, options));
|
|
1502
|
+
})();
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
postAction(ogNamespace, ogAction, ogObject, ogObjectUrl, noFeedStory) {
|
|
1506
|
+
var _this15 = this;
|
|
1507
|
+
|
|
1508
|
+
return asyncToGenerator(function* () {
|
|
1509
|
+
let url = `/me/${ogNamespace}:${ogAction}?${ogObject}=${encodeURIComponent(ogObjectUrl)}`;
|
|
1510
|
+
|
|
1511
|
+
if (noFeedStory === true) {
|
|
1512
|
+
url += '&no_feed_story=true';
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
return _this15.api(url, Method.POST);
|
|
1516
|
+
})();
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
getPermissions() {
|
|
1520
|
+
var _this16 = this;
|
|
1521
|
+
|
|
1522
|
+
return asyncToGenerator(function* () {
|
|
1523
|
+
const response = yield _this16.api('/me/permissions');
|
|
1524
|
+
return response.data;
|
|
1525
|
+
})();
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
hasPermissions(permissions) {
|
|
1529
|
+
var _this17 = this;
|
|
1530
|
+
|
|
1531
|
+
return asyncToGenerator(function* () {
|
|
1532
|
+
const usersPermissions = yield _this17.getPermissions();
|
|
1533
|
+
const findedPermissions = permissions.filter(p => {
|
|
1534
|
+
const currentPermission = usersPermissions.find(row => {
|
|
1535
|
+
const {
|
|
1536
|
+
permission,
|
|
1537
|
+
status
|
|
1538
|
+
} = row;
|
|
1539
|
+
return status === 'granted' && permission === p;
|
|
1540
|
+
});
|
|
1541
|
+
return !!currentPermission;
|
|
1542
|
+
});
|
|
1543
|
+
return findedPermissions.length === permissions.length;
|
|
1544
|
+
})();
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
subscribe(eventName, callback) {
|
|
1548
|
+
var _this18 = this;
|
|
1549
|
+
|
|
1550
|
+
return asyncToGenerator(function* () {
|
|
1551
|
+
const fb = yield _this18.init();
|
|
1552
|
+
fb.Event.subscribe(eventName, callback);
|
|
1553
|
+
})();
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
unsubscribe(eventName, callback) {
|
|
1557
|
+
var _this19 = this;
|
|
1558
|
+
|
|
1559
|
+
return asyncToGenerator(function* () {
|
|
1560
|
+
const fb = yield _this19.init();
|
|
1561
|
+
fb.Event.unsubscribe(eventName, callback);
|
|
1562
|
+
})();
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
parse(parentNode) {
|
|
1566
|
+
var _this20 = this;
|
|
1567
|
+
|
|
1568
|
+
return asyncToGenerator(function* () {
|
|
1569
|
+
const fb = yield _this20.init();
|
|
1570
|
+
|
|
1571
|
+
if (typeof parentNode === 'undefined') {
|
|
1572
|
+
fb.XFBML.parse();
|
|
1573
|
+
} else {
|
|
1574
|
+
fb.XFBML.parse(parentNode);
|
|
1575
|
+
}
|
|
1576
|
+
})();
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
getRequests() {
|
|
1580
|
+
var _this21 = this;
|
|
1581
|
+
|
|
1582
|
+
return asyncToGenerator(function* () {
|
|
1583
|
+
return _this21.api('/me/apprequests');
|
|
1584
|
+
})();
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
removeRequest(requestID) {
|
|
1588
|
+
var _this22 = this;
|
|
1589
|
+
|
|
1590
|
+
return asyncToGenerator(function* () {
|
|
1591
|
+
return _this22.api(requestID, Method.DELETE);
|
|
1592
|
+
})();
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
setAutoGrow() {
|
|
1596
|
+
var _this23 = this;
|
|
1597
|
+
|
|
1598
|
+
return asyncToGenerator(function* () {
|
|
1599
|
+
const fb = yield _this23.init();
|
|
1600
|
+
fb.Canvas.setAutoGrow();
|
|
1601
|
+
})();
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
paySimple(product, quantity = 1) {
|
|
1605
|
+
var _this24 = this;
|
|
1606
|
+
|
|
1607
|
+
return asyncToGenerator(function* () {
|
|
1608
|
+
return _this24.ui({
|
|
1609
|
+
method: 'pay',
|
|
1610
|
+
action: 'purchaseitem',
|
|
1611
|
+
product,
|
|
1612
|
+
quantity
|
|
1613
|
+
});
|
|
1614
|
+
})();
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
pay(product, options) {
|
|
1618
|
+
var _this25 = this;
|
|
1619
|
+
|
|
1620
|
+
return asyncToGenerator(function* () {
|
|
1621
|
+
return _this25.ui(_objectSpread({
|
|
1622
|
+
method: 'pay',
|
|
1623
|
+
action: 'purchaseitem',
|
|
1624
|
+
product
|
|
1625
|
+
}, options));
|
|
1626
|
+
})();
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
}
|
|
1630
|
+
/*
|
|
1631
|
+
sendToFriends: function(options, callback) {
|
|
1632
|
+
if(!options) {
|
|
1633
|
+
options = {};
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
options.method = 'send';
|
|
1637
|
+
|
|
1638
|
+
this.afterLoad(function(err, fbApi) {
|
|
1639
|
+
if(err) {
|
|
1640
|
+
return callback(err);
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
FB.ui(options, function(response) {
|
|
1644
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1645
|
+
});
|
|
1646
|
+
});
|
|
1647
|
+
},
|
|
1648
|
+
|
|
1649
|
+
sendMessage: function(message, name, caption, description, url, imgUrl, callback) {
|
|
1650
|
+
this.afterLoad(function(err, fbApi) {
|
|
1651
|
+
if(err) {
|
|
1652
|
+
return callback(err);
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1655
|
+
FB.ui({
|
|
1656
|
+
method: 'stream.publish',
|
|
1657
|
+
message: message,
|
|
1658
|
+
attachment: {
|
|
1659
|
+
name: name,
|
|
1660
|
+
caption: caption,
|
|
1661
|
+
description: description,
|
|
1662
|
+
href: url,
|
|
1663
|
+
media:[{
|
|
1664
|
+
type: 'image',
|
|
1665
|
+
src: imgUrl,
|
|
1666
|
+
href: url
|
|
1667
|
+
}]
|
|
1668
|
+
},
|
|
1669
|
+
action_links: [{
|
|
1670
|
+
text: 'Code',
|
|
1671
|
+
href: url
|
|
1672
|
+
}],
|
|
1673
|
+
user_prompt_message: message
|
|
1674
|
+
},
|
|
1675
|
+
function(response) {
|
|
1676
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1677
|
+
});
|
|
1678
|
+
});
|
|
1679
|
+
},
|
|
1680
|
+
|
|
1681
|
+
sendInviteForm: function(options, callback) {
|
|
1682
|
+
if(typeof options === 'function') {
|
|
1683
|
+
callback = options;
|
|
1684
|
+
options = {};
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
this.afterLoad(function(err, fbApi) {
|
|
1688
|
+
if(err) {
|
|
1689
|
+
return callback(err);
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
options.method = options.method || 'apprequests';
|
|
1693
|
+
|
|
1694
|
+
|
|
1695
|
+
FB.ui(options, function(response) {
|
|
1696
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1697
|
+
});
|
|
1698
|
+
});
|
|
1699
|
+
},
|
|
1700
|
+
|
|
1701
|
+
checkPageLike: function(pageID, callback) {
|
|
1702
|
+
this.afterLoad(function(err, fbApi) {
|
|
1703
|
+
if(err) {
|
|
1704
|
+
return callback(err);
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
fbApi.getUserID(function(err, userID) {
|
|
1708
|
+
if(err) {
|
|
1709
|
+
return callback(err);
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
var fqlQuery = `SELECT uid FROM page_fan WHERE page_id = ${pageID} and uid = ${userID}`;
|
|
1713
|
+
var query = FB.Data.query(fqlQuery);
|
|
1714
|
+
|
|
1715
|
+
query.wait(function(rows) {
|
|
1716
|
+
if (rows.length === 1 && rows[0].uid === userID) {
|
|
1717
|
+
callback(null, true, query);
|
|
1718
|
+
}
|
|
1719
|
+
else {
|
|
1720
|
+
callback(null, false, query);
|
|
1721
|
+
}
|
|
1722
|
+
});
|
|
1723
|
+
});
|
|
1724
|
+
});
|
|
1725
|
+
},
|
|
1726
|
+
|
|
1727
|
+
sendMessageToFriend: function (friendID, link, callback) {
|
|
1728
|
+
this.afterLoad(function(err, fbApi) {
|
|
1729
|
+
if(err) {
|
|
1730
|
+
return callback(err);
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
FB.ui({
|
|
1734
|
+
to: friendID,
|
|
1735
|
+
method: 'send',
|
|
1736
|
+
link: link
|
|
1737
|
+
}, function(response) {
|
|
1738
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1739
|
+
});
|
|
1740
|
+
});
|
|
1741
|
+
},
|
|
1742
|
+
|
|
1743
|
+
_prepareUsers: function(data) {
|
|
1744
|
+
var users=[];
|
|
1745
|
+
|
|
1746
|
+
for(var index in data) {
|
|
1747
|
+
var userData=data[index];
|
|
1748
|
+
|
|
1749
|
+
var user = {
|
|
1750
|
+
provider_uid: 'facebook'+'_'+userData.uid,
|
|
1751
|
+
provider: 'facebook',
|
|
1752
|
+
id: userData.uid,
|
|
1753
|
+
name: userData.name,
|
|
1754
|
+
first_name: userData.first_name,
|
|
1755
|
+
last_name: userData.last_name,
|
|
1756
|
+
status: (userData.status!==null) ? userData.status : null,
|
|
1757
|
+
image: '//graph.facebook.com/'+userData.uid+'/picture?'
|
|
1758
|
+
};
|
|
1759
|
+
|
|
1760
|
+
users.push(user);
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
return users;
|
|
1764
|
+
},
|
|
1765
|
+
|
|
1766
|
+
getUserList: function(callback) {
|
|
1767
|
+
this.afterLoad(function(err, fbApi) {
|
|
1768
|
+
if(err) {
|
|
1769
|
+
return callback(err);
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
FB.api('fql', {
|
|
1773
|
+
q: `
|
|
1774
|
+
SELECT uid, name, first_name, last_name, online_presence, status
|
|
1775
|
+
FROM user
|
|
1776
|
+
WHERE uid IN
|
|
1777
|
+
( SELECT uid2 FROM friend WHERE uid1 = me()) ORDER BY name
|
|
1778
|
+
`,
|
|
1779
|
+
}, function (response)
|
|
1780
|
+
{
|
|
1781
|
+
var users = fbApi._prepareUsers(response.data);
|
|
1782
|
+
callback(null, users, response);
|
|
1783
|
+
});
|
|
1784
|
+
});
|
|
1785
|
+
},
|
|
1786
|
+
|
|
1787
|
+
postFeed: function(options, callback) {
|
|
1788
|
+
this.afterLoad(function(err, fbApi) {
|
|
1789
|
+
if(err) {
|
|
1790
|
+
return callback(err);
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
options.method='feed';
|
|
1794
|
+
|
|
1795
|
+
FB.ui(options, function(response) {
|
|
1796
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1797
|
+
});
|
|
1798
|
+
});
|
|
1799
|
+
},
|
|
1800
|
+
|
|
1801
|
+
//need publish_stream
|
|
1802
|
+
createAlbum: function(name, description, callback) {
|
|
1803
|
+
this.afterLoad(function(err, fbApi) {
|
|
1804
|
+
if(err) {
|
|
1805
|
+
return callback(err);
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
FB.api('/me/albums', 'post', {
|
|
1809
|
+
name: name,
|
|
1810
|
+
description: description
|
|
1811
|
+
},function(response) {
|
|
1812
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1813
|
+
});
|
|
1814
|
+
});
|
|
1815
|
+
},
|
|
1816
|
+
|
|
1817
|
+
//need publish_stream
|
|
1818
|
+
addImageToAlbum: function(albumID, imageURL, message, callback) {
|
|
1819
|
+
this.afterLoad(function(err, fbApi) {
|
|
1820
|
+
if(err) {
|
|
1821
|
+
return callback(err);
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
FB.api('/'+albumID+'/photos', 'post', {
|
|
1825
|
+
message: message,
|
|
1826
|
+
url: imageURL
|
|
1827
|
+
}, function(response) {
|
|
1828
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1829
|
+
});
|
|
1830
|
+
});
|
|
1831
|
+
},
|
|
1832
|
+
|
|
1833
|
+
//'user_photos'
|
|
1834
|
+
getAlbums: function(callback) {
|
|
1835
|
+
this.afterLoad(function(err, fbApi) {
|
|
1836
|
+
if(err) {
|
|
1837
|
+
return callback(err);
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
FB.api('/me/albums', function(response) {
|
|
1841
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1842
|
+
});
|
|
1843
|
+
});
|
|
1844
|
+
},
|
|
1845
|
+
|
|
1846
|
+
//'user_photos'
|
|
1847
|
+
getAlbumPhotos: function(albumID, callback) {
|
|
1848
|
+
this.afterLoad(function(err, fbApi) {
|
|
1849
|
+
if(err) {
|
|
1850
|
+
return callback(err);
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
FB.api('/'+albumID+'/photos', function(response) {
|
|
1854
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1855
|
+
});
|
|
1856
|
+
});
|
|
1857
|
+
},
|
|
1858
|
+
|
|
1859
|
+
//'user_photos'
|
|
1860
|
+
getAlbumCoverPicture: function(albumID, callback) {
|
|
1861
|
+
this.afterLoad(function(err, fbApi) {
|
|
1862
|
+
if(err) {
|
|
1863
|
+
return callback(err);
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1866
|
+
FB.api('/'+albumID+'/picture', function(response) {
|
|
1867
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1868
|
+
});
|
|
1869
|
+
});
|
|
1870
|
+
},
|
|
1871
|
+
|
|
1872
|
+
//'publish_stream'
|
|
1873
|
+
postPhoto: function(photoUrl, message, callback) {
|
|
1874
|
+
this.afterLoad(function(err, fbApi) {
|
|
1875
|
+
if(err) {
|
|
1876
|
+
return callback(err);
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
FB.api('/me/photos', 'post', {
|
|
1880
|
+
message: message,
|
|
1881
|
+
url: photoUrl
|
|
1882
|
+
},function(response) {
|
|
1883
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1884
|
+
});
|
|
1885
|
+
});
|
|
1886
|
+
},
|
|
1887
|
+
|
|
1888
|
+
getPageInfo: function(callback) {
|
|
1889
|
+
this.afterLoad(function(err, fbApi) {
|
|
1890
|
+
if(err) {
|
|
1891
|
+
return callback(err);
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
FB.Canvas.getPageInfo(function(response) {
|
|
1895
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1896
|
+
});
|
|
1897
|
+
});
|
|
1898
|
+
}
|
|
1899
|
+
*/
|
|
1900
|
+
|
|
1901
|
+
var FacebookContext = createContext();
|
|
1902
|
+
|
|
1903
|
+
let api = null;
|
|
1904
|
+
class Facebook$1 extends Component {
|
|
1905
|
+
constructor(...args) {
|
|
1906
|
+
var _this;
|
|
1907
|
+
|
|
1908
|
+
super(...args);
|
|
1909
|
+
_this = this;
|
|
1910
|
+
|
|
1911
|
+
defineProperty(this, "state", {
|
|
1912
|
+
isReady: false
|
|
1913
|
+
});
|
|
1914
|
+
|
|
1915
|
+
defineProperty(this, "handleInit",
|
|
1916
|
+
/*#__PURE__*/
|
|
1917
|
+
asyncToGenerator(function* () {
|
|
1918
|
+
// do not run if SSR
|
|
1919
|
+
if (!canUseDom) {
|
|
1920
|
+
throw new Error('You can not use Facebook without DOM');
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
const {
|
|
1924
|
+
isReady
|
|
1925
|
+
} = _this.state;
|
|
1926
|
+
|
|
1927
|
+
if (isReady) {
|
|
1928
|
+
return api;
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1931
|
+
if (!api) {
|
|
1932
|
+
const {
|
|
1933
|
+
domain,
|
|
1934
|
+
version,
|
|
1935
|
+
appId,
|
|
1936
|
+
cookie,
|
|
1937
|
+
status,
|
|
1938
|
+
xfbml,
|
|
1939
|
+
language,
|
|
1940
|
+
frictionlessRequests,
|
|
1941
|
+
wait,
|
|
1942
|
+
debug,
|
|
1943
|
+
chatSupport
|
|
1944
|
+
} = _this.props;
|
|
1945
|
+
api = new Facebook({
|
|
1946
|
+
domain,
|
|
1947
|
+
appId,
|
|
1948
|
+
version,
|
|
1949
|
+
cookie,
|
|
1950
|
+
status,
|
|
1951
|
+
xfbml,
|
|
1952
|
+
language,
|
|
1953
|
+
frictionlessRequests,
|
|
1954
|
+
wait,
|
|
1955
|
+
debug,
|
|
1956
|
+
chatSupport
|
|
1957
|
+
});
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
yield api.init();
|
|
1961
|
+
|
|
1962
|
+
if (!_this.state.isReady) {
|
|
1963
|
+
_this.setState({
|
|
1964
|
+
isReady: true
|
|
1965
|
+
});
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
return api;
|
|
1969
|
+
}));
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
componentDidMount() {
|
|
1973
|
+
const {
|
|
1974
|
+
wait
|
|
1975
|
+
} = this.props;
|
|
1976
|
+
|
|
1977
|
+
if (!wait) {
|
|
1978
|
+
this.handleInit();
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
render() {
|
|
1983
|
+
const {
|
|
1984
|
+
children
|
|
1985
|
+
} = this.props;
|
|
1986
|
+
const {
|
|
1987
|
+
isReady,
|
|
1988
|
+
error
|
|
1989
|
+
} = this.state;
|
|
1990
|
+
const {
|
|
1991
|
+
handleInit
|
|
1992
|
+
} = this;
|
|
1993
|
+
const value = {
|
|
1994
|
+
isReady,
|
|
1995
|
+
error,
|
|
1996
|
+
handleInit,
|
|
1997
|
+
api
|
|
1998
|
+
};
|
|
1999
|
+
return React__default.createElement(FacebookContext.Provider, {
|
|
2000
|
+
value: value
|
|
2001
|
+
}, children);
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
defineProperty(Facebook$1, "defaultProps", {
|
|
2007
|
+
version: 'v3.1',
|
|
2008
|
+
cookie: false,
|
|
2009
|
+
status: false,
|
|
2010
|
+
xfbml: false,
|
|
2011
|
+
language: 'en_US',
|
|
2012
|
+
frictionlessRequests: false,
|
|
2013
|
+
domain: 'connect.facebook.net',
|
|
2014
|
+
children: undefined,
|
|
2015
|
+
wait: false,
|
|
2016
|
+
debug: false,
|
|
2017
|
+
chatSupport: false
|
|
2018
|
+
});
|
|
2019
|
+
|
|
2020
|
+
var _extends_1 = createCommonjsModule(function (module) {
|
|
2021
|
+
function _extends() {
|
|
2022
|
+
module.exports = _extends = Object.assign || function (target) {
|
|
2023
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2024
|
+
var source = arguments[i];
|
|
2025
|
+
|
|
2026
|
+
for (var key in source) {
|
|
2027
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2028
|
+
target[key] = source[key];
|
|
2029
|
+
}
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
return target;
|
|
2034
|
+
};
|
|
2035
|
+
|
|
2036
|
+
return _extends.apply(this, arguments);
|
|
2037
|
+
}
|
|
2038
|
+
|
|
2039
|
+
module.exports = _extends;
|
|
2040
|
+
});
|
|
2041
|
+
|
|
2042
|
+
class Initialize extends Component {
|
|
2043
|
+
componentDidMount() {
|
|
2044
|
+
this.$isMounted = true;
|
|
2045
|
+
this.prepare();
|
|
2046
|
+
}
|
|
2047
|
+
|
|
2048
|
+
componentWillUnmount() {
|
|
2049
|
+
this.$isMounted = false;
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2052
|
+
prepare() {
|
|
2053
|
+
var _this = this;
|
|
2054
|
+
|
|
2055
|
+
return asyncToGenerator(function* () {
|
|
2056
|
+
const {
|
|
2057
|
+
onReady,
|
|
2058
|
+
handleInit
|
|
2059
|
+
} = _this.props;
|
|
2060
|
+
const api = yield handleInit();
|
|
2061
|
+
|
|
2062
|
+
if (onReady && _this.$isMounted) {
|
|
2063
|
+
onReady(api);
|
|
2064
|
+
}
|
|
2065
|
+
})();
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2068
|
+
render() {
|
|
2069
|
+
const {
|
|
2070
|
+
children,
|
|
2071
|
+
isReady,
|
|
2072
|
+
api
|
|
2073
|
+
} = this.props;
|
|
2074
|
+
const childrenProps = {
|
|
2075
|
+
isReady,
|
|
2076
|
+
api
|
|
2077
|
+
};
|
|
2078
|
+
|
|
2079
|
+
if (typeof children === 'function') {
|
|
2080
|
+
return children(childrenProps);
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
return children;
|
|
2084
|
+
}
|
|
2085
|
+
|
|
2086
|
+
}
|
|
2087
|
+
|
|
2088
|
+
defineProperty(Initialize, "defaultProps", {
|
|
2089
|
+
onReady: undefined,
|
|
2090
|
+
api: undefined
|
|
2091
|
+
});
|
|
2092
|
+
|
|
2093
|
+
var Initialize$1 = forwardRef((props, ref) => React__default.createElement(FacebookContext.Consumer, null, ({
|
|
2094
|
+
handleInit,
|
|
2095
|
+
isReady,
|
|
2096
|
+
api
|
|
2097
|
+
}) => React__default.createElement(Initialize, _extends_1({}, props, {
|
|
2098
|
+
handleInit: handleInit,
|
|
2099
|
+
isReady: isReady,
|
|
2100
|
+
api: api,
|
|
2101
|
+
ref: ref
|
|
2102
|
+
}))));
|
|
2103
|
+
|
|
2104
|
+
class Parser extends Component {
|
|
2105
|
+
constructor(...args) {
|
|
2106
|
+
super(...args);
|
|
2107
|
+
|
|
2108
|
+
defineProperty(this, "state", {});
|
|
2109
|
+
|
|
2110
|
+
defineProperty(this, "handleReady", api => {
|
|
2111
|
+
this.setState({
|
|
2112
|
+
api
|
|
2113
|
+
}, this.handleParse);
|
|
2114
|
+
});
|
|
2115
|
+
|
|
2116
|
+
defineProperty(this, "handleContainer", container => {
|
|
2117
|
+
this.setState({
|
|
2118
|
+
container
|
|
2119
|
+
}, this.handleParse);
|
|
2120
|
+
});
|
|
2121
|
+
|
|
2122
|
+
defineProperty(this, "handleParse", () => {
|
|
2123
|
+
const {
|
|
2124
|
+
api,
|
|
2125
|
+
container
|
|
2126
|
+
} = this.state;
|
|
2127
|
+
|
|
2128
|
+
if (!api || !container) {
|
|
2129
|
+
return;
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
api.parse(container);
|
|
2133
|
+
});
|
|
2134
|
+
}
|
|
2135
|
+
|
|
2136
|
+
render() {
|
|
2137
|
+
const {
|
|
2138
|
+
className,
|
|
2139
|
+
children
|
|
2140
|
+
} = this.props;
|
|
2141
|
+
return React__default.createElement("div", {
|
|
2142
|
+
className: className,
|
|
2143
|
+
ref: this.handleContainer
|
|
2144
|
+
}, React__default.createElement(Initialize$1, {
|
|
2145
|
+
onReady: this.handleReady
|
|
2146
|
+
}, children({
|
|
2147
|
+
handleParse: this.handleParse
|
|
2148
|
+
})));
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
}
|
|
2152
|
+
|
|
2153
|
+
defineProperty(Parser, "defaultProps", {
|
|
2154
|
+
className: undefined
|
|
2155
|
+
});
|
|
2156
|
+
|
|
2157
|
+
function getCurrentHref() {
|
|
2158
|
+
if (!canUseDom) {
|
|
2159
|
+
return 'https://www.facebook.com';
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
return window.location.href;
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
class Like extends PureComponent {
|
|
2166
|
+
componentDidUpdate() {
|
|
2167
|
+
const {
|
|
2168
|
+
handleParse
|
|
2169
|
+
} = this.props;
|
|
2170
|
+
handleParse();
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
render() {
|
|
2174
|
+
const {
|
|
2175
|
+
href = getCurrentHref(),
|
|
2176
|
+
layout,
|
|
2177
|
+
colorScheme,
|
|
2178
|
+
action,
|
|
2179
|
+
showFaces,
|
|
2180
|
+
share,
|
|
2181
|
+
children,
|
|
2182
|
+
width,
|
|
2183
|
+
size,
|
|
2184
|
+
kidDirectedSite,
|
|
2185
|
+
referral
|
|
2186
|
+
} = this.props;
|
|
2187
|
+
return React__default.createElement("div", {
|
|
2188
|
+
className: "fb-like",
|
|
2189
|
+
"data-ref": referral,
|
|
2190
|
+
"data-href": href,
|
|
2191
|
+
"data-layout": layout,
|
|
2192
|
+
"data-colorscheme": colorScheme,
|
|
2193
|
+
"data-action": action,
|
|
2194
|
+
"data-show-faces": showFaces,
|
|
2195
|
+
"data-share": share,
|
|
2196
|
+
"data-width": width,
|
|
2197
|
+
"data-size": size,
|
|
2198
|
+
"data-kid-directed-site": kidDirectedSite
|
|
2199
|
+
}, children);
|
|
2200
|
+
}
|
|
2201
|
+
|
|
2202
|
+
}
|
|
2203
|
+
|
|
2204
|
+
defineProperty(Like, "defaultProps", {
|
|
2205
|
+
layout: undefined,
|
|
2206
|
+
showFaces: undefined,
|
|
2207
|
+
colorScheme: undefined,
|
|
2208
|
+
action: undefined,
|
|
2209
|
+
share: undefined,
|
|
2210
|
+
size: undefined,
|
|
2211
|
+
kidDirectedSite: undefined,
|
|
2212
|
+
children: undefined,
|
|
2213
|
+
href: undefined,
|
|
2214
|
+
referral: undefined,
|
|
2215
|
+
width: undefined
|
|
2216
|
+
});
|
|
2217
|
+
|
|
2218
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
2219
|
+
handleParse
|
|
2220
|
+
}) => React__default.createElement(Like, _extends_1({}, props, {
|
|
2221
|
+
handleParse: handleParse,
|
|
2222
|
+
ref: ref
|
|
2223
|
+
}))));
|
|
2224
|
+
|
|
2225
|
+
function clearUndefinedProperties(obj) {
|
|
2226
|
+
if (!obj) {
|
|
2227
|
+
return obj;
|
|
2228
|
+
}
|
|
2229
|
+
|
|
2230
|
+
const newObj = {};
|
|
2231
|
+
Object.keys(obj).forEach(propertyName => {
|
|
2232
|
+
const value = obj[propertyName];
|
|
2233
|
+
|
|
2234
|
+
if (value !== undefined) {
|
|
2235
|
+
newObj[propertyName] = value;
|
|
2236
|
+
}
|
|
2237
|
+
});
|
|
2238
|
+
return newObj;
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2241
|
+
class Process extends Component {
|
|
2242
|
+
constructor(...args) {
|
|
2243
|
+
var _this;
|
|
2244
|
+
|
|
2245
|
+
super(...args);
|
|
2246
|
+
_this = this;
|
|
2247
|
+
|
|
2248
|
+
defineProperty(this, "state", {
|
|
2249
|
+
api: undefined
|
|
2250
|
+
});
|
|
2251
|
+
|
|
2252
|
+
defineProperty(this, "handleProcess",
|
|
2253
|
+
/*#__PURE__*/
|
|
2254
|
+
function () {
|
|
2255
|
+
var _ref = asyncToGenerator(function* (fn, handleSuccess = () => {}) {
|
|
2256
|
+
_this.setState({
|
|
2257
|
+
data: undefined,
|
|
2258
|
+
error: undefined,
|
|
2259
|
+
loading: true
|
|
2260
|
+
});
|
|
2261
|
+
|
|
2262
|
+
try {
|
|
2263
|
+
const {
|
|
2264
|
+
api
|
|
2265
|
+
} = _this.state;
|
|
2266
|
+
|
|
2267
|
+
if (!api) {
|
|
2268
|
+
throw new Error('Facebook is not initialized. Wait for isReady');
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
const data = yield fn(api);
|
|
2272
|
+
|
|
2273
|
+
_this.setState({
|
|
2274
|
+
data,
|
|
2275
|
+
loading: false
|
|
2276
|
+
}, handleSuccess);
|
|
2277
|
+
|
|
2278
|
+
return data;
|
|
2279
|
+
} catch (error) {
|
|
2280
|
+
_this.setState({
|
|
2281
|
+
error,
|
|
2282
|
+
loading: false
|
|
2283
|
+
});
|
|
2284
|
+
|
|
2285
|
+
throw error;
|
|
2286
|
+
}
|
|
2287
|
+
});
|
|
2288
|
+
|
|
2289
|
+
return function (_x) {
|
|
2290
|
+
return _ref.apply(this, arguments);
|
|
2291
|
+
};
|
|
2292
|
+
}());
|
|
2293
|
+
|
|
2294
|
+
defineProperty(this, "handleReady", api => {
|
|
2295
|
+
this.setState({
|
|
2296
|
+
api
|
|
2297
|
+
});
|
|
2298
|
+
});
|
|
2299
|
+
}
|
|
2300
|
+
|
|
2301
|
+
render() {
|
|
2302
|
+
const {
|
|
2303
|
+
children
|
|
2304
|
+
} = this.props;
|
|
2305
|
+
const {
|
|
2306
|
+
api,
|
|
2307
|
+
loading,
|
|
2308
|
+
data,
|
|
2309
|
+
error
|
|
2310
|
+
} = this.state;
|
|
2311
|
+
return React__default.createElement(Initialize$1, {
|
|
2312
|
+
onReady: this.handleReady
|
|
2313
|
+
}, children({
|
|
2314
|
+
loading: !api || loading,
|
|
2315
|
+
handleProcess: this.handleProcess,
|
|
2316
|
+
data,
|
|
2317
|
+
error
|
|
2318
|
+
}));
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2321
|
+
}
|
|
2322
|
+
|
|
2323
|
+
class Send extends Component {
|
|
2324
|
+
constructor(...args) {
|
|
2325
|
+
var _this;
|
|
2326
|
+
|
|
2327
|
+
super(...args);
|
|
2328
|
+
_this = this;
|
|
2329
|
+
|
|
2330
|
+
defineProperty(this, "handleClick",
|
|
2331
|
+
/*#__PURE__*/
|
|
2332
|
+
function () {
|
|
2333
|
+
var _ref = asyncToGenerator(function* (evn) {
|
|
2334
|
+
evn.preventDefault();
|
|
2335
|
+
const {
|
|
2336
|
+
handleProcess
|
|
2337
|
+
} = _this.props;
|
|
2338
|
+
return handleProcess(
|
|
2339
|
+
/*#__PURE__*/
|
|
2340
|
+
function () {
|
|
2341
|
+
var _ref2 = asyncToGenerator(function* (api) {
|
|
2342
|
+
const {
|
|
2343
|
+
link = getCurrentHref(),
|
|
2344
|
+
display,
|
|
2345
|
+
appId = api.getAppId(),
|
|
2346
|
+
to,
|
|
2347
|
+
redirectURI
|
|
2348
|
+
} = _this.props;
|
|
2349
|
+
return api.ui(clearUndefinedProperties({
|
|
2350
|
+
method: 'send',
|
|
2351
|
+
link,
|
|
2352
|
+
display,
|
|
2353
|
+
app_id: appId,
|
|
2354
|
+
to,
|
|
2355
|
+
redirect_uri: redirectURI
|
|
2356
|
+
}));
|
|
2357
|
+
});
|
|
2358
|
+
|
|
2359
|
+
return function (_x2) {
|
|
2360
|
+
return _ref2.apply(this, arguments);
|
|
2361
|
+
};
|
|
2362
|
+
}());
|
|
2363
|
+
});
|
|
2364
|
+
|
|
2365
|
+
return function (_x) {
|
|
2366
|
+
return _ref.apply(this, arguments);
|
|
2367
|
+
};
|
|
2368
|
+
}());
|
|
2369
|
+
}
|
|
2370
|
+
|
|
2371
|
+
render() {
|
|
2372
|
+
const {
|
|
2373
|
+
children,
|
|
2374
|
+
loading
|
|
2375
|
+
} = this.props;
|
|
2376
|
+
return children({
|
|
2377
|
+
loading,
|
|
2378
|
+
handleClick: this.handleClick
|
|
2379
|
+
});
|
|
2380
|
+
}
|
|
2381
|
+
|
|
2382
|
+
}
|
|
2383
|
+
|
|
2384
|
+
defineProperty(Send, "defaultProps", {
|
|
2385
|
+
to: undefined,
|
|
2386
|
+
display: undefined,
|
|
2387
|
+
appId: undefined,
|
|
2388
|
+
redirectURI: undefined
|
|
2389
|
+
});
|
|
2390
|
+
|
|
2391
|
+
forwardRef((props, ref) => React__default.createElement(Process, null, ({
|
|
2392
|
+
loading,
|
|
2393
|
+
handleProcess
|
|
2394
|
+
}) => React__default.createElement(Send, _extends_1({}, props, {
|
|
2395
|
+
loading: loading,
|
|
2396
|
+
handleProcess: handleProcess,
|
|
2397
|
+
ref: ref
|
|
2398
|
+
}))));
|
|
2399
|
+
|
|
2400
|
+
class Share extends Component {
|
|
2401
|
+
constructor(...args) {
|
|
2402
|
+
var _this;
|
|
2403
|
+
|
|
2404
|
+
super(...args);
|
|
2405
|
+
_this = this;
|
|
2406
|
+
|
|
2407
|
+
defineProperty(this, "handleClick",
|
|
2408
|
+
/*#__PURE__*/
|
|
2409
|
+
function () {
|
|
2410
|
+
var _ref = asyncToGenerator(function* (evn) {
|
|
2411
|
+
evn.preventDefault();
|
|
2412
|
+
const {
|
|
2413
|
+
handleProcess
|
|
2414
|
+
} = _this.props;
|
|
2415
|
+
return handleProcess(
|
|
2416
|
+
/*#__PURE__*/
|
|
2417
|
+
function () {
|
|
2418
|
+
var _ref2 = asyncToGenerator(function* (api) {
|
|
2419
|
+
const {
|
|
2420
|
+
href = getCurrentHref(),
|
|
2421
|
+
display,
|
|
2422
|
+
appId = api.getAppId(),
|
|
2423
|
+
hashtag,
|
|
2424
|
+
redirectURI,
|
|
2425
|
+
quote,
|
|
2426
|
+
mobileIframe
|
|
2427
|
+
} = _this.props;
|
|
2428
|
+
return api.ui(clearUndefinedProperties({
|
|
2429
|
+
method: 'share',
|
|
2430
|
+
href,
|
|
2431
|
+
display,
|
|
2432
|
+
app_id: appId,
|
|
2433
|
+
hashtag,
|
|
2434
|
+
redirect_uri: redirectURI,
|
|
2435
|
+
quote,
|
|
2436
|
+
mobile_iframe: mobileIframe
|
|
2437
|
+
}));
|
|
2438
|
+
});
|
|
2439
|
+
|
|
2440
|
+
return function (_x2) {
|
|
2441
|
+
return _ref2.apply(this, arguments);
|
|
2442
|
+
};
|
|
2443
|
+
}());
|
|
2444
|
+
});
|
|
2445
|
+
|
|
2446
|
+
return function (_x) {
|
|
2447
|
+
return _ref.apply(this, arguments);
|
|
2448
|
+
};
|
|
2449
|
+
}());
|
|
2450
|
+
}
|
|
2451
|
+
|
|
2452
|
+
render() {
|
|
2453
|
+
const {
|
|
2454
|
+
children,
|
|
2455
|
+
loading,
|
|
2456
|
+
error,
|
|
2457
|
+
data
|
|
2458
|
+
} = this.props;
|
|
2459
|
+
return children({
|
|
2460
|
+
loading,
|
|
2461
|
+
handleClick: this.handleClick,
|
|
2462
|
+
error,
|
|
2463
|
+
data
|
|
2464
|
+
});
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
}
|
|
2468
|
+
|
|
2469
|
+
defineProperty(Share, "defaultProps", {
|
|
2470
|
+
href: undefined,
|
|
2471
|
+
hashtag: undefined,
|
|
2472
|
+
quote: undefined,
|
|
2473
|
+
mobileIframe: undefined,
|
|
2474
|
+
display: undefined,
|
|
2475
|
+
appId: undefined,
|
|
2476
|
+
redirectURI: undefined
|
|
2477
|
+
});
|
|
2478
|
+
|
|
2479
|
+
var Share$1 = forwardRef((props, ref) => React__default.createElement(Process, null, ({
|
|
2480
|
+
loading,
|
|
2481
|
+
handleProcess,
|
|
2482
|
+
data,
|
|
2483
|
+
error
|
|
2484
|
+
}) => React__default.createElement(Share, _extends_1({}, props, {
|
|
2485
|
+
loading: loading,
|
|
2486
|
+
handleProcess: handleProcess,
|
|
2487
|
+
data: data,
|
|
2488
|
+
error: error,
|
|
2489
|
+
ref: ref
|
|
2490
|
+
}))));
|
|
2491
|
+
|
|
2492
|
+
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
2493
|
+
|
|
2494
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(source, true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
2495
|
+
function ShareButton(props) {
|
|
2496
|
+
const {
|
|
2497
|
+
className,
|
|
2498
|
+
children
|
|
2499
|
+
} = props,
|
|
2500
|
+
rest = objectWithoutProperties(props, ["className", "children"]);
|
|
2501
|
+
|
|
2502
|
+
return React__default.createElement(Share$1, rest, ({
|
|
2503
|
+
loading,
|
|
2504
|
+
handleClick
|
|
2505
|
+
}) => React__default.createElement("button", {
|
|
2506
|
+
type: "button",
|
|
2507
|
+
disabled: loading,
|
|
2508
|
+
className: className,
|
|
2509
|
+
onClick: handleClick
|
|
2510
|
+
}, children));
|
|
2511
|
+
}
|
|
2512
|
+
ShareButton.defaultProps = _objectSpread$1({}, Share$1.defaultProps, {
|
|
2513
|
+
className: undefined
|
|
2514
|
+
});
|
|
2515
|
+
|
|
2516
|
+
class Page extends PureComponent {
|
|
2517
|
+
componentDidUpdate() {
|
|
2518
|
+
const {
|
|
2519
|
+
handleParse
|
|
2520
|
+
} = this.props;
|
|
2521
|
+
handleParse();
|
|
2522
|
+
}
|
|
2523
|
+
|
|
2524
|
+
render() {
|
|
2525
|
+
const {
|
|
2526
|
+
style,
|
|
2527
|
+
href = getCurrentHref(),
|
|
2528
|
+
tabs,
|
|
2529
|
+
hideCover,
|
|
2530
|
+
width,
|
|
2531
|
+
height,
|
|
2532
|
+
showFacepile,
|
|
2533
|
+
hideCTA,
|
|
2534
|
+
smallHeader,
|
|
2535
|
+
adaptContainerWidth,
|
|
2536
|
+
children
|
|
2537
|
+
} = this.props;
|
|
2538
|
+
return React__default.createElement("div", {
|
|
2539
|
+
className: "fb-page",
|
|
2540
|
+
style: style,
|
|
2541
|
+
"data-tabs": tabs,
|
|
2542
|
+
"data-hide-cover": hideCover,
|
|
2543
|
+
"data-show-facepile": showFacepile,
|
|
2544
|
+
"data-hide-cta": hideCTA,
|
|
2545
|
+
"data-href": href,
|
|
2546
|
+
"data-small-header": smallHeader,
|
|
2547
|
+
"data-adapt-container-width": adaptContainerWidth,
|
|
2548
|
+
"data-height": height,
|
|
2549
|
+
"data-width": width
|
|
2550
|
+
}, children);
|
|
2551
|
+
}
|
|
2552
|
+
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2555
|
+
defineProperty(Page, "defaultProps", {
|
|
2556
|
+
width: undefined,
|
|
2557
|
+
height: undefined,
|
|
2558
|
+
tabs: undefined,
|
|
2559
|
+
hideCover: undefined,
|
|
2560
|
+
showFacepile: undefined,
|
|
2561
|
+
hideCTA: undefined,
|
|
2562
|
+
smallHeader: undefined,
|
|
2563
|
+
adaptContainerWidth: undefined,
|
|
2564
|
+
children: undefined,
|
|
2565
|
+
style: undefined,
|
|
2566
|
+
href: undefined
|
|
2567
|
+
});
|
|
2568
|
+
|
|
2569
|
+
var Page$1 = forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
2570
|
+
handleParse
|
|
2571
|
+
}) => React__default.createElement(Page, _extends_1({}, props, {
|
|
2572
|
+
handleParse: handleParse,
|
|
2573
|
+
ref: ref
|
|
2574
|
+
}))));
|
|
2575
|
+
|
|
2576
|
+
// 3.0 fields without app review https://developers.facebook.com/docs/facebook-login/permissions/?locale=en_US#reference-default
|
|
2577
|
+
var Fields = ['id', 'first_name', 'last_name', 'middle_name', 'name', 'name_format', 'picture', 'short_name', 'email'];
|
|
2578
|
+
|
|
2579
|
+
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
2580
|
+
|
|
2581
|
+
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$2(source, true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$2(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
2582
|
+
|
|
2583
|
+
class Login extends Component {
|
|
2584
|
+
constructor(...args) {
|
|
2585
|
+
var _this;
|
|
2586
|
+
|
|
2587
|
+
super(...args);
|
|
2588
|
+
_this = this;
|
|
2589
|
+
|
|
2590
|
+
defineProperty(this, "handleClick",
|
|
2591
|
+
/*#__PURE__*/
|
|
2592
|
+
function () {
|
|
2593
|
+
var _ref = asyncToGenerator(function* (evn) {
|
|
2594
|
+
evn.preventDefault();
|
|
2595
|
+
const {
|
|
2596
|
+
handleProcess,
|
|
2597
|
+
onCompleted,
|
|
2598
|
+
onError,
|
|
2599
|
+
onSuccess
|
|
2600
|
+
} = _this.props;
|
|
2601
|
+
|
|
2602
|
+
try {
|
|
2603
|
+
yield handleProcess(
|
|
2604
|
+
/*#__PURE__*/
|
|
2605
|
+
function () {
|
|
2606
|
+
var _ref2 = asyncToGenerator(function* (api) {
|
|
2607
|
+
const {
|
|
2608
|
+
scope,
|
|
2609
|
+
fields,
|
|
2610
|
+
returnScopes,
|
|
2611
|
+
rerequest,
|
|
2612
|
+
reauthorize,
|
|
2613
|
+
eventKey
|
|
2614
|
+
} = _this.props;
|
|
2615
|
+
const loginQpts = {
|
|
2616
|
+
scope
|
|
2617
|
+
};
|
|
2618
|
+
const authType = [];
|
|
2619
|
+
|
|
2620
|
+
if (returnScopes) {
|
|
2621
|
+
loginQpts.return_scopes = true;
|
|
2622
|
+
}
|
|
2623
|
+
|
|
2624
|
+
if (rerequest) {
|
|
2625
|
+
authType.push('rerequest');
|
|
2626
|
+
}
|
|
2627
|
+
|
|
2628
|
+
if (reauthorize) {
|
|
2629
|
+
authType.push('reauthenticate');
|
|
2630
|
+
}
|
|
2631
|
+
|
|
2632
|
+
if (authType.length) {
|
|
2633
|
+
loginQpts.auth_type = authType.join(',');
|
|
2634
|
+
}
|
|
2635
|
+
|
|
2636
|
+
const loginResponse = yield api.login(loginQpts);
|
|
2637
|
+
|
|
2638
|
+
if (loginResponse.status !== 'connected') {
|
|
2639
|
+
throw new Error('Unauthorized user');
|
|
2640
|
+
}
|
|
2641
|
+
|
|
2642
|
+
const data = yield api.getTokenDetailWithProfile({
|
|
2643
|
+
fields
|
|
2644
|
+
}, loginResponse);
|
|
2645
|
+
|
|
2646
|
+
if (onCompleted) {
|
|
2647
|
+
yield onCompleted(_objectSpread$2({}, data, {
|
|
2648
|
+
eventKey
|
|
2649
|
+
}));
|
|
2650
|
+
}
|
|
2651
|
+
|
|
2652
|
+
return data;
|
|
2653
|
+
});
|
|
2654
|
+
|
|
2655
|
+
return function (_x2) {
|
|
2656
|
+
return _ref2.apply(this, arguments);
|
|
2657
|
+
};
|
|
2658
|
+
}(), onSuccess);
|
|
2659
|
+
} catch (error) {
|
|
2660
|
+
if (onError) {
|
|
2661
|
+
onError(error);
|
|
2662
|
+
}
|
|
2663
|
+
}
|
|
2664
|
+
});
|
|
2665
|
+
|
|
2666
|
+
return function (_x) {
|
|
2667
|
+
return _ref.apply(this, arguments);
|
|
2668
|
+
};
|
|
2669
|
+
}());
|
|
2670
|
+
}
|
|
2671
|
+
|
|
2672
|
+
render() {
|
|
2673
|
+
const {
|
|
2674
|
+
children,
|
|
2675
|
+
loading,
|
|
2676
|
+
error,
|
|
2677
|
+
data
|
|
2678
|
+
} = this.props;
|
|
2679
|
+
return children({
|
|
2680
|
+
loading,
|
|
2681
|
+
handleClick: this.handleClick,
|
|
2682
|
+
error,
|
|
2683
|
+
data
|
|
2684
|
+
});
|
|
2685
|
+
}
|
|
2686
|
+
|
|
2687
|
+
}
|
|
2688
|
+
|
|
2689
|
+
defineProperty(Login, "defaultProps", {
|
|
2690
|
+
scope: '',
|
|
2691
|
+
fields: Fields,
|
|
2692
|
+
returnScopes: false,
|
|
2693
|
+
rerequest: false,
|
|
2694
|
+
reauthorize: false,
|
|
2695
|
+
onCompleted: undefined,
|
|
2696
|
+
onError: undefined,
|
|
2697
|
+
eventKey: undefined
|
|
2698
|
+
});
|
|
2699
|
+
|
|
2700
|
+
var Login$1 = forwardRef((props, ref) => React__default.createElement(Process, null, ({
|
|
2701
|
+
loading,
|
|
2702
|
+
handleProcess,
|
|
2703
|
+
data,
|
|
2704
|
+
error
|
|
2705
|
+
}) => React__default.createElement(Login, _extends_1({}, props, {
|
|
2706
|
+
loading: loading,
|
|
2707
|
+
handleProcess: handleProcess,
|
|
2708
|
+
data: data,
|
|
2709
|
+
error: error,
|
|
2710
|
+
ref: ref
|
|
2711
|
+
}))));
|
|
2712
|
+
|
|
2713
|
+
var spin = createCommonjsModule(function (module) {
|
|
2714
|
+
(function (root, factory) {
|
|
2715
|
+
|
|
2716
|
+
/* CommonJS */
|
|
2717
|
+
if ( module.exports) module.exports = factory();
|
|
2718
|
+
|
|
2719
|
+
/* AMD module */
|
|
2720
|
+
else root.Spinner = factory();
|
|
2721
|
+
}(commonjsGlobal, function () {
|
|
2722
|
+
|
|
2723
|
+
var prefixes = ['webkit', 'Moz', 'ms', 'O'] /* Vendor prefixes */
|
|
2724
|
+
, animations = {} /* Animation rules keyed by their name */
|
|
2725
|
+
, useCssAnimations /* Whether to use CSS animations or setTimeout */
|
|
2726
|
+
, sheet; /* A stylesheet to hold the @keyframe or VML rules. */
|
|
2727
|
+
|
|
2728
|
+
/**
|
|
2729
|
+
* Utility function to create elements. If no tag name is given,
|
|
2730
|
+
* a DIV is created. Optionally properties can be passed.
|
|
2731
|
+
*/
|
|
2732
|
+
function createEl (tag, prop) {
|
|
2733
|
+
var el = document.createElement(tag || 'div')
|
|
2734
|
+
, n;
|
|
2735
|
+
|
|
2736
|
+
for (n in prop) el[n] = prop[n];
|
|
2737
|
+
return el
|
|
2738
|
+
}
|
|
2739
|
+
|
|
2740
|
+
/**
|
|
2741
|
+
* Appends children and returns the parent.
|
|
2742
|
+
*/
|
|
2743
|
+
function ins (parent /* child1, child2, ...*/) {
|
|
2744
|
+
for (var i = 1, n = arguments.length; i < n; i++) {
|
|
2745
|
+
parent.appendChild(arguments[i]);
|
|
2746
|
+
}
|
|
2747
|
+
|
|
2748
|
+
return parent
|
|
2749
|
+
}
|
|
2750
|
+
|
|
2751
|
+
/**
|
|
2752
|
+
* Creates an opacity keyframe animation rule and returns its name.
|
|
2753
|
+
* Since most mobile Webkits have timing issues with animation-delay,
|
|
2754
|
+
* we create separate rules for each line/segment.
|
|
2755
|
+
*/
|
|
2756
|
+
function addAnimation (alpha, trail, i, lines) {
|
|
2757
|
+
var name = ['opacity', trail, ~~(alpha * 100), i, lines].join('-')
|
|
2758
|
+
, start = 0.01 + i/lines * 100
|
|
2759
|
+
, z = Math.max(1 - (1-alpha) / trail * (100-start), alpha)
|
|
2760
|
+
, prefix = useCssAnimations.substring(0, useCssAnimations.indexOf('Animation')).toLowerCase()
|
|
2761
|
+
, pre = prefix && '-' + prefix + '-' || '';
|
|
2762
|
+
|
|
2763
|
+
if (!animations[name]) {
|
|
2764
|
+
sheet.insertRule(
|
|
2765
|
+
'@' + pre + 'keyframes ' + name + '{' +
|
|
2766
|
+
'0%{opacity:' + z + '}' +
|
|
2767
|
+
start + '%{opacity:' + alpha + '}' +
|
|
2768
|
+
(start+0.01) + '%{opacity:1}' +
|
|
2769
|
+
(start+trail) % 100 + '%{opacity:' + alpha + '}' +
|
|
2770
|
+
'100%{opacity:' + z + '}' +
|
|
2771
|
+
'}', sheet.cssRules.length);
|
|
2772
|
+
|
|
2773
|
+
animations[name] = 1;
|
|
2774
|
+
}
|
|
2775
|
+
|
|
2776
|
+
return name
|
|
2777
|
+
}
|
|
2778
|
+
|
|
2779
|
+
/**
|
|
2780
|
+
* Tries various vendor prefixes and returns the first supported property.
|
|
2781
|
+
*/
|
|
2782
|
+
function vendor (el, prop) {
|
|
2783
|
+
var s = el.style
|
|
2784
|
+
, pp
|
|
2785
|
+
, i;
|
|
2786
|
+
|
|
2787
|
+
prop = prop.charAt(0).toUpperCase() + prop.slice(1);
|
|
2788
|
+
if (s[prop] !== undefined) return prop
|
|
2789
|
+
for (i = 0; i < prefixes.length; i++) {
|
|
2790
|
+
pp = prefixes[i]+prop;
|
|
2791
|
+
if (s[pp] !== undefined) return pp
|
|
2792
|
+
}
|
|
2793
|
+
}
|
|
2794
|
+
|
|
2795
|
+
/**
|
|
2796
|
+
* Sets multiple style properties at once.
|
|
2797
|
+
*/
|
|
2798
|
+
function css (el, prop) {
|
|
2799
|
+
for (var n in prop) {
|
|
2800
|
+
el.style[vendor(el, n) || n] = prop[n];
|
|
2801
|
+
}
|
|
2802
|
+
|
|
2803
|
+
return el
|
|
2804
|
+
}
|
|
2805
|
+
|
|
2806
|
+
/**
|
|
2807
|
+
* Fills in default values.
|
|
2808
|
+
*/
|
|
2809
|
+
function merge (obj) {
|
|
2810
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2811
|
+
var def = arguments[i];
|
|
2812
|
+
for (var n in def) {
|
|
2813
|
+
if (obj[n] === undefined) obj[n] = def[n];
|
|
2814
|
+
}
|
|
2815
|
+
}
|
|
2816
|
+
return obj
|
|
2817
|
+
}
|
|
2818
|
+
|
|
2819
|
+
/**
|
|
2820
|
+
* Returns the line color from the given string or array.
|
|
2821
|
+
*/
|
|
2822
|
+
function getColor (color, idx) {
|
|
2823
|
+
return typeof color == 'string' ? color : color[idx % color.length]
|
|
2824
|
+
}
|
|
2825
|
+
|
|
2826
|
+
// Built-in defaults
|
|
2827
|
+
|
|
2828
|
+
var defaults = {
|
|
2829
|
+
lines: 12 // The number of lines to draw
|
|
2830
|
+
, length: 7 // The length of each line
|
|
2831
|
+
, width: 5 // The line thickness
|
|
2832
|
+
, radius: 10 // The radius of the inner circle
|
|
2833
|
+
, scale: 1.0 // Scales overall size of the spinner
|
|
2834
|
+
, corners: 1 // Roundness (0..1)
|
|
2835
|
+
, color: '#000' // #rgb or #rrggbb
|
|
2836
|
+
, opacity: 1/4 // Opacity of the lines
|
|
2837
|
+
, rotate: 0 // Rotation offset
|
|
2838
|
+
, direction: 1 // 1: clockwise, -1: counterclockwise
|
|
2839
|
+
, speed: 1 // Rounds per second
|
|
2840
|
+
, trail: 100 // Afterglow percentage
|
|
2841
|
+
, fps: 20 // Frames per second when using setTimeout()
|
|
2842
|
+
, zIndex: 2e9 // Use a high z-index by default
|
|
2843
|
+
, className: 'spinner' // CSS class to assign to the element
|
|
2844
|
+
, top: '50%' // center vertically
|
|
2845
|
+
, left: '50%' // center horizontally
|
|
2846
|
+
, shadow: false // Whether to render a shadow
|
|
2847
|
+
, hwaccel: false // Whether to use hardware acceleration (might be buggy)
|
|
2848
|
+
, position: 'absolute' // Element positioning
|
|
2849
|
+
};
|
|
2850
|
+
|
|
2851
|
+
/** The constructor */
|
|
2852
|
+
function Spinner (o) {
|
|
2853
|
+
this.opts = merge(o || {}, Spinner.defaults, defaults);
|
|
2854
|
+
}
|
|
2855
|
+
|
|
2856
|
+
// Global defaults that override the built-ins:
|
|
2857
|
+
Spinner.defaults = {};
|
|
2858
|
+
|
|
2859
|
+
merge(Spinner.prototype, {
|
|
2860
|
+
/**
|
|
2861
|
+
* Adds the spinner to the given target element. If this instance is already
|
|
2862
|
+
* spinning, it is automatically removed from its previous target b calling
|
|
2863
|
+
* stop() internally.
|
|
2864
|
+
*/
|
|
2865
|
+
spin: function (target) {
|
|
2866
|
+
this.stop();
|
|
2867
|
+
|
|
2868
|
+
var self = this
|
|
2869
|
+
, o = self.opts
|
|
2870
|
+
, el = self.el = createEl(null, {className: o.className});
|
|
2871
|
+
|
|
2872
|
+
css(el, {
|
|
2873
|
+
position: o.position
|
|
2874
|
+
, width: 0
|
|
2875
|
+
, zIndex: o.zIndex
|
|
2876
|
+
, left: o.left
|
|
2877
|
+
, top: o.top
|
|
2878
|
+
});
|
|
2879
|
+
|
|
2880
|
+
if (target) {
|
|
2881
|
+
target.insertBefore(el, target.firstChild || null);
|
|
2882
|
+
}
|
|
2883
|
+
|
|
2884
|
+
el.setAttribute('role', 'progressbar');
|
|
2885
|
+
self.lines(el, self.opts);
|
|
2886
|
+
|
|
2887
|
+
if (!useCssAnimations) {
|
|
2888
|
+
// No CSS animation support, use setTimeout() instead
|
|
2889
|
+
var i = 0
|
|
2890
|
+
, start = (o.lines - 1) * (1 - o.direction) / 2
|
|
2891
|
+
, alpha
|
|
2892
|
+
, fps = o.fps
|
|
2893
|
+
, f = fps / o.speed
|
|
2894
|
+
, ostep = (1 - o.opacity) / (f * o.trail / 100)
|
|
2895
|
+
, astep = f / o.lines
|
|
2896
|
+
|
|
2897
|
+
;(function anim () {
|
|
2898
|
+
i++;
|
|
2899
|
+
for (var j = 0; j < o.lines; j++) {
|
|
2900
|
+
alpha = Math.max(1 - (i + (o.lines - j) * astep) % f * ostep, o.opacity);
|
|
2901
|
+
|
|
2902
|
+
self.opacity(el, j * o.direction + start, alpha, o);
|
|
2903
|
+
}
|
|
2904
|
+
self.timeout = self.el && setTimeout(anim, ~~(1000 / fps));
|
|
2905
|
+
})();
|
|
2906
|
+
}
|
|
2907
|
+
return self
|
|
2908
|
+
}
|
|
2909
|
+
|
|
2910
|
+
/**
|
|
2911
|
+
* Stops and removes the Spinner.
|
|
2912
|
+
*/
|
|
2913
|
+
, stop: function () {
|
|
2914
|
+
var el = this.el;
|
|
2915
|
+
if (el) {
|
|
2916
|
+
clearTimeout(this.timeout);
|
|
2917
|
+
if (el.parentNode) el.parentNode.removeChild(el);
|
|
2918
|
+
this.el = undefined;
|
|
2919
|
+
}
|
|
2920
|
+
return this
|
|
2921
|
+
}
|
|
2922
|
+
|
|
2923
|
+
/**
|
|
2924
|
+
* Internal method that draws the individual lines. Will be overwritten
|
|
2925
|
+
* in VML fallback mode below.
|
|
2926
|
+
*/
|
|
2927
|
+
, lines: function (el, o) {
|
|
2928
|
+
var i = 0
|
|
2929
|
+
, start = (o.lines - 1) * (1 - o.direction) / 2
|
|
2930
|
+
, seg;
|
|
2931
|
+
|
|
2932
|
+
function fill (color, shadow) {
|
|
2933
|
+
return css(createEl(), {
|
|
2934
|
+
position: 'absolute'
|
|
2935
|
+
, width: o.scale * (o.length + o.width) + 'px'
|
|
2936
|
+
, height: o.scale * o.width + 'px'
|
|
2937
|
+
, background: color
|
|
2938
|
+
, boxShadow: shadow
|
|
2939
|
+
, transformOrigin: 'left'
|
|
2940
|
+
, transform: 'rotate(' + ~~(360/o.lines*i + o.rotate) + 'deg) translate(' + o.scale*o.radius + 'px' + ',0)'
|
|
2941
|
+
, borderRadius: (o.corners * o.scale * o.width >> 1) + 'px'
|
|
2942
|
+
})
|
|
2943
|
+
}
|
|
2944
|
+
|
|
2945
|
+
for (; i < o.lines; i++) {
|
|
2946
|
+
seg = css(createEl(), {
|
|
2947
|
+
position: 'absolute'
|
|
2948
|
+
, top: 1 + ~(o.scale * o.width / 2) + 'px'
|
|
2949
|
+
, transform: o.hwaccel ? 'translate3d(0,0,0)' : ''
|
|
2950
|
+
, opacity: o.opacity
|
|
2951
|
+
, animation: useCssAnimations && addAnimation(o.opacity, o.trail, start + i * o.direction, o.lines) + ' ' + 1 / o.speed + 's linear infinite'
|
|
2952
|
+
});
|
|
2953
|
+
|
|
2954
|
+
if (o.shadow) ins(seg, css(fill('#000', '0 0 4px #000'), {top: '2px'}));
|
|
2955
|
+
ins(el, ins(seg, fill(getColor(o.color, i), '0 0 1px rgba(0,0,0,.1)')));
|
|
2956
|
+
}
|
|
2957
|
+
return el
|
|
2958
|
+
}
|
|
2959
|
+
|
|
2960
|
+
/**
|
|
2961
|
+
* Internal method that adjusts the opacity of a single line.
|
|
2962
|
+
* Will be overwritten in VML fallback mode below.
|
|
2963
|
+
*/
|
|
2964
|
+
, opacity: function (el, i, val) {
|
|
2965
|
+
if (i < el.childNodes.length) el.childNodes[i].style.opacity = val;
|
|
2966
|
+
}
|
|
2967
|
+
|
|
2968
|
+
});
|
|
2969
|
+
|
|
2970
|
+
|
|
2971
|
+
function initVML () {
|
|
2972
|
+
|
|
2973
|
+
/* Utility function to create a VML tag */
|
|
2974
|
+
function vml (tag, attr) {
|
|
2975
|
+
return createEl('<' + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr)
|
|
2976
|
+
}
|
|
2977
|
+
|
|
2978
|
+
// No CSS transforms but VML support, add a CSS rule for VML elements:
|
|
2979
|
+
sheet.addRule('.spin-vml', 'behavior:url(#default#VML)');
|
|
2980
|
+
|
|
2981
|
+
Spinner.prototype.lines = function (el, o) {
|
|
2982
|
+
var r = o.scale * (o.length + o.width)
|
|
2983
|
+
, s = o.scale * 2 * r;
|
|
2984
|
+
|
|
2985
|
+
function grp () {
|
|
2986
|
+
return css(
|
|
2987
|
+
vml('group', {
|
|
2988
|
+
coordsize: s + ' ' + s
|
|
2989
|
+
, coordorigin: -r + ' ' + -r
|
|
2990
|
+
})
|
|
2991
|
+
, { width: s, height: s }
|
|
2992
|
+
)
|
|
2993
|
+
}
|
|
2994
|
+
|
|
2995
|
+
var margin = -(o.width + o.length) * o.scale * 2 + 'px'
|
|
2996
|
+
, g = css(grp(), {position: 'absolute', top: margin, left: margin})
|
|
2997
|
+
, i;
|
|
2998
|
+
|
|
2999
|
+
function seg (i, dx, filter) {
|
|
3000
|
+
ins(
|
|
3001
|
+
g
|
|
3002
|
+
, ins(
|
|
3003
|
+
css(grp(), {rotation: 360 / o.lines * i + 'deg', left: ~~dx})
|
|
3004
|
+
, ins(
|
|
3005
|
+
css(
|
|
3006
|
+
vml('roundrect', {arcsize: o.corners})
|
|
3007
|
+
, { width: r
|
|
3008
|
+
, height: o.scale * o.width
|
|
3009
|
+
, left: o.scale * o.radius
|
|
3010
|
+
, top: -o.scale * o.width >> 1
|
|
3011
|
+
, filter: filter
|
|
3012
|
+
}
|
|
3013
|
+
)
|
|
3014
|
+
, vml('fill', {color: getColor(o.color, i), opacity: o.opacity})
|
|
3015
|
+
, vml('stroke', {opacity: 0}) // transparent stroke to fix color bleeding upon opacity change
|
|
3016
|
+
)
|
|
3017
|
+
)
|
|
3018
|
+
);
|
|
3019
|
+
}
|
|
3020
|
+
|
|
3021
|
+
if (o.shadow)
|
|
3022
|
+
for (i = 1; i <= o.lines; i++) {
|
|
3023
|
+
seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)');
|
|
3024
|
+
}
|
|
3025
|
+
|
|
3026
|
+
for (i = 1; i <= o.lines; i++) seg(i);
|
|
3027
|
+
return ins(el, g)
|
|
3028
|
+
};
|
|
3029
|
+
|
|
3030
|
+
Spinner.prototype.opacity = function (el, i, val, o) {
|
|
3031
|
+
var c = el.firstChild;
|
|
3032
|
+
o = o.shadow && o.lines || 0;
|
|
3033
|
+
if (c && i + o < c.childNodes.length) {
|
|
3034
|
+
c = c.childNodes[i + o]; c = c && c.firstChild; c = c && c.firstChild;
|
|
3035
|
+
if (c) c.opacity = val;
|
|
3036
|
+
}
|
|
3037
|
+
};
|
|
3038
|
+
}
|
|
3039
|
+
|
|
3040
|
+
if (typeof document !== 'undefined') {
|
|
3041
|
+
sheet = (function () {
|
|
3042
|
+
var el = createEl('style', {type : 'text/css'});
|
|
3043
|
+
ins(document.getElementsByTagName('head')[0], el);
|
|
3044
|
+
return el.sheet || el.styleSheet
|
|
3045
|
+
}());
|
|
3046
|
+
|
|
3047
|
+
var probe = css(createEl('group'), {behavior: 'url(#default#VML)'});
|
|
3048
|
+
|
|
3049
|
+
if (!vendor(probe, 'transform') && probe.adj) initVML();
|
|
3050
|
+
else useCssAnimations = vendor(probe, 'animation');
|
|
3051
|
+
}
|
|
3052
|
+
|
|
3053
|
+
return Spinner
|
|
3054
|
+
|
|
3055
|
+
}));
|
|
3056
|
+
});
|
|
3057
|
+
|
|
3058
|
+
var dist = createCommonjsModule(function (module, exports) {
|
|
3059
|
+
|
|
3060
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3061
|
+
value: true
|
|
3062
|
+
});
|
|
3063
|
+
|
|
3064
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
3065
|
+
|
|
3066
|
+
|
|
3067
|
+
|
|
3068
|
+
var _react2 = _interopRequireDefault(React__default);
|
|
3069
|
+
|
|
3070
|
+
|
|
3071
|
+
|
|
3072
|
+
var _propTypes2 = _interopRequireDefault(PropTypes);
|
|
3073
|
+
|
|
3074
|
+
|
|
3075
|
+
|
|
3076
|
+
var _spin2 = _interopRequireDefault(spin);
|
|
3077
|
+
|
|
3078
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
3079
|
+
|
|
3080
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3081
|
+
|
|
3082
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
3083
|
+
|
|
3084
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
3085
|
+
|
|
3086
|
+
var Spinner = function (_Component) {
|
|
3087
|
+
_inherits(Spinner, _Component);
|
|
3088
|
+
|
|
3089
|
+
function Spinner() {
|
|
3090
|
+
_classCallCheck(this, Spinner);
|
|
3091
|
+
|
|
3092
|
+
return _possibleConstructorReturn(this, (Spinner.__proto__ || Object.getPrototypeOf(Spinner)).apply(this, arguments));
|
|
3093
|
+
}
|
|
3094
|
+
|
|
3095
|
+
_createClass(Spinner, [{
|
|
3096
|
+
key: 'componentDidMount',
|
|
3097
|
+
value: function componentDidMount() {
|
|
3098
|
+
this.updateSpinner();
|
|
3099
|
+
}
|
|
3100
|
+
}, {
|
|
3101
|
+
key: 'componentDidUpdate',
|
|
3102
|
+
value: function componentDidUpdate() {
|
|
3103
|
+
this.updateSpinner();
|
|
3104
|
+
}
|
|
3105
|
+
}, {
|
|
3106
|
+
key: 'componentWillUnmount',
|
|
3107
|
+
value: function componentWillUnmount() {
|
|
3108
|
+
if (this.spinner) {
|
|
3109
|
+
this.spinner.stop();
|
|
3110
|
+
this.spinner = null;
|
|
3111
|
+
}
|
|
3112
|
+
}
|
|
3113
|
+
}, {
|
|
3114
|
+
key: 'updateSpinner',
|
|
3115
|
+
value: function updateSpinner() {
|
|
3116
|
+
var loaded = this.props.loaded;
|
|
3117
|
+
|
|
3118
|
+
if (!loaded && !this.spinner) {
|
|
3119
|
+
this.spinner = new _spin2.default(this.props.config);
|
|
3120
|
+
this.spinner.spin(this.refs.loader);
|
|
3121
|
+
} else if (loaded && this.spinner) {
|
|
3122
|
+
this.spinner.stop();
|
|
3123
|
+
this.spinner = null;
|
|
3124
|
+
}
|
|
3125
|
+
}
|
|
3126
|
+
}, {
|
|
3127
|
+
key: 'render',
|
|
3128
|
+
value: function render() {
|
|
3129
|
+
var _props = this.props,
|
|
3130
|
+
loaded = _props.loaded,
|
|
3131
|
+
className = _props.className;
|
|
3132
|
+
|
|
3133
|
+
|
|
3134
|
+
if (loaded) {
|
|
3135
|
+
return this.props.children ? React__default.Children.only(this.props.children) : null;
|
|
3136
|
+
}
|
|
3137
|
+
|
|
3138
|
+
return _react2.default.createElement('div', { className: className, ref: 'loader' });
|
|
3139
|
+
}
|
|
3140
|
+
}]);
|
|
3141
|
+
|
|
3142
|
+
return Spinner;
|
|
3143
|
+
}(React__default.Component);
|
|
3144
|
+
|
|
3145
|
+
Spinner.propTypes = {
|
|
3146
|
+
className: _propTypes2.default.string,
|
|
3147
|
+
config: _propTypes2.default.object.isRequired,
|
|
3148
|
+
loaded: _propTypes2.default.bool.isRequired,
|
|
3149
|
+
children: _propTypes2.default.node
|
|
3150
|
+
};
|
|
3151
|
+
Spinner.defaultProps = {
|
|
3152
|
+
config: {},
|
|
3153
|
+
loaded: false,
|
|
3154
|
+
className: 'loader'
|
|
3155
|
+
};
|
|
3156
|
+
exports.default = Spinner;
|
|
3157
|
+
});
|
|
3158
|
+
|
|
3159
|
+
var Spinner = unwrapExports(dist);
|
|
3160
|
+
|
|
3161
|
+
function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
3162
|
+
|
|
3163
|
+
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$3(source, true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$3(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
3164
|
+
function LoginButton(props) {
|
|
3165
|
+
const {
|
|
3166
|
+
children,
|
|
3167
|
+
className,
|
|
3168
|
+
spinner,
|
|
3169
|
+
spinnerConfig
|
|
3170
|
+
} = props,
|
|
3171
|
+
rest = objectWithoutProperties(props, ["children", "className", "spinner", "spinnerConfig"]);
|
|
3172
|
+
|
|
3173
|
+
return React__default.createElement(Login$1, rest, ({
|
|
3174
|
+
loading,
|
|
3175
|
+
handleClick
|
|
3176
|
+
}) => React__default.createElement("button", {
|
|
3177
|
+
type: "button",
|
|
3178
|
+
className: className,
|
|
3179
|
+
onClick: handleClick,
|
|
3180
|
+
disabled: loading
|
|
3181
|
+
}, children, spinner && loading && React__default.createElement(Spinner, {
|
|
3182
|
+
config: spinnerConfig
|
|
3183
|
+
})));
|
|
3184
|
+
}
|
|
3185
|
+
LoginButton.defaultProps = _objectSpread$3({}, Login$1.defaultProps, {
|
|
3186
|
+
className: undefined,
|
|
3187
|
+
spinnerConfig: {},
|
|
3188
|
+
spinner: true
|
|
3189
|
+
});
|
|
3190
|
+
|
|
3191
|
+
class EmbeddedPost extends PureComponent {
|
|
3192
|
+
componentDidUpdate() {
|
|
3193
|
+
const {
|
|
3194
|
+
handleParse
|
|
3195
|
+
} = this.props;
|
|
3196
|
+
handleParse();
|
|
3197
|
+
}
|
|
3198
|
+
|
|
3199
|
+
render() {
|
|
3200
|
+
const {
|
|
3201
|
+
href,
|
|
3202
|
+
width,
|
|
3203
|
+
showText,
|
|
3204
|
+
children
|
|
3205
|
+
} = this.props;
|
|
3206
|
+
return React__default.createElement("div", {
|
|
3207
|
+
className: "fb-post",
|
|
3208
|
+
"data-href": href,
|
|
3209
|
+
"data-width": width,
|
|
3210
|
+
"data-show-text": showText
|
|
3211
|
+
}, children);
|
|
3212
|
+
}
|
|
3213
|
+
|
|
3214
|
+
}
|
|
3215
|
+
|
|
3216
|
+
defineProperty(EmbeddedPost, "defaultProps", {
|
|
3217
|
+
width: undefined,
|
|
3218
|
+
showText: undefined,
|
|
3219
|
+
children: undefined
|
|
3220
|
+
});
|
|
3221
|
+
|
|
3222
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3223
|
+
handleParse
|
|
3224
|
+
}) => React__default.createElement(EmbeddedPost, _extends_1({}, props, {
|
|
3225
|
+
handleParse: handleParse,
|
|
3226
|
+
ref: ref
|
|
3227
|
+
}))));
|
|
3228
|
+
|
|
3229
|
+
class EmbeddedVideo extends PureComponent {
|
|
3230
|
+
componentDidUpdate() {
|
|
3231
|
+
const {
|
|
3232
|
+
handleParse
|
|
3233
|
+
} = this.props;
|
|
3234
|
+
handleParse();
|
|
3235
|
+
}
|
|
3236
|
+
|
|
3237
|
+
render() {
|
|
3238
|
+
const {
|
|
3239
|
+
href,
|
|
3240
|
+
width,
|
|
3241
|
+
showText,
|
|
3242
|
+
allowFullScreen,
|
|
3243
|
+
autoPlay,
|
|
3244
|
+
showCaptions,
|
|
3245
|
+
children
|
|
3246
|
+
} = this.props;
|
|
3247
|
+
return React__default.createElement("div", {
|
|
3248
|
+
className: "fb-video",
|
|
3249
|
+
"data-href": href,
|
|
3250
|
+
"data-width": width,
|
|
3251
|
+
"data-show-text": showText,
|
|
3252
|
+
"data-show-captions": showCaptions,
|
|
3253
|
+
"data-autoplay": autoPlay,
|
|
3254
|
+
"data-allowfullscreen": allowFullScreen
|
|
3255
|
+
}, children);
|
|
3256
|
+
}
|
|
3257
|
+
|
|
3258
|
+
}
|
|
3259
|
+
|
|
3260
|
+
defineProperty(EmbeddedVideo, "defaultProps", {
|
|
3261
|
+
width: undefined,
|
|
3262
|
+
showText: undefined,
|
|
3263
|
+
allowFullScreen: undefined,
|
|
3264
|
+
autoPlay: undefined,
|
|
3265
|
+
showCaptions: undefined,
|
|
3266
|
+
children: undefined
|
|
3267
|
+
});
|
|
3268
|
+
|
|
3269
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3270
|
+
handleParse
|
|
3271
|
+
}) => React__default.createElement(EmbeddedVideo, _extends_1({}, props, {
|
|
3272
|
+
handleParse: handleParse,
|
|
3273
|
+
ref: ref
|
|
3274
|
+
}))));
|
|
3275
|
+
|
|
3276
|
+
class Comments extends PureComponent {
|
|
3277
|
+
componentDidUpdate() {
|
|
3278
|
+
const {
|
|
3279
|
+
handleParse
|
|
3280
|
+
} = this.props;
|
|
3281
|
+
handleParse();
|
|
3282
|
+
}
|
|
3283
|
+
|
|
3284
|
+
render() {
|
|
3285
|
+
const {
|
|
3286
|
+
colorScheme,
|
|
3287
|
+
href = getCurrentHref(),
|
|
3288
|
+
numPosts,
|
|
3289
|
+
orderBy,
|
|
3290
|
+
width,
|
|
3291
|
+
children,
|
|
3292
|
+
mobile
|
|
3293
|
+
} = this.props;
|
|
3294
|
+
return React__default.createElement("div", {
|
|
3295
|
+
className: "fb-comments",
|
|
3296
|
+
"data-colorscheme": colorScheme,
|
|
3297
|
+
"data-numposts": numPosts,
|
|
3298
|
+
"data-href": href,
|
|
3299
|
+
"data-order-by": orderBy,
|
|
3300
|
+
"data-width": width,
|
|
3301
|
+
"data-skin": colorScheme,
|
|
3302
|
+
"data-mobile": mobile
|
|
3303
|
+
}, children);
|
|
3304
|
+
}
|
|
3305
|
+
|
|
3306
|
+
}
|
|
3307
|
+
|
|
3308
|
+
defineProperty(Comments, "defaultProps", {
|
|
3309
|
+
href: undefined,
|
|
3310
|
+
numPosts: undefined,
|
|
3311
|
+
orderBy: undefined,
|
|
3312
|
+
width: undefined,
|
|
3313
|
+
colorScheme: undefined,
|
|
3314
|
+
children: undefined,
|
|
3315
|
+
mobile: undefined
|
|
3316
|
+
});
|
|
3317
|
+
|
|
3318
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3319
|
+
handleParse
|
|
3320
|
+
}) => React__default.createElement(Comments, _extends_1({}, props, {
|
|
3321
|
+
handleParse: handleParse,
|
|
3322
|
+
ref: ref
|
|
3323
|
+
}))));
|
|
3324
|
+
|
|
3325
|
+
class CommentsCount extends PureComponent {
|
|
3326
|
+
componentDidUpdate() {
|
|
3327
|
+
const {
|
|
3328
|
+
handleParse
|
|
3329
|
+
} = this.props;
|
|
3330
|
+
handleParse();
|
|
3331
|
+
}
|
|
3332
|
+
|
|
3333
|
+
render() {
|
|
3334
|
+
const {
|
|
3335
|
+
href = getCurrentHref(),
|
|
3336
|
+
children
|
|
3337
|
+
} = this.props;
|
|
3338
|
+
return React__default.createElement("span", {
|
|
3339
|
+
className: "fb-comments-count",
|
|
3340
|
+
"data-href": href
|
|
3341
|
+
}, children);
|
|
3342
|
+
}
|
|
3343
|
+
|
|
3344
|
+
}
|
|
3345
|
+
|
|
3346
|
+
defineProperty(CommentsCount, "defaultProps", {
|
|
3347
|
+
href: undefined,
|
|
3348
|
+
children: undefined
|
|
3349
|
+
});
|
|
3350
|
+
|
|
3351
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3352
|
+
handleParse
|
|
3353
|
+
}) => React__default.createElement(CommentsCount, _extends_1({}, props, {
|
|
3354
|
+
handleParse: handleParse,
|
|
3355
|
+
ref: ref
|
|
3356
|
+
}))));
|
|
3357
|
+
|
|
3358
|
+
class Feed extends Component {
|
|
3359
|
+
constructor(...args) {
|
|
3360
|
+
var _this;
|
|
3361
|
+
|
|
3362
|
+
super(...args);
|
|
3363
|
+
_this = this;
|
|
3364
|
+
|
|
3365
|
+
defineProperty(this, "handleClick",
|
|
3366
|
+
/*#__PURE__*/
|
|
3367
|
+
function () {
|
|
3368
|
+
var _ref = asyncToGenerator(function* (evn) {
|
|
3369
|
+
evn.preventDefault();
|
|
3370
|
+
const {
|
|
3371
|
+
handleProcess
|
|
3372
|
+
} = _this.props;
|
|
3373
|
+
return handleProcess(
|
|
3374
|
+
/*#__PURE__*/
|
|
3375
|
+
function () {
|
|
3376
|
+
var _ref2 = asyncToGenerator(function* (api) {
|
|
3377
|
+
const {
|
|
3378
|
+
link = getCurrentHref(),
|
|
3379
|
+
display,
|
|
3380
|
+
appId = api.getAppId(),
|
|
3381
|
+
redirectURI,
|
|
3382
|
+
from,
|
|
3383
|
+
to,
|
|
3384
|
+
picture,
|
|
3385
|
+
source,
|
|
3386
|
+
name,
|
|
3387
|
+
caption,
|
|
3388
|
+
description,
|
|
3389
|
+
dataRef
|
|
3390
|
+
} = _this.props;
|
|
3391
|
+
return api.ui(clearUndefinedProperties({
|
|
3392
|
+
method: 'feed',
|
|
3393
|
+
link,
|
|
3394
|
+
display,
|
|
3395
|
+
app_id: appId,
|
|
3396
|
+
redirect_uri: redirectURI,
|
|
3397
|
+
from,
|
|
3398
|
+
to,
|
|
3399
|
+
picture,
|
|
3400
|
+
source,
|
|
3401
|
+
name,
|
|
3402
|
+
caption,
|
|
3403
|
+
description,
|
|
3404
|
+
ref: dataRef
|
|
3405
|
+
}));
|
|
3406
|
+
});
|
|
3407
|
+
|
|
3408
|
+
return function (_x2) {
|
|
3409
|
+
return _ref2.apply(this, arguments);
|
|
3410
|
+
};
|
|
3411
|
+
}());
|
|
3412
|
+
});
|
|
3413
|
+
|
|
3414
|
+
return function (_x) {
|
|
3415
|
+
return _ref.apply(this, arguments);
|
|
3416
|
+
};
|
|
3417
|
+
}());
|
|
3418
|
+
}
|
|
3419
|
+
|
|
3420
|
+
render() {
|
|
3421
|
+
const {
|
|
3422
|
+
children,
|
|
3423
|
+
loading,
|
|
3424
|
+
error,
|
|
3425
|
+
data
|
|
3426
|
+
} = this.props;
|
|
3427
|
+
return children({
|
|
3428
|
+
loading,
|
|
3429
|
+
handleClick: this.handleClick,
|
|
3430
|
+
error,
|
|
3431
|
+
data
|
|
3432
|
+
});
|
|
3433
|
+
}
|
|
3434
|
+
|
|
3435
|
+
}
|
|
3436
|
+
|
|
3437
|
+
defineProperty(Feed, "defaultProps", {
|
|
3438
|
+
link: undefined,
|
|
3439
|
+
display: undefined,
|
|
3440
|
+
appId: undefined,
|
|
3441
|
+
redirectURI: undefined,
|
|
3442
|
+
from: undefined,
|
|
3443
|
+
to: undefined,
|
|
3444
|
+
source: undefined,
|
|
3445
|
+
picture: undefined,
|
|
3446
|
+
name: undefined,
|
|
3447
|
+
caption: undefined,
|
|
3448
|
+
description: undefined,
|
|
3449
|
+
dataRef: undefined
|
|
3450
|
+
});
|
|
3451
|
+
|
|
3452
|
+
forwardRef((props, ref) => React__default.createElement(Process, null, ({
|
|
3453
|
+
loading,
|
|
3454
|
+
handleProcess,
|
|
3455
|
+
error,
|
|
3456
|
+
data
|
|
3457
|
+
}) => React__default.createElement(Feed, _extends_1({}, props, {
|
|
3458
|
+
loading: loading,
|
|
3459
|
+
handleProcess: handleProcess,
|
|
3460
|
+
data: data,
|
|
3461
|
+
error: error,
|
|
3462
|
+
ref: ref
|
|
3463
|
+
}))));
|
|
3464
|
+
|
|
3465
|
+
class Group extends PureComponent {
|
|
3466
|
+
componentDidUpdate() {
|
|
3467
|
+
const {
|
|
3468
|
+
handleParse
|
|
3469
|
+
} = this.props;
|
|
3470
|
+
handleParse();
|
|
3471
|
+
}
|
|
3472
|
+
|
|
3473
|
+
render() {
|
|
3474
|
+
const {
|
|
3475
|
+
style,
|
|
3476
|
+
href = getCurrentHref(),
|
|
3477
|
+
width,
|
|
3478
|
+
showSocialContext,
|
|
3479
|
+
showMetaData,
|
|
3480
|
+
children,
|
|
3481
|
+
skin
|
|
3482
|
+
} = this.props;
|
|
3483
|
+
return React__default.createElement("div", {
|
|
3484
|
+
className: "fb-group",
|
|
3485
|
+
style: style,
|
|
3486
|
+
"data-href": href,
|
|
3487
|
+
"data-width": width,
|
|
3488
|
+
"data-show-social-context": showSocialContext,
|
|
3489
|
+
"data-show-metadata": showMetaData,
|
|
3490
|
+
"data-skin": skin
|
|
3491
|
+
}, children);
|
|
3492
|
+
}
|
|
3493
|
+
|
|
3494
|
+
}
|
|
3495
|
+
|
|
3496
|
+
defineProperty(Group, "defaultProps", {
|
|
3497
|
+
showSocialContext: undefined,
|
|
3498
|
+
showMetaData: undefined,
|
|
3499
|
+
width: undefined,
|
|
3500
|
+
children: undefined,
|
|
3501
|
+
style: undefined,
|
|
3502
|
+
href: undefined,
|
|
3503
|
+
skin: undefined
|
|
3504
|
+
});
|
|
3505
|
+
|
|
3506
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3507
|
+
handleParse
|
|
3508
|
+
}) => React__default.createElement(Group, _extends_1({}, props, {
|
|
3509
|
+
handleParse: handleParse,
|
|
3510
|
+
ref: ref
|
|
3511
|
+
}))));
|
|
3512
|
+
|
|
3513
|
+
class LoginStatus$1 extends Component {
|
|
3514
|
+
constructor(..._args) {
|
|
3515
|
+
var _this;
|
|
3516
|
+
|
|
3517
|
+
super(..._args);
|
|
3518
|
+
_this = this;
|
|
3519
|
+
|
|
3520
|
+
defineProperty(this, "state", {});
|
|
3521
|
+
|
|
3522
|
+
defineProperty(this, "handleReady",
|
|
3523
|
+
/*#__PURE__*/
|
|
3524
|
+
function () {
|
|
3525
|
+
var _ref = asyncToGenerator(function* (api) {
|
|
3526
|
+
const {
|
|
3527
|
+
event
|
|
3528
|
+
} = _this.props;
|
|
3529
|
+
|
|
3530
|
+
_this.setState({
|
|
3531
|
+
api
|
|
3532
|
+
});
|
|
3533
|
+
|
|
3534
|
+
yield api.subscribe(event, _this.handleChange);
|
|
3535
|
+
});
|
|
3536
|
+
|
|
3537
|
+
return function (_x) {
|
|
3538
|
+
return _ref.apply(this, arguments);
|
|
3539
|
+
};
|
|
3540
|
+
}());
|
|
3541
|
+
|
|
3542
|
+
defineProperty(this, "handleChange", (...args) => {
|
|
3543
|
+
const {
|
|
3544
|
+
onChange
|
|
3545
|
+
} = this.props;
|
|
3546
|
+
|
|
3547
|
+
if (onChange) {
|
|
3548
|
+
onChange(...args);
|
|
3549
|
+
}
|
|
3550
|
+
});
|
|
3551
|
+
}
|
|
3552
|
+
|
|
3553
|
+
componentWillUnmount() {
|
|
3554
|
+
const {
|
|
3555
|
+
state: {
|
|
3556
|
+
api
|
|
3557
|
+
},
|
|
3558
|
+
props: {
|
|
3559
|
+
event
|
|
3560
|
+
}
|
|
3561
|
+
} = this;
|
|
3562
|
+
|
|
3563
|
+
if (api) {
|
|
3564
|
+
api.unsubscribe(event, this.handleChange);
|
|
3565
|
+
}
|
|
3566
|
+
}
|
|
3567
|
+
|
|
3568
|
+
render() {
|
|
3569
|
+
const {
|
|
3570
|
+
children
|
|
3571
|
+
} = this.props;
|
|
3572
|
+
return React__default.createElement(Initialize$1, {
|
|
3573
|
+
onReady: this.handleReady
|
|
3574
|
+
}, children);
|
|
3575
|
+
}
|
|
3576
|
+
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3579
|
+
defineProperty(LoginStatus$1, "defaultProps", {
|
|
3580
|
+
onChange: undefined
|
|
3581
|
+
});
|
|
3582
|
+
|
|
3583
|
+
class Profile extends Component {
|
|
3584
|
+
constructor(...args) {
|
|
3585
|
+
var _this;
|
|
3586
|
+
|
|
3587
|
+
super(...args);
|
|
3588
|
+
_this = this;
|
|
3589
|
+
|
|
3590
|
+
defineProperty(this, "state", {
|
|
3591
|
+
loading: true
|
|
3592
|
+
});
|
|
3593
|
+
|
|
3594
|
+
defineProperty(this, "handleReady",
|
|
3595
|
+
/*#__PURE__*/
|
|
3596
|
+
function () {
|
|
3597
|
+
var _ref = asyncToGenerator(function* (api) {
|
|
3598
|
+
_this.api = api;
|
|
3599
|
+
|
|
3600
|
+
_this.updateProfile();
|
|
3601
|
+
});
|
|
3602
|
+
|
|
3603
|
+
return function (_x) {
|
|
3604
|
+
return _ref.apply(this, arguments);
|
|
3605
|
+
};
|
|
3606
|
+
}());
|
|
3607
|
+
|
|
3608
|
+
defineProperty(this, "handleStatusChange", () => {
|
|
3609
|
+
this.updateProfile();
|
|
3610
|
+
});
|
|
3611
|
+
}
|
|
3612
|
+
|
|
3613
|
+
updateProfile() {
|
|
3614
|
+
var _this2 = this;
|
|
3615
|
+
|
|
3616
|
+
return asyncToGenerator(function* () {
|
|
3617
|
+
const {
|
|
3618
|
+
api,
|
|
3619
|
+
props: {
|
|
3620
|
+
fields
|
|
3621
|
+
}
|
|
3622
|
+
} = _this2;
|
|
3623
|
+
|
|
3624
|
+
if (!api) {
|
|
3625
|
+
return;
|
|
3626
|
+
}
|
|
3627
|
+
|
|
3628
|
+
try {
|
|
3629
|
+
const response = yield api.getLoginStatus();
|
|
3630
|
+
|
|
3631
|
+
if (response.status !== LoginStatus.CONNECTED) {
|
|
3632
|
+
_this2.setState({
|
|
3633
|
+
profile: undefined,
|
|
3634
|
+
loading: false,
|
|
3635
|
+
error: undefined
|
|
3636
|
+
});
|
|
3637
|
+
|
|
3638
|
+
return;
|
|
3639
|
+
}
|
|
3640
|
+
|
|
3641
|
+
const profile = yield api.getProfile({
|
|
3642
|
+
fields
|
|
3643
|
+
});
|
|
3644
|
+
|
|
3645
|
+
_this2.setState({
|
|
3646
|
+
profile,
|
|
3647
|
+
loading: false,
|
|
3648
|
+
error: undefined
|
|
3649
|
+
});
|
|
3650
|
+
} catch (error) {
|
|
3651
|
+
_this2.setState({
|
|
3652
|
+
profile: undefined,
|
|
3653
|
+
loading: false,
|
|
3654
|
+
error
|
|
3655
|
+
});
|
|
3656
|
+
}
|
|
3657
|
+
})();
|
|
3658
|
+
}
|
|
3659
|
+
|
|
3660
|
+
render() {
|
|
3661
|
+
const {
|
|
3662
|
+
children
|
|
3663
|
+
} = this.props;
|
|
3664
|
+
const {
|
|
3665
|
+
profile,
|
|
3666
|
+
loading,
|
|
3667
|
+
error
|
|
3668
|
+
} = this.state;
|
|
3669
|
+
return React__default.createElement(Initialize$1, {
|
|
3670
|
+
onReady: this.handleReady
|
|
3671
|
+
}, React__default.createElement(LoginStatus$1, {
|
|
3672
|
+
event: "auth.statusChange",
|
|
3673
|
+
onChange: this.handleStatusChange
|
|
3674
|
+
}, children({
|
|
3675
|
+
profile,
|
|
3676
|
+
loading,
|
|
3677
|
+
error
|
|
3678
|
+
})));
|
|
3679
|
+
}
|
|
3680
|
+
|
|
3681
|
+
}
|
|
3682
|
+
|
|
3683
|
+
defineProperty(Profile, "defaultProps", {
|
|
3684
|
+
fields: Fields
|
|
3685
|
+
});
|
|
3686
|
+
|
|
3687
|
+
class CustomChat extends PureComponent {
|
|
3688
|
+
componentDidUpdate() {
|
|
3689
|
+
const {
|
|
3690
|
+
handleParse
|
|
3691
|
+
} = this.props;
|
|
3692
|
+
handleParse();
|
|
3693
|
+
}
|
|
3694
|
+
|
|
3695
|
+
render() {
|
|
3696
|
+
const {
|
|
3697
|
+
children,
|
|
3698
|
+
pageId,
|
|
3699
|
+
themeColor,
|
|
3700
|
+
loggedInGreeting,
|
|
3701
|
+
loggedOutGreeting,
|
|
3702
|
+
dataRef,
|
|
3703
|
+
greetingDialogDisplay,
|
|
3704
|
+
greetingDialogDelay
|
|
3705
|
+
} = this.props;
|
|
3706
|
+
return React__default.createElement("div", {
|
|
3707
|
+
className: "fb-customerchat",
|
|
3708
|
+
page_id: pageId,
|
|
3709
|
+
theme_color: themeColor,
|
|
3710
|
+
logged_in_greeting: loggedInGreeting,
|
|
3711
|
+
logged_out_greeting: loggedOutGreeting,
|
|
3712
|
+
greeting_dialog_display: greetingDialogDisplay,
|
|
3713
|
+
greeting_dialog_delay: greetingDialogDelay,
|
|
3714
|
+
"data-ref": dataRef
|
|
3715
|
+
}, children);
|
|
3716
|
+
}
|
|
3717
|
+
|
|
3718
|
+
}
|
|
3719
|
+
|
|
3720
|
+
defineProperty(CustomChat, "defaultProps", {
|
|
3721
|
+
children: undefined,
|
|
3722
|
+
themeColor: undefined,
|
|
3723
|
+
loggedInGreeting: undefined,
|
|
3724
|
+
loggedOutGreeting: undefined,
|
|
3725
|
+
dataRef: undefined,
|
|
3726
|
+
greetingDialogDisplay: undefined,
|
|
3727
|
+
greetingDialogDelay: undefined
|
|
3728
|
+
});
|
|
3729
|
+
|
|
3730
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3731
|
+
handleParse
|
|
3732
|
+
}) => React__default.createElement(CustomChat, _extends_1({}, props, {
|
|
3733
|
+
handleParse: handleParse,
|
|
3734
|
+
ref: ref
|
|
3735
|
+
}))));
|
|
3736
|
+
|
|
3737
|
+
class MessageUs extends PureComponent {
|
|
3738
|
+
componentDidUpdate() {
|
|
3739
|
+
const {
|
|
3740
|
+
handleParse
|
|
3741
|
+
} = this.props;
|
|
3742
|
+
handleParse();
|
|
3743
|
+
}
|
|
3744
|
+
|
|
3745
|
+
render() {
|
|
3746
|
+
const {
|
|
3747
|
+
color,
|
|
3748
|
+
messengerAppId,
|
|
3749
|
+
pageId,
|
|
3750
|
+
children,
|
|
3751
|
+
size
|
|
3752
|
+
} = this.props;
|
|
3753
|
+
return React__default.createElement("div", {
|
|
3754
|
+
className: "fb-messengermessageus",
|
|
3755
|
+
messenger_app_id: messengerAppId,
|
|
3756
|
+
page_id: pageId,
|
|
3757
|
+
"data-color": color,
|
|
3758
|
+
"data-size": size
|
|
3759
|
+
}, children);
|
|
3760
|
+
}
|
|
3761
|
+
|
|
3762
|
+
}
|
|
3763
|
+
|
|
3764
|
+
defineProperty(MessageUs, "defaultProps", {
|
|
3765
|
+
color: undefined,
|
|
3766
|
+
size: undefined,
|
|
3767
|
+
children: undefined
|
|
3768
|
+
});
|
|
3769
|
+
|
|
3770
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3771
|
+
handleParse
|
|
3772
|
+
}) => React__default.createElement(MessageUs, _extends_1({}, props, {
|
|
3773
|
+
handleParse: handleParse,
|
|
3774
|
+
ref: ref
|
|
3775
|
+
}))));
|
|
3776
|
+
|
|
3777
|
+
class MessengerCheckbox extends PureComponent {
|
|
3778
|
+
componentDidUpdate() {
|
|
3779
|
+
const {
|
|
3780
|
+
handleParse
|
|
3781
|
+
} = this.props;
|
|
3782
|
+
handleParse();
|
|
3783
|
+
}
|
|
3784
|
+
|
|
3785
|
+
render() {
|
|
3786
|
+
const {
|
|
3787
|
+
origin,
|
|
3788
|
+
prechecked,
|
|
3789
|
+
allowLogin,
|
|
3790
|
+
userRef,
|
|
3791
|
+
messengerAppId,
|
|
3792
|
+
pageId,
|
|
3793
|
+
children,
|
|
3794
|
+
size,
|
|
3795
|
+
centerAlign,
|
|
3796
|
+
skin
|
|
3797
|
+
} = this.props;
|
|
3798
|
+
return React__default.createElement("div", {
|
|
3799
|
+
className: "fb-messenger-checkbox",
|
|
3800
|
+
messenger_app_id: messengerAppId,
|
|
3801
|
+
page_id: pageId,
|
|
3802
|
+
size: size,
|
|
3803
|
+
origin: origin,
|
|
3804
|
+
user_ref: userRef,
|
|
3805
|
+
prechecked: prechecked,
|
|
3806
|
+
allow_login: allowLogin,
|
|
3807
|
+
skin: skin,
|
|
3808
|
+
center_align: centerAlign
|
|
3809
|
+
}, children);
|
|
3810
|
+
}
|
|
3811
|
+
|
|
3812
|
+
}
|
|
3813
|
+
|
|
3814
|
+
defineProperty(MessengerCheckbox, "defaultProps", {
|
|
3815
|
+
size: undefined,
|
|
3816
|
+
allowLogin: undefined,
|
|
3817
|
+
prechecked: undefined,
|
|
3818
|
+
userRef: undefined,
|
|
3819
|
+
children: undefined,
|
|
3820
|
+
origin: undefined,
|
|
3821
|
+
skin: undefined,
|
|
3822
|
+
centerAlign: undefined
|
|
3823
|
+
});
|
|
3824
|
+
|
|
3825
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3826
|
+
handleParse
|
|
3827
|
+
}) => React__default.createElement(MessengerCheckbox, _extends_1({}, props, {
|
|
3828
|
+
handleParse: handleParse,
|
|
3829
|
+
ref: ref
|
|
3830
|
+
}))));
|
|
3831
|
+
|
|
3832
|
+
// import MessengerColor from './constants/MessengerColor';
|
|
3833
|
+
|
|
3834
|
+
class SendToMessenger extends PureComponent {
|
|
3835
|
+
componentDidUpdate() {
|
|
3836
|
+
const {
|
|
3837
|
+
handleParse
|
|
3838
|
+
} = this.props;
|
|
3839
|
+
handleParse();
|
|
3840
|
+
}
|
|
3841
|
+
|
|
3842
|
+
render() {
|
|
3843
|
+
const {
|
|
3844
|
+
color,
|
|
3845
|
+
messengerAppId,
|
|
3846
|
+
pageId,
|
|
3847
|
+
children,
|
|
3848
|
+
dataRef,
|
|
3849
|
+
size
|
|
3850
|
+
} = this.props;
|
|
3851
|
+
return React__default.createElement("div", {
|
|
3852
|
+
className: "fb-send-to-messenger",
|
|
3853
|
+
messenger_app_id: messengerAppId,
|
|
3854
|
+
page_id: pageId,
|
|
3855
|
+
"data-color": color,
|
|
3856
|
+
"data-size": size,
|
|
3857
|
+
"data-ref": dataRef
|
|
3858
|
+
}, children);
|
|
3859
|
+
}
|
|
3860
|
+
|
|
3861
|
+
}
|
|
3862
|
+
|
|
3863
|
+
defineProperty(SendToMessenger, "defaultProps", {
|
|
3864
|
+
color: undefined,
|
|
3865
|
+
size: undefined,
|
|
3866
|
+
dataRef: undefined,
|
|
3867
|
+
children: undefined
|
|
3868
|
+
});
|
|
3869
|
+
|
|
3870
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3871
|
+
handleParse
|
|
3872
|
+
}) => React__default.createElement(SendToMessenger, _extends_1({}, props, {
|
|
3873
|
+
handleParse: handleParse,
|
|
3874
|
+
ref: ref
|
|
3875
|
+
}))));
|
|
3876
|
+
|
|
3877
|
+
var ImageSlider = function ImageSlider(props) {
|
|
3878
|
+
var innerSlider = useRef(null);
|
|
3879
|
+
var tile = useRef(null);
|
|
3880
|
+
var viewableWindow = useRef(null);
|
|
3881
|
+
|
|
3882
|
+
var _useState = useState(0),
|
|
3883
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3884
|
+
tileSize = _useState2[0],
|
|
3885
|
+
setTileSize = _useState2[1];
|
|
3886
|
+
|
|
3887
|
+
var _useState3 = useState(false),
|
|
3888
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
3889
|
+
showScroller = _useState4[0],
|
|
3890
|
+
setShowScroller = _useState4[1];
|
|
3891
|
+
|
|
3892
|
+
var _useState5 = useState(0),
|
|
3893
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
3894
|
+
scrollPosition = _useState6[0],
|
|
3895
|
+
setScrollPosition = _useState6[1];
|
|
3896
|
+
|
|
3897
|
+
var client = props.client;
|
|
3898
|
+
|
|
3899
|
+
|
|
3900
|
+
function scrollSlider(e, direction) {
|
|
3901
|
+
var slide = e.target.parentElement;
|
|
3902
|
+
var scrollOffset = scrollPosition;
|
|
3903
|
+
var viewableWidth = slide.clientWidth;
|
|
3904
|
+
//calculate viewable size / slide
|
|
3905
|
+
var numberOfSlidesToScroll = Math.floor(tile.current.clientWidth + 25); //width of the tile plus margin
|
|
3906
|
+
var scrollDirection = void 0;
|
|
3907
|
+
if (direction === 'next') {
|
|
3908
|
+
scrollDirection = scrollOffset + numberOfSlidesToScroll;
|
|
3909
|
+
if (scrollOffset + viewableWidth + 25 >= innerSlider.current.offsetWidth) {
|
|
3910
|
+
scrollDirection = 0;
|
|
3911
|
+
}
|
|
3912
|
+
}
|
|
3913
|
+
if (direction === 'prev') {
|
|
3914
|
+
scrollDirection = scrollOffset - numberOfSlidesToScroll;
|
|
3915
|
+
if (scrollOffset === 0) {
|
|
3916
|
+
if (window.innerWidth > 1399) {
|
|
3917
|
+
scrollDirection = innerSlider.current.offsetWidth - tileSize * 3 - 70;
|
|
3918
|
+
}
|
|
3919
|
+
if (window.innerWidth < 1399 && window.innerWidth > 592) {
|
|
3920
|
+
scrollDirection = innerSlider.current.offsetWidth - tileSize * 2 - 40;
|
|
3921
|
+
}
|
|
3922
|
+
if (window.innerWidth < 592) {
|
|
3923
|
+
scrollDirection = innerSlider.current.offsetWidth - tileSize * 1 - 24;
|
|
3924
|
+
}
|
|
3925
|
+
}
|
|
3926
|
+
}
|
|
3927
|
+
slide.scrollTo({
|
|
3928
|
+
left: scrollDirection,
|
|
3929
|
+
behavior: 'smooth'
|
|
3930
|
+
});
|
|
3931
|
+
setScrollPosition(scrollDirection);
|
|
3932
|
+
}
|
|
3933
|
+
var setThumbSize = function setThumbSize() {
|
|
3934
|
+
var thumbSize = void 0;
|
|
3935
|
+
var scrollerVisible = false;
|
|
3936
|
+
if (window.innerWidth > 1399) {
|
|
3937
|
+
if (props.data.slides && props.data.slides.length < 3) {
|
|
3938
|
+
thumbSize = Math.floor(viewableWindow.current.clientWidth / 2 - 40);
|
|
3939
|
+
} else {
|
|
3940
|
+
thumbSize = Math.floor(viewableWindow.current.clientWidth / 3 - 40);
|
|
3941
|
+
}
|
|
3942
|
+
if (props.data.slides.length > 3) {
|
|
3943
|
+
scrollerVisible = true;
|
|
3944
|
+
}
|
|
3945
|
+
}
|
|
3946
|
+
if (window.innerWidth < 1399 && window.innerWidth > 592) {
|
|
3947
|
+
thumbSize = Math.floor(viewableWindow.current.clientWidth / 2 - 48);
|
|
3948
|
+
if (props.data.slides.length > 2) {
|
|
3949
|
+
scrollerVisible = true;
|
|
3950
|
+
}
|
|
3951
|
+
}
|
|
3952
|
+
if (window.innerWidth < 592) {
|
|
3953
|
+
thumbSize = Math.floor(viewableWindow.current.clientWidth / 1 - 64);
|
|
3954
|
+
if (props.data.slides.length > 1) {
|
|
3955
|
+
scrollerVisible = true;
|
|
3956
|
+
}
|
|
3957
|
+
}
|
|
3958
|
+
if (thumbSize !== tileSize) {
|
|
3959
|
+
setTileSize(thumbSize);
|
|
3960
|
+
setScrollPosition(0);
|
|
3961
|
+
setShowScroller(scrollerVisible);
|
|
3962
|
+
var videoRows = document.querySelectorAll('#vid-slider .row');
|
|
3963
|
+
for (var i = 0; i < videoRows.length; i++) {
|
|
3964
|
+
videoRows[i].scrollTo({
|
|
3965
|
+
left: 0,
|
|
3966
|
+
behavior: 'smooth'
|
|
3967
|
+
});
|
|
3968
|
+
}
|
|
3969
|
+
}
|
|
3970
|
+
};
|
|
3971
|
+
useEffect(function () {
|
|
3972
|
+
//IE11 Polyfill
|
|
3973
|
+
smoothscroll.polyfill();
|
|
3974
|
+
setThumbSize();
|
|
3975
|
+
|
|
3976
|
+
window.addEventListener('resize', setThumbSize);
|
|
3977
|
+
|
|
3978
|
+
return function () {
|
|
3979
|
+
return window.removeEventListener('resize', setThumbSize);
|
|
3980
|
+
};
|
|
3981
|
+
}, []);
|
|
3982
|
+
|
|
3983
|
+
var variant = 'black';
|
|
3984
|
+
return React__default.createElement(
|
|
3985
|
+
React__default.Fragment,
|
|
1457
3986
|
null,
|
|
1458
|
-
|
|
1459
|
-
|
|
3987
|
+
React__default.createElement(
|
|
3988
|
+
'div',
|
|
3989
|
+
{ ref: viewableWindow, id: 'vid-slider', className: 'col' },
|
|
3990
|
+
React__default.createElement(
|
|
3991
|
+
'div',
|
|
3992
|
+
{ className: 'row' },
|
|
3993
|
+
showScroller && React__default.createElement(
|
|
3994
|
+
'div',
|
|
3995
|
+
{ onClick: function onClick(e) {
|
|
3996
|
+
return scrollSlider(e, 'prev');
|
|
3997
|
+
}, className: 'tile__slider-prev', style: { color: variant } },
|
|
3998
|
+
React__default.createElement('i', { style: { border: 'solid ' + variant, borderWidth: '0 4px 4px 0' }, className: 'arrow left' })
|
|
3999
|
+
),
|
|
4000
|
+
showScroller && React__default.createElement(
|
|
4001
|
+
'div',
|
|
4002
|
+
{ onClick: function onClick(e) {
|
|
4003
|
+
return scrollSlider(e, 'next');
|
|
4004
|
+
}, className: 'tile__slider-next', style: { color: variant } },
|
|
4005
|
+
React__default.createElement('i', { style: { border: 'solid ' + variant, borderWidth: '0 4px 4px 0' }, className: 'arrow right' })
|
|
4006
|
+
),
|
|
4007
|
+
React__default.createElement(
|
|
4008
|
+
'div',
|
|
4009
|
+
{ ref: innerSlider, className: 'row__inner' },
|
|
4010
|
+
props.data.slides.map(function (img, index) {
|
|
4011
|
+
var thumbnail = urlFor({ client: client, source: img.slideshowImage, imageWidth: 250 });
|
|
4012
|
+
if (!img.slideshowImage.link) {
|
|
4013
|
+
return React__default.createElement(
|
|
4014
|
+
'div',
|
|
4015
|
+
{ ref: tile, key: index, className: 'tile', style: { width: tileSize + 'px' } },
|
|
4016
|
+
React__default.createElement(
|
|
4017
|
+
'div',
|
|
4018
|
+
{ className: 'tile__media' },
|
|
4019
|
+
React__default.createElement('img', { className: 'tile__img', src: thumbnail, alt: img.slideshowImage.alt ? img.slideshowImage.alt : '', style: { width: tileSize + 'px' } })
|
|
4020
|
+
),
|
|
4021
|
+
React__default.createElement('div', { style: { color: variant }, className: 'tile__info' })
|
|
4022
|
+
);
|
|
4023
|
+
} else {
|
|
4024
|
+
return React__default.createElement(
|
|
4025
|
+
'a',
|
|
4026
|
+
{ ref: tile, key: index, href: img.slideshowImage.link, target: img.slideshowImage.blank ? '_target' : '_self', className: 'tile', style: { width: tileSize + 'px' } },
|
|
4027
|
+
React__default.createElement(
|
|
4028
|
+
'div',
|
|
4029
|
+
{ className: 'tile__media' },
|
|
4030
|
+
React__default.createElement('img', { className: 'tile__img', src: thumbnail, alt: img.slideshowImage.alt ? img.slideshowImage.alt : '', style: { width: tileSize + 'px' } })
|
|
4031
|
+
),
|
|
4032
|
+
React__default.createElement('div', { style: { color: variant }, className: 'tile__info' })
|
|
4033
|
+
);
|
|
4034
|
+
}
|
|
4035
|
+
})
|
|
4036
|
+
)
|
|
4037
|
+
),
|
|
4038
|
+
React__default.createElement(
|
|
4039
|
+
'style',
|
|
4040
|
+
{ jsx: 'true' },
|
|
4041
|
+
'\n #vid-slider * {\n box-sizing: border-box;\n -ms-overflow-style: none;\n }\n #vid-slider::-webkit-scrollbar-thumb {\n display: none;\n }\n #vid-slider::-webkit-scrollbar {\n display: none;\n }\n #vid-slider .row::-webkit-scrollbar {\n display: none;\n }\n #vid-slider .row::-webkit-scrollbar-thumb {\n display: none;\n }\n #vid-slider {\n position: relative;\n -ms-overflow-style: none;\n padding: 0 1.5rem;\n margin-bottom: 0 !important;\n }\n #vid-slider .now-playing {\n position: absolute;\n top: 0.5rem;\n left: 1rem;\n color: white;\n background: rgba(0, 0, 0, 0.75);\n }\n #vid-slider h1,\n #vid-slider p {\n text-align: center;\n width: 100%;\n max-width: 500px;\n margin: auto;\n }\n #vid-slider,\n #vidHolder {\n max-width: 805px;\n }\n #vid-slider a:link,\n #vid-slider a:hover,\n #vid-slider a:active,\n #vid-slider a:visited {\n transition: color 150ms;\n color: #95a5a6;\n text-decoration: none;\n }\n #vid-slider a:hover {\n color: #7f8c8d;\n text-decoration: underline;\n }\n #vid-slider .contain {\n width: 100%;\n }\n #vid-slider .row {\n overflow-x: scroll;\n width: 100%;\n -ms-overflow-style: none;\n overflow-y: hidden !important;\n }\n #vid-slider .tile__info {\n white-space: normal !important;\n position: absolute;\n text-align: center;\n color: ' + (props.dark ? 'white' : '#383838') + ';\n opacity: 1;\n font-size: 0.9rem;\n font-weight: bold;\n transition: opacity 0.25s;\n }\n #vid-slider .row__inner {\n transition: 450ms -webkit-transform;\n transition: 450ms transform;\n transition: 450ms transform, 450ms -webkit-transform;\n font-size: 0;\n white-space: nowrap;\n margin: 25px 0 70px !important;\n padding-bottom: 10px;\n padding-left: 0;\n }\n #vid-slider .tile {\n position: relative;\n display: inline-block;\n margin: 0 12px;\n font-size: 20px;\n transition: 450ms all;\n -webkit-transform-origin: center left;\n transform-origin: center left;\n }\n \n #vid-slider .tile:first-child {\n margin-left: 15px;\n }\n #vid-slider .tile__img {\n height: auto;\n -o-object-fit: contain;\n object-fit: contain;\n object-position: center;\n }\n #vid-slider .tile__details {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n top: 0;\n font-size: 10px;\n opacity: 0;\n background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);\n transition: 450ms opacity;\n }\n #vid-slider .tile__details:after,\n #vid-slider .tile__details:before {\n content: \'\';\n \n position: absolute;\n top: 50%;\n left: 50%;\n display: #000;\n }\n #vid-slider .tile__details:after {\n margin-top: -25px;\n margin-left: -25px;\n width: 50px;\n height: 50px;\n border: 3px solid #ecf0f1;\n line-height: 50px;\n text-align: center;\n border-radius: 100%;\n background: rgba(0, 0, 0, 0.5);\n z-index: 1;\n }\n #vid-slider .tile__details:before {\n content: \'\';\n background: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 64 64\' width=\'64\' height=\'64\' fill=\'white\'><path d=\'M26 46 L46 32 L26 18 Z\'/></svg>")\n no-repeat center center;\n left: 0;\n width: 100%;\n height: 3rem;\n font-size: 30px;\n margin-right: 12px;\n margin-top: -24px;\n text-align: center;\n z-index: 2;\n color: white;\n }\n \n #vid-slider .tile__title {\n position: absolute;\n bottom: 0;\n padding: 10px;\n max-width: 250px;\n }\n #vid-slider .tile__title_text {\n position: relative;\n left: 0;\n white-space: normal;\n }\n \n #vid-slider .tile__slider-prev,\n #vid-slider .tile__slider-next {\n width: 30px;\n background: transparent;\n border: none;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n z-index: 99;\n cursor: pointer;\n color: ' + (props.dark ? 'white' : 'black') + ';\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 2rem;\n }\n #vid-slider .tile__slider-prev {\n left: -0.5rem;\n padding: 1rem;\n }\n #vid-slider .tile__slider-next {\n right: -0.5rem;\n padding: 1rem;\n }\n #vid-slider,\n #vid-slider .row {\n margin: 0;\n }\n \n #vid-slider .row::-webkit-scrollbar-thumb {\n background-color: transparent !important;\n }\n #vid-slider i {\n border: solid ' + (props.dark ? 'white' : 'black') + ';\n border-width: 0 4px 4px 0;\n display: inline-block;\n padding: 4px;\n pointer-events: none;\n }\n #vid-slider .right {\n transform: rotate(-45deg);\n -webkit-transform: rotate(-45deg);\n }\n #vid-slider .left {\n transform: rotate(135deg);\n -webkit-transform: rotate(135deg);\n }\n @media screen and (min-width: 1399px) {\n .block-content #vid-slider .tile__img {\n height: auto;\n }\n .block-content #vid-slider .tile {\n height: auto;\n }\n }\n \n @media screen and (max-width: 1399px) {\n #vid-slider,\n #vidHolder {\n max-width: 620px;\n }\n }\n @media screen and (max-width: 1200px) {\n #vid-slider,\n #vidHolder {\n max-width: 580px;\n }\n }\n @media screen and (max-width: 967px) {\n #vid-slider {\n max-width: 100%;\n }\n \n #vid-slider .row__inner {\n margin: 60px 0 50px !important;\n }\n }\n \n @media screen and (max-width: 768px) {\n #vidHolder {\n position: unset;\n width: 100%;\n }\n }\n @media screen and (max-width: 568px) {\n #vidHolder {\n position: unset;\n width: 100%;\n }\n \n #vid-slider .row__inner {\n margin: 30px 0 70px;\n }\n }\n '
|
|
4042
|
+
)
|
|
4043
|
+
)
|
|
4044
|
+
);
|
|
4045
|
+
};
|
|
4046
|
+
|
|
4047
|
+
var _this = undefined;
|
|
4048
|
+
|
|
4049
|
+
var PartnerDetails = function PartnerDetails(_ref) {
|
|
4050
|
+
var posts = _ref.posts,
|
|
4051
|
+
query = _ref.query,
|
|
4052
|
+
params = _ref.params,
|
|
4053
|
+
features = _ref.features,
|
|
4054
|
+
currentPage = _ref.currentPage,
|
|
4055
|
+
partnerDetails = _ref.partnerDetails,
|
|
4056
|
+
client = _ref.client,
|
|
4057
|
+
Settings = _ref.Settings,
|
|
4058
|
+
pageview = _ref.pageview,
|
|
4059
|
+
page = _ref.page;
|
|
4060
|
+
|
|
4061
|
+
return React__default.createElement(
|
|
4062
|
+
React__default.Fragment,
|
|
4063
|
+
null,
|
|
4064
|
+
React__default.createElement(Breadcrumbs, null),
|
|
4065
|
+
React__default.createElement(
|
|
1460
4066
|
'div',
|
|
1461
4067
|
{ className: 'partners-page' },
|
|
1462
|
-
|
|
4068
|
+
React__default.createElement(
|
|
1463
4069
|
'div',
|
|
1464
4070
|
{ className: 'my-5 partner-logo-wrap', style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' } },
|
|
1465
|
-
partnerDetails.thumbnail && partnerDetails.thumbnail.link ?
|
|
4071
|
+
partnerDetails.thumbnail && partnerDetails.thumbnail.link ? React__default.createElement(
|
|
1466
4072
|
'a',
|
|
1467
4073
|
{ className: 'partners-logo', style: { width: '25%', minWidth: '25%' }, href: partnerDetails.thumbnail.link, target: partnerDetails.thumbnail.blank ? '_blank' : '' },
|
|
1468
|
-
|
|
4074
|
+
React__default.createElement(
|
|
1469
4075
|
'figure',
|
|
1470
4076
|
{ style: { width: '100%', textAlign: 'center' } },
|
|
1471
|
-
|
|
4077
|
+
React__default.createElement('img', {
|
|
1472
4078
|
alt: partnerDetails.thumbnail && partnerDetails.thumbnail.alt ? partnerDetails.thumbnail.alt : partnerDetails.name,
|
|
1473
4079
|
style: { maxWidth: '100%' },
|
|
1474
4080
|
src: partnerDetails.thumbnail ? urlFor({ client: client, source: partnerDetails.thumbnail.asset }) : '' }),
|
|
1475
|
-
partnerDetails.thumbnail && partnerDetails.thumbnail.caption &&
|
|
4081
|
+
partnerDetails.thumbnail && partnerDetails.thumbnail.caption && React__default.createElement(
|
|
1476
4082
|
'figcaption',
|
|
1477
4083
|
null,
|
|
1478
4084
|
partnerDetails.thumbnail.caption
|
|
1479
4085
|
)
|
|
1480
4086
|
)
|
|
1481
|
-
) :
|
|
4087
|
+
) : React__default.createElement(
|
|
1482
4088
|
'figure',
|
|
1483
4089
|
{ className: 'partners-logo', style: { width: '25%', minWidth: '25%', textAlign: 'center' } },
|
|
1484
|
-
|
|
4090
|
+
React__default.createElement('img', {
|
|
1485
4091
|
alt: partnerDetails.thumbnail && partnerDetails.thumbnail.alt ? partnerDetails.thumbnail.alt : partnerDetails.name,
|
|
1486
4092
|
style: { maxWidth: '100%' },
|
|
1487
4093
|
src: partnerDetails.thumbnail ? urlFor({ client: client, source: partnerDetails.thumbnail.asset }) : '' }),
|
|
1488
|
-
partnerDetails.thumbnail && partnerDetails.thumbnail.caption &&
|
|
4094
|
+
partnerDetails.thumbnail && partnerDetails.thumbnail.caption && React__default.createElement(
|
|
1489
4095
|
'figcaption',
|
|
1490
4096
|
null,
|
|
1491
4097
|
partnerDetails.thumbnail.caption
|
|
1492
4098
|
)
|
|
1493
4099
|
),
|
|
1494
|
-
|
|
4100
|
+
React__default.createElement(
|
|
1495
4101
|
'style',
|
|
1496
4102
|
{ jsx: 'true' },
|
|
1497
4103
|
'\n @media screen and (max-width: 768px) {\n .partners-logo {\n width: 100%;\n min-width: 100%;\n }\n .partner-logo-wrap {\n flex-wrap: wrap;\n }\n .block-content-partners {\n padding-left: 0 !important;\n }\n }\n '
|
|
1498
4104
|
),
|
|
1499
|
-
partnerDetails.description &&
|
|
4105
|
+
(partnerDetails.description || partnerDetails.linkedin || partnerDetails.twitter && partnerDetails.facebook) && React__default.createElement(
|
|
1500
4106
|
'div',
|
|
1501
4107
|
{ className: 'block-content-partners my-4', style: { maxWidth: '100%', paddingLeft: '2rem', flex: '1 1 auto' } },
|
|
1502
|
-
|
|
4108
|
+
partnerDetails.description && React__default.createElement(BlockContent, _extends({ serializers: getSerializers(client), blocks: partnerDetails.description, imageOptions: { w: 320, h: 240, fit: 'max' } }, client.config())),
|
|
4109
|
+
(partnerDetails.linkedin || partnerDetails.twitter && partnerDetails.facebook) && React__default.createElement(
|
|
4110
|
+
'div',
|
|
4111
|
+
null,
|
|
4112
|
+
React__default.createElement(
|
|
4113
|
+
'p',
|
|
4114
|
+
{ 'class': 'd-inline-block font-weight-bold' },
|
|
4115
|
+
'Connect with us:'
|
|
4116
|
+
),
|
|
4117
|
+
' ',
|
|
4118
|
+
partnerDetails.linkedin && React__default.createElement(reactSocialIcons_1, {
|
|
4119
|
+
url: '' + partnerDetails.linkedin + (partnerDetails.linkedin.slice(-1) === '/' ? '' : '/') + 'posts/?feedView=all',
|
|
4120
|
+
target: '_blank',
|
|
4121
|
+
rel: 'noopener noreferrer',
|
|
4122
|
+
style: { height: 30, width: 30 }
|
|
4123
|
+
}),
|
|
4124
|
+
partnerDetails.twitter && partnerDetails.facebook && React__default.createElement(reactSocialIcons_1, { url: partnerDetails.facebook, target: '_blank', rel: 'noopener noreferrer', style: { height: 30, width: 30, marginLeft: '0.25rem' } })
|
|
4125
|
+
)
|
|
1503
4126
|
)
|
|
1504
4127
|
),
|
|
1505
|
-
partnerDetails.affiliates && partnerDetails.affiliates[0] && partnerDetails.affiliates[0].slides &&
|
|
4128
|
+
partnerDetails.affiliates && partnerDetails.affiliates[0] && partnerDetails.affiliates[0].slides && React__default.createElement(
|
|
1506
4129
|
'div',
|
|
1507
4130
|
{ className: 'mb-4', style: { padding: '0 15px' } },
|
|
1508
|
-
partnerDetails.affiliates[0].title &&
|
|
4131
|
+
partnerDetails.affiliates[0].title && React__default.createElement(
|
|
1509
4132
|
'h2',
|
|
1510
4133
|
{ className: 'bb-gold' },
|
|
1511
4134
|
partnerDetails.affiliates[0].title
|
|
1512
4135
|
),
|
|
1513
|
-
|
|
4136
|
+
React__default.createElement(ImageSlider, { client: client, data: partnerDetails.affiliates[0] })
|
|
1514
4137
|
),
|
|
1515
|
-
features.length > 0 &&
|
|
4138
|
+
features.length > 0 && React__default.createElement(
|
|
1516
4139
|
'div',
|
|
1517
4140
|
{ className: ' mb-5' },
|
|
1518
|
-
|
|
4141
|
+
React__default.createElement(Feature, { dataset: features, client: client })
|
|
1519
4142
|
),
|
|
1520
|
-
partnerDetails.twitter &&
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
{
|
|
1526
|
-
|
|
4143
|
+
(partnerDetails.twitter || partnerDetails.facebook) && React__default.createElement(
|
|
4144
|
+
'div',
|
|
4145
|
+
{ className: 'mb-5', style: { width: '100%', maxWidth: '100%', textAlign: 'center', padding: '15px', border: '2px solid #aaa', borderRadius: '15px' } },
|
|
4146
|
+
partnerDetails.twitter ? React__default.createElement(TwitterTimelineEmbed, { sourceType: 'url', url: partnerDetails.twitter, options: { height: 400 } }) : partnerDetails.facebook && React__default.createElement(
|
|
4147
|
+
Facebook$1,
|
|
4148
|
+
{ appId: ' ' },
|
|
4149
|
+
React__default.createElement(Page$1, { href: partnerDetails.facebook, tabs: 'timeline', width: '500', height: '500' })
|
|
1527
4150
|
)
|
|
1528
4151
|
),
|
|
1529
|
-
|
|
4152
|
+
React__default.createElement(
|
|
1530
4153
|
'div',
|
|
1531
4154
|
null,
|
|
1532
|
-
posts && posts.length > 0 &&
|
|
1533
|
-
|
|
4155
|
+
posts && posts.length > 0 && React__default.createElement(
|
|
4156
|
+
React__default.Fragment,
|
|
1534
4157
|
null,
|
|
1535
|
-
|
|
4158
|
+
React__default.createElement(
|
|
1536
4159
|
'h2',
|
|
1537
4160
|
{ className: 'bb-gold mb-2' },
|
|
1538
4161
|
'Latest from ',
|
|
1539
4162
|
partnerDetails.name
|
|
1540
4163
|
),
|
|
1541
|
-
|
|
4164
|
+
React__default.createElement('hr', null)
|
|
1542
4165
|
),
|
|
1543
|
-
|
|
4166
|
+
React__default.createElement(QueueDeckExpanded, {
|
|
1544
4167
|
client: client,
|
|
1545
4168
|
mapping: Settings.mapping,
|
|
1546
4169
|
dataRecord: posts,
|
|
@@ -1563,7 +4186,7 @@ var PartnerDetails = function PartnerDetails(_ref) {
|
|
|
1563
4186
|
};
|
|
1564
4187
|
|
|
1565
4188
|
PartnerDetails.returnGetInitialProps = function () {
|
|
1566
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(identifier, partnerPageUrl, partnerDocumentGroupID, params, currentPage, client) {
|
|
4189
|
+
var _ref2 = _asyncToGenerator$1( /*#__PURE__*/regenerator.mark(function _callee(identifier, partnerPageUrl, partnerDocumentGroupID, params, currentPage, client) {
|
|
1567
4190
|
var category = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
1568
4191
|
|
|
1569
4192
|
var today, featureQuery, partnerQuery, taxonomyQuery, _ref3, _ref4, features, partnerDetails, taxonomyDetails, articlesQuery, articles;
|
|
@@ -1574,14 +4197,14 @@ PartnerDetails.returnGetInitialProps = function () {
|
|
|
1574
4197
|
case 0:
|
|
1575
4198
|
today = moment().utc().format();
|
|
1576
4199
|
featureQuery = '*[_type == \'feature\' && is_active == true && feature_url == \'/' + partnerPageUrl + '/' + (category ? category + '/' : null) + identifier + '\'] | order(_updatedAt asc)[0..5]{\n ...,\n \'feature_img\' : feature_img.asset->url\n }';
|
|
1577
|
-
partnerQuery = '*[_type == \'documentGroup\' \n && !(_id in path("drafts.**"))\n && references(\'' + partnerDocumentGroupID + '\')\n && identifier.current == \'' + identifier + '\'] | order(name asc) [0] {\n description,\n name,\n identifier,\n thumbnail,\n twitter,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n }';
|
|
4200
|
+
partnerQuery = '*[_type == \'documentGroup\' \n && !(_id in path("drafts.**"))\n && references(\'' + partnerDocumentGroupID + '\')\n && identifier.current == \'' + identifier + '\'] | order(name asc) [0] {\n description,\n name,\n identifier,\n thumbnail,\n twitter,\n facebook,\n linkedin,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n }';
|
|
1578
4201
|
|
|
1579
4202
|
|
|
1580
4203
|
if (category) {
|
|
1581
4204
|
//if partners page has a sub category such as onclive
|
|
1582
4205
|
//e.g. /sap-partner/[category]/[partner]
|
|
1583
4206
|
|
|
1584
|
-
partnerQuery = '*[_type == \'documentGroup\' && !(_id in path("drafts.**")) && identifier.current == \'' + category + '\' && references(\'' + partnerDocumentGroupID + '\')] [0] {\n ...,\n \'partner\': *[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\' && references(^._id)] [0] {\n description,\n name,\n identifier,\n thumbnail,\n twitter,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n \n }\n }';
|
|
4207
|
+
partnerQuery = '*[_type == \'documentGroup\' && !(_id in path("drafts.**")) && identifier.current == \'' + category + '\' && references(\'' + partnerDocumentGroupID + '\')] [0] {\n ...,\n \'partner\': *[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\' && references(^._id)] [0] {\n description,\n name,\n identifier,\n thumbnail,\n twitter,\n facebook,\n linkedin,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n \n }\n }';
|
|
1585
4208
|
}
|
|
1586
4209
|
|
|
1587
4210
|
taxonomyQuery = '*[_type == \'documentGroup\' \n && !(_id in path("drafts.**"))\n && references(\'' + partnerDocumentGroupID + '\')\n && isShow != false\n && identifier.current == \'' + identifier + '\'] [0] {\n \'id\': _id,\n \'title\': name\n }';
|