@mjhls/mjh-framework 1.0.854-beta.1 → 1.0.855-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/AlgoliaSearch.js +1 -1
- package/dist/cjs/ArticleProgramLandingPage.js +6 -6
- package/dist/cjs/ArticleSeriesLandingPage.js +4 -4
- package/dist/cjs/ArticleSeriesListing.js +1 -1
- package/dist/cjs/DeckContent.js +1 -1
- package/dist/cjs/DeckQueue.js +1 -1
- package/dist/cjs/ExternalResources.js +2 -2
- package/dist/cjs/GridContent.js +1 -1
- package/dist/cjs/HorizontalArticleListing.js +2 -2
- package/dist/cjs/IssueLanding.js +2 -2
- package/dist/cjs/MasterDeck.js +1 -1
- package/dist/cjs/MediaSeriesLanding.js +7 -7
- package/dist/cjs/PartnerDetailListing.js +11 -2743
- package/dist/cjs/TaxonomyDescription.js +2 -2
- package/dist/cjs/VideoProgramLandingPage.js +5 -5
- package/dist/cjs/VideoSeriesLandingPage.js +4 -4
- package/dist/cjs/VideoSeriesListing.js +1 -1
- package/dist/cjs/View.js +2 -2
- package/dist/cjs/faundadb.js +15 -15
- package/dist/cjs/getRootDocGroup.js +3 -3
- package/dist/cjs/getSerializers.js +2 -2
- package/dist/cjs/{index-276bab5c.js → index-665ed72e.js} +36 -9
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/{inherits-1f5a1c72.js → inherits-452ff02c.js} +2 -2
- package/dist/esm/ArticleProgramLandingPage.js +1 -1
- package/dist/esm/ExternalResources.js +1 -1
- package/dist/esm/HorizontalArticleListing.js +1 -1
- package/dist/esm/IssueLanding.js +1 -1
- package/dist/esm/MediaSeriesLanding.js +1 -1
- package/dist/esm/PartnerDetailListing.js +21 -2753
- package/dist/esm/TaxonomyDescription.js +1 -1
- package/dist/esm/VideoProgramLandingPage.js +1 -1
- package/dist/esm/View.js +1 -1
- package/dist/esm/getSerializers.js +1 -1
- package/dist/esm/{index-0f6867b9.js → index-8ea04db3.js} +35 -8
- package/dist/esm/index.js +1 -1
- package/package.json +1 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as createCommonjsModule, u as unwrapExports
|
|
1
|
+
import { c as createCommonjsModule, u as unwrapExports } 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';
|
|
@@ -13,7 +13,7 @@ import './define-property-8af5f002.js';
|
|
|
13
13
|
import './web.dom.iterable-4439f05a.js';
|
|
14
14
|
import './typeof-6435ba1c.js';
|
|
15
15
|
import './_is-array-58e95429.js';
|
|
16
|
-
import React__default, { Component,
|
|
16
|
+
import React__default, { Component, useRef, useState, useEffect } from 'react';
|
|
17
17
|
import './events-6c3a7a63.js';
|
|
18
18
|
import './index-41a678ea.js';
|
|
19
19
|
import PropTypes from 'prop-types';
|
|
@@ -35,7 +35,7 @@ import './main-e4a934b2.js';
|
|
|
35
35
|
import './entities-7cc3bf45.js';
|
|
36
36
|
import { _ as _slicedToArray } from './slicedToArray-641f241f.js';
|
|
37
37
|
import './stringify-4330ccdc.js';
|
|
38
|
-
import { a as _asyncToGenerator
|
|
38
|
+
import { a as _asyncToGenerator, r as regenerator, _ as _Promise } from './asyncToGenerator-fc1c2e29.js';
|
|
39
39
|
import './Segment.js';
|
|
40
40
|
import './Beam.js';
|
|
41
41
|
import './AdSlot.js';
|
|
@@ -54,7 +54,7 @@ import './timeDifferenceCalc.js';
|
|
|
54
54
|
import QueueDeckExpanded from './QueueDeckExpanded.js';
|
|
55
55
|
import './iconBase-602d52fe.js';
|
|
56
56
|
import './index.esm-29e48d38.js';
|
|
57
|
-
import { g as getSerializers } from './index-
|
|
57
|
+
import { g as getSerializers } from './index-8ea04db3.js';
|
|
58
58
|
import './util-7700fc59.js';
|
|
59
59
|
import './brightcove-react-player-loader.es-83f53e4e.js';
|
|
60
60
|
import 'next/head';
|
|
@@ -66,7 +66,7 @@ import 'react-bootstrap/Figure';
|
|
|
66
66
|
import 'react-bootstrap/OverlayTrigger';
|
|
67
67
|
import 'react-bootstrap/Tooltip';
|
|
68
68
|
import 'react-bootstrap/Popover';
|
|
69
|
-
import { _ as _defineProperty
|
|
69
|
+
import { _ as _defineProperty, b as _inherits, c as _classCallCheck, d as _possibleConstructorReturn, e as _getPrototypeOf, g as _createClass } from './inherits-77d5e4fc.js';
|
|
70
70
|
import 'react-bootstrap/Carousel';
|
|
71
71
|
import Feature from './Feature.js';
|
|
72
72
|
import 'react-bootstrap/Breadcrumb';
|
|
@@ -252,7 +252,7 @@ function (_Component) {
|
|
|
252
252
|
return TwitterTimelineEmbed;
|
|
253
253
|
}(Component);
|
|
254
254
|
|
|
255
|
-
_defineProperty
|
|
255
|
+
_defineProperty(TwitterTimelineEmbed, "propTypes", {
|
|
256
256
|
/**
|
|
257
257
|
* This can be either of profile, likes, list, collection, URL, widget
|
|
258
258
|
*/
|
|
@@ -441,7 +441,7 @@ function (_Component) {
|
|
|
441
441
|
return TwitterShareButton;
|
|
442
442
|
}(Component);
|
|
443
443
|
|
|
444
|
-
_defineProperty
|
|
444
|
+
_defineProperty(TwitterShareButton, "propTypes", {
|
|
445
445
|
/**
|
|
446
446
|
* Url for sharing
|
|
447
447
|
*/
|
|
@@ -529,7 +529,7 @@ function (_Component) {
|
|
|
529
529
|
return TwitterFollowButton;
|
|
530
530
|
}(Component);
|
|
531
531
|
|
|
532
|
-
_defineProperty
|
|
532
|
+
_defineProperty(TwitterFollowButton, "propTypes", {
|
|
533
533
|
/**
|
|
534
534
|
* Username of twitter user which will be followed on click
|
|
535
535
|
*/
|
|
@@ -617,7 +617,7 @@ function (_Component) {
|
|
|
617
617
|
return TwitterHashtagButton;
|
|
618
618
|
}(Component);
|
|
619
619
|
|
|
620
|
-
_defineProperty
|
|
620
|
+
_defineProperty(TwitterHashtagButton, "propTypes", {
|
|
621
621
|
/**
|
|
622
622
|
* Tag name for hashtag button
|
|
623
623
|
*/
|
|
@@ -705,7 +705,7 @@ function (_Component) {
|
|
|
705
705
|
return TwitterMentionButton;
|
|
706
706
|
}(Component);
|
|
707
707
|
|
|
708
|
-
_defineProperty
|
|
708
|
+
_defineProperty(TwitterMentionButton, "propTypes", {
|
|
709
709
|
/**
|
|
710
710
|
* Username to which you will need to tweet
|
|
711
711
|
*/
|
|
@@ -800,7 +800,7 @@ function (_Component) {
|
|
|
800
800
|
return TwitterTweetEmbed;
|
|
801
801
|
}(Component);
|
|
802
802
|
|
|
803
|
-
_defineProperty
|
|
803
|
+
_defineProperty(TwitterTweetEmbed, "propTypes", {
|
|
804
804
|
/**
|
|
805
805
|
* Tweet id that needs to be shown
|
|
806
806
|
*/
|
|
@@ -888,7 +888,7 @@ function (_Component) {
|
|
|
888
888
|
return TwitterMomentShare;
|
|
889
889
|
}(Component);
|
|
890
890
|
|
|
891
|
-
_defineProperty
|
|
891
|
+
_defineProperty(TwitterMomentShare, "propTypes", {
|
|
892
892
|
/**
|
|
893
893
|
* id of Twitter moment to show
|
|
894
894
|
*/
|
|
@@ -976,7 +976,7 @@ function (_Component) {
|
|
|
976
976
|
return TwitterDMButton;
|
|
977
977
|
}(Component);
|
|
978
978
|
|
|
979
|
-
_defineProperty
|
|
979
|
+
_defineProperty(TwitterDMButton, "propTypes", {
|
|
980
980
|
/**
|
|
981
981
|
* Twitter user id for DM button
|
|
982
982
|
*/
|
|
@@ -1064,7 +1064,7 @@ function (_Component) {
|
|
|
1064
1064
|
return TwitterVideoEmbed;
|
|
1065
1065
|
}(Component);
|
|
1066
1066
|
|
|
1067
|
-
_defineProperty
|
|
1067
|
+
_defineProperty(TwitterVideoEmbed, "propTypes", {
|
|
1068
1068
|
/**
|
|
1069
1069
|
* Id of video tweet.
|
|
1070
1070
|
*/
|
|
@@ -1147,7 +1147,7 @@ function (_Component) {
|
|
|
1147
1147
|
return TwitterOnAirButton;
|
|
1148
1148
|
}(Component);
|
|
1149
1149
|
|
|
1150
|
-
_defineProperty
|
|
1150
|
+
_defineProperty(TwitterOnAirButton, "propTypes", {
|
|
1151
1151
|
/**
|
|
1152
1152
|
* Username for which you require periscope on air button
|
|
1153
1153
|
*/
|
|
@@ -1169,2710 +1169,6 @@ _defineProperty$1(TwitterOnAirButton, "propTypes", {
|
|
|
1169
1169
|
onLoad: PropTypes.func
|
|
1170
1170
|
});
|
|
1171
1171
|
|
|
1172
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
1173
|
-
try {
|
|
1174
|
-
var info = gen[key](arg);
|
|
1175
|
-
var value = info.value;
|
|
1176
|
-
} catch (error) {
|
|
1177
|
-
reject(error);
|
|
1178
|
-
return;
|
|
1179
|
-
}
|
|
1180
|
-
|
|
1181
|
-
if (info.done) {
|
|
1182
|
-
resolve(value);
|
|
1183
|
-
} else {
|
|
1184
|
-
Promise.resolve(value).then(_next, _throw);
|
|
1185
|
-
}
|
|
1186
|
-
}
|
|
1187
|
-
|
|
1188
|
-
function _asyncToGenerator(fn) {
|
|
1189
|
-
return function () {
|
|
1190
|
-
var self = this,
|
|
1191
|
-
args = arguments;
|
|
1192
|
-
return new Promise(function (resolve, reject) {
|
|
1193
|
-
var gen = fn.apply(self, args);
|
|
1194
|
-
|
|
1195
|
-
function _next(value) {
|
|
1196
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
|
-
function _throw(err) {
|
|
1200
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
_next(undefined);
|
|
1204
|
-
});
|
|
1205
|
-
};
|
|
1206
|
-
}
|
|
1207
|
-
|
|
1208
|
-
var asyncToGenerator = _asyncToGenerator;
|
|
1209
|
-
|
|
1210
|
-
function _defineProperty(obj, key, value) {
|
|
1211
|
-
if (key in obj) {
|
|
1212
|
-
Object.defineProperty(obj, key, {
|
|
1213
|
-
value: value,
|
|
1214
|
-
enumerable: true,
|
|
1215
|
-
configurable: true,
|
|
1216
|
-
writable: true
|
|
1217
|
-
});
|
|
1218
|
-
} else {
|
|
1219
|
-
obj[key] = value;
|
|
1220
|
-
}
|
|
1221
|
-
|
|
1222
|
-
return obj;
|
|
1223
|
-
}
|
|
1224
|
-
|
|
1225
|
-
var defineProperty = _defineProperty;
|
|
1226
|
-
|
|
1227
|
-
var canUseDOM = !!(
|
|
1228
|
-
typeof window !== 'undefined' &&
|
|
1229
|
-
window.document &&
|
|
1230
|
-
window.document.createElement
|
|
1231
|
-
);
|
|
1232
|
-
|
|
1233
|
-
var canUseDom = canUseDOM;
|
|
1234
|
-
|
|
1235
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
1236
|
-
if (source == null) return {};
|
|
1237
|
-
var target = {};
|
|
1238
|
-
var sourceKeys = Object.keys(source);
|
|
1239
|
-
var key, i;
|
|
1240
|
-
|
|
1241
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
1242
|
-
key = sourceKeys[i];
|
|
1243
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
1244
|
-
target[key] = source[key];
|
|
1245
|
-
}
|
|
1246
|
-
|
|
1247
|
-
return target;
|
|
1248
|
-
}
|
|
1249
|
-
|
|
1250
|
-
var objectWithoutPropertiesLoose = _objectWithoutPropertiesLoose;
|
|
1251
|
-
|
|
1252
|
-
function _objectWithoutProperties(source, excluded) {
|
|
1253
|
-
if (source == null) return {};
|
|
1254
|
-
var target = objectWithoutPropertiesLoose(source, excluded);
|
|
1255
|
-
var key, i;
|
|
1256
|
-
|
|
1257
|
-
if (Object.getOwnPropertySymbols) {
|
|
1258
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
1259
|
-
|
|
1260
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
1261
|
-
key = sourceSymbolKeys[i];
|
|
1262
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
1263
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
1264
|
-
target[key] = source[key];
|
|
1265
|
-
}
|
|
1266
|
-
}
|
|
1267
|
-
|
|
1268
|
-
return target;
|
|
1269
|
-
}
|
|
1270
|
-
|
|
1271
|
-
var objectWithoutProperties = _objectWithoutProperties;
|
|
1272
|
-
|
|
1273
|
-
var LoginStatus = {
|
|
1274
|
-
CONNECTED: 'connected',
|
|
1275
|
-
AUTHORIZATION_EXPIRED: 'authorization_expired',
|
|
1276
|
-
NOT_AUTHORIZED: 'not_authorized',
|
|
1277
|
-
UNKNOWN: 'unknown'
|
|
1278
|
-
};
|
|
1279
|
-
|
|
1280
|
-
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; }
|
|
1281
|
-
|
|
1282
|
-
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; }
|
|
1283
|
-
const Method = {
|
|
1284
|
-
GET: 'get',
|
|
1285
|
-
POST: 'post',
|
|
1286
|
-
DELETE: 'delete'
|
|
1287
|
-
};
|
|
1288
|
-
class Facebook {
|
|
1289
|
-
constructor(options = {}) {
|
|
1290
|
-
this.options = _objectSpread({
|
|
1291
|
-
domain: 'connect.facebook.net',
|
|
1292
|
-
version: 'v3.2',
|
|
1293
|
-
cookie: false,
|
|
1294
|
-
status: false,
|
|
1295
|
-
xfbml: false,
|
|
1296
|
-
language: 'en_US',
|
|
1297
|
-
frictionlessRequests: false,
|
|
1298
|
-
debug: false,
|
|
1299
|
-
chatSupport: false
|
|
1300
|
-
}, options);
|
|
1301
|
-
|
|
1302
|
-
if (!this.options.appId) {
|
|
1303
|
-
throw new Error('You need to set appId');
|
|
1304
|
-
}
|
|
1305
|
-
|
|
1306
|
-
if (!this.options.wait) {
|
|
1307
|
-
this.init();
|
|
1308
|
-
}
|
|
1309
|
-
}
|
|
1310
|
-
|
|
1311
|
-
getAppId() {
|
|
1312
|
-
return this.options.appId;
|
|
1313
|
-
}
|
|
1314
|
-
|
|
1315
|
-
init() {
|
|
1316
|
-
var _this = this;
|
|
1317
|
-
|
|
1318
|
-
return asyncToGenerator(function* () {
|
|
1319
|
-
if (_this.loadingPromise) {
|
|
1320
|
-
return _this.loadingPromise;
|
|
1321
|
-
}
|
|
1322
|
-
|
|
1323
|
-
_this.loadingPromise = new Promise(resolve => {
|
|
1324
|
-
const _this$options = _this.options,
|
|
1325
|
-
{
|
|
1326
|
-
domain,
|
|
1327
|
-
language,
|
|
1328
|
-
debug,
|
|
1329
|
-
chatSupport
|
|
1330
|
-
} = _this$options,
|
|
1331
|
-
restOptions = objectWithoutProperties(_this$options, ["domain", "language", "debug", "chatSupport"]);
|
|
1332
|
-
|
|
1333
|
-
window.fbAsyncInit = () => {
|
|
1334
|
-
window.FB.init({
|
|
1335
|
-
appId: restOptions.appId,
|
|
1336
|
-
version: restOptions.version,
|
|
1337
|
-
cookie: restOptions.cookie,
|
|
1338
|
-
status: restOptions.status,
|
|
1339
|
-
xfbml: restOptions.xfbml,
|
|
1340
|
-
frictionlessRequests: _this.frictionlessRequests
|
|
1341
|
-
});
|
|
1342
|
-
resolve(window.FB);
|
|
1343
|
-
};
|
|
1344
|
-
|
|
1345
|
-
if (window.document.getElementById('facebook-jssdk')) {
|
|
1346
|
-
return resolve(window.FB);
|
|
1347
|
-
}
|
|
1348
|
-
|
|
1349
|
-
const js = window.document.createElement('script');
|
|
1350
|
-
js.id = 'facebook-jssdk';
|
|
1351
|
-
js.async = true;
|
|
1352
|
-
js.defer = true;
|
|
1353
|
-
js.src = `https://${domain}/${language}/sdk${chatSupport ? '/xfbml.customerchat' : ''}${debug ? '/debug' : ''}.js`;
|
|
1354
|
-
window.document.body.appendChild(js);
|
|
1355
|
-
});
|
|
1356
|
-
return _this.loadingPromise;
|
|
1357
|
-
})();
|
|
1358
|
-
}
|
|
1359
|
-
|
|
1360
|
-
process(method, before = [], after = []) {
|
|
1361
|
-
var _this2 = this;
|
|
1362
|
-
|
|
1363
|
-
return asyncToGenerator(function* () {
|
|
1364
|
-
const fb = yield _this2.init();
|
|
1365
|
-
return new Promise((resolve, reject) => {
|
|
1366
|
-
fb[method](...before, response => {
|
|
1367
|
-
if (!response) {
|
|
1368
|
-
if (method === 'ui') return;
|
|
1369
|
-
reject(new Error('Response is undefined'));
|
|
1370
|
-
} else if (response.error) {
|
|
1371
|
-
const {
|
|
1372
|
-
code,
|
|
1373
|
-
type,
|
|
1374
|
-
message
|
|
1375
|
-
} = response.error;
|
|
1376
|
-
const error = new Error(message);
|
|
1377
|
-
error.code = code;
|
|
1378
|
-
error.type = type;
|
|
1379
|
-
reject(error);
|
|
1380
|
-
} else {
|
|
1381
|
-
resolve(response);
|
|
1382
|
-
}
|
|
1383
|
-
}, ...after);
|
|
1384
|
-
});
|
|
1385
|
-
})();
|
|
1386
|
-
}
|
|
1387
|
-
|
|
1388
|
-
ui(options) {
|
|
1389
|
-
var _this3 = this;
|
|
1390
|
-
|
|
1391
|
-
return asyncToGenerator(function* () {
|
|
1392
|
-
return _this3.process('ui', [options]);
|
|
1393
|
-
})();
|
|
1394
|
-
}
|
|
1395
|
-
|
|
1396
|
-
api(path, method = Method.GET, params = {}) {
|
|
1397
|
-
var _this4 = this;
|
|
1398
|
-
|
|
1399
|
-
return asyncToGenerator(function* () {
|
|
1400
|
-
return _this4.process('api', [path, method, params]);
|
|
1401
|
-
})();
|
|
1402
|
-
}
|
|
1403
|
-
|
|
1404
|
-
login(opts = null) {
|
|
1405
|
-
var _this5 = this;
|
|
1406
|
-
|
|
1407
|
-
return asyncToGenerator(function* () {
|
|
1408
|
-
return _this5.process('login', [], [opts]);
|
|
1409
|
-
})();
|
|
1410
|
-
}
|
|
1411
|
-
|
|
1412
|
-
logout() {
|
|
1413
|
-
var _this6 = this;
|
|
1414
|
-
|
|
1415
|
-
return asyncToGenerator(function* () {
|
|
1416
|
-
return _this6.process('logout');
|
|
1417
|
-
})();
|
|
1418
|
-
}
|
|
1419
|
-
|
|
1420
|
-
getLoginStatus() {
|
|
1421
|
-
var _this7 = this;
|
|
1422
|
-
|
|
1423
|
-
return asyncToGenerator(function* () {
|
|
1424
|
-
return _this7.process('getLoginStatus');
|
|
1425
|
-
})();
|
|
1426
|
-
}
|
|
1427
|
-
|
|
1428
|
-
getAuthResponse() {
|
|
1429
|
-
var _this8 = this;
|
|
1430
|
-
|
|
1431
|
-
return asyncToGenerator(function* () {
|
|
1432
|
-
return _this8.process('getAuthResponse');
|
|
1433
|
-
})();
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
getTokenDetail(loginResponse) {
|
|
1437
|
-
var _this9 = this;
|
|
1438
|
-
|
|
1439
|
-
return asyncToGenerator(function* () {
|
|
1440
|
-
if (loginResponse.status === LoginStatus.CONNECTED && loginResponse.authResponse) {
|
|
1441
|
-
return loginResponse.authResponse;
|
|
1442
|
-
}
|
|
1443
|
-
|
|
1444
|
-
const response = yield _this9.getLoginStatus();
|
|
1445
|
-
|
|
1446
|
-
if (response.status === LoginStatus.CONNECTED && response.authResponse) {
|
|
1447
|
-
return response.authResponse;
|
|
1448
|
-
}
|
|
1449
|
-
|
|
1450
|
-
throw new Error('Token is undefined');
|
|
1451
|
-
})();
|
|
1452
|
-
}
|
|
1453
|
-
|
|
1454
|
-
getProfile(params) {
|
|
1455
|
-
var _this10 = this;
|
|
1456
|
-
|
|
1457
|
-
return asyncToGenerator(function* () {
|
|
1458
|
-
return _this10.api('/me', Method.GET, params);
|
|
1459
|
-
})();
|
|
1460
|
-
}
|
|
1461
|
-
|
|
1462
|
-
getTokenDetailWithProfile(params, response) {
|
|
1463
|
-
var _this11 = this;
|
|
1464
|
-
|
|
1465
|
-
return asyncToGenerator(function* () {
|
|
1466
|
-
const tokenDetail = yield _this11.getTokenDetail(response);
|
|
1467
|
-
const profile = yield _this11.getProfile(params);
|
|
1468
|
-
return {
|
|
1469
|
-
profile,
|
|
1470
|
-
tokenDetail
|
|
1471
|
-
};
|
|
1472
|
-
})();
|
|
1473
|
-
}
|
|
1474
|
-
|
|
1475
|
-
getToken() {
|
|
1476
|
-
var _this12 = this;
|
|
1477
|
-
|
|
1478
|
-
return asyncToGenerator(function* () {
|
|
1479
|
-
const authResponse = yield _this12.getTokenDetail();
|
|
1480
|
-
return authResponse.accessToken;
|
|
1481
|
-
})();
|
|
1482
|
-
}
|
|
1483
|
-
|
|
1484
|
-
getUserId() {
|
|
1485
|
-
var _this13 = this;
|
|
1486
|
-
|
|
1487
|
-
return asyncToGenerator(function* () {
|
|
1488
|
-
const authResponse = yield _this13.getTokenDetail();
|
|
1489
|
-
return authResponse.userID;
|
|
1490
|
-
})();
|
|
1491
|
-
}
|
|
1492
|
-
|
|
1493
|
-
sendInvite(to, options) {
|
|
1494
|
-
var _this14 = this;
|
|
1495
|
-
|
|
1496
|
-
return asyncToGenerator(function* () {
|
|
1497
|
-
return _this14.ui(_objectSpread({
|
|
1498
|
-
to,
|
|
1499
|
-
method: 'apprequests'
|
|
1500
|
-
}, options));
|
|
1501
|
-
})();
|
|
1502
|
-
}
|
|
1503
|
-
|
|
1504
|
-
postAction(ogNamespace, ogAction, ogObject, ogObjectUrl, noFeedStory) {
|
|
1505
|
-
var _this15 = this;
|
|
1506
|
-
|
|
1507
|
-
return asyncToGenerator(function* () {
|
|
1508
|
-
let url = `/me/${ogNamespace}:${ogAction}?${ogObject}=${encodeURIComponent(ogObjectUrl)}`;
|
|
1509
|
-
|
|
1510
|
-
if (noFeedStory === true) {
|
|
1511
|
-
url += '&no_feed_story=true';
|
|
1512
|
-
}
|
|
1513
|
-
|
|
1514
|
-
return _this15.api(url, Method.POST);
|
|
1515
|
-
})();
|
|
1516
|
-
}
|
|
1517
|
-
|
|
1518
|
-
getPermissions() {
|
|
1519
|
-
var _this16 = this;
|
|
1520
|
-
|
|
1521
|
-
return asyncToGenerator(function* () {
|
|
1522
|
-
const response = yield _this16.api('/me/permissions');
|
|
1523
|
-
return response.data;
|
|
1524
|
-
})();
|
|
1525
|
-
}
|
|
1526
|
-
|
|
1527
|
-
hasPermissions(permissions) {
|
|
1528
|
-
var _this17 = this;
|
|
1529
|
-
|
|
1530
|
-
return asyncToGenerator(function* () {
|
|
1531
|
-
const usersPermissions = yield _this17.getPermissions();
|
|
1532
|
-
const findedPermissions = permissions.filter(p => {
|
|
1533
|
-
const currentPermission = usersPermissions.find(row => {
|
|
1534
|
-
const {
|
|
1535
|
-
permission,
|
|
1536
|
-
status
|
|
1537
|
-
} = row;
|
|
1538
|
-
return status === 'granted' && permission === p;
|
|
1539
|
-
});
|
|
1540
|
-
return !!currentPermission;
|
|
1541
|
-
});
|
|
1542
|
-
return findedPermissions.length === permissions.length;
|
|
1543
|
-
})();
|
|
1544
|
-
}
|
|
1545
|
-
|
|
1546
|
-
subscribe(eventName, callback) {
|
|
1547
|
-
var _this18 = this;
|
|
1548
|
-
|
|
1549
|
-
return asyncToGenerator(function* () {
|
|
1550
|
-
const fb = yield _this18.init();
|
|
1551
|
-
fb.Event.subscribe(eventName, callback);
|
|
1552
|
-
})();
|
|
1553
|
-
}
|
|
1554
|
-
|
|
1555
|
-
unsubscribe(eventName, callback) {
|
|
1556
|
-
var _this19 = this;
|
|
1557
|
-
|
|
1558
|
-
return asyncToGenerator(function* () {
|
|
1559
|
-
const fb = yield _this19.init();
|
|
1560
|
-
fb.Event.unsubscribe(eventName, callback);
|
|
1561
|
-
})();
|
|
1562
|
-
}
|
|
1563
|
-
|
|
1564
|
-
parse(parentNode) {
|
|
1565
|
-
var _this20 = this;
|
|
1566
|
-
|
|
1567
|
-
return asyncToGenerator(function* () {
|
|
1568
|
-
const fb = yield _this20.init();
|
|
1569
|
-
|
|
1570
|
-
if (typeof parentNode === 'undefined') {
|
|
1571
|
-
fb.XFBML.parse();
|
|
1572
|
-
} else {
|
|
1573
|
-
fb.XFBML.parse(parentNode);
|
|
1574
|
-
}
|
|
1575
|
-
})();
|
|
1576
|
-
}
|
|
1577
|
-
|
|
1578
|
-
getRequests() {
|
|
1579
|
-
var _this21 = this;
|
|
1580
|
-
|
|
1581
|
-
return asyncToGenerator(function* () {
|
|
1582
|
-
return _this21.api('/me/apprequests');
|
|
1583
|
-
})();
|
|
1584
|
-
}
|
|
1585
|
-
|
|
1586
|
-
removeRequest(requestID) {
|
|
1587
|
-
var _this22 = this;
|
|
1588
|
-
|
|
1589
|
-
return asyncToGenerator(function* () {
|
|
1590
|
-
return _this22.api(requestID, Method.DELETE);
|
|
1591
|
-
})();
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
|
-
setAutoGrow() {
|
|
1595
|
-
var _this23 = this;
|
|
1596
|
-
|
|
1597
|
-
return asyncToGenerator(function* () {
|
|
1598
|
-
const fb = yield _this23.init();
|
|
1599
|
-
fb.Canvas.setAutoGrow();
|
|
1600
|
-
})();
|
|
1601
|
-
}
|
|
1602
|
-
|
|
1603
|
-
paySimple(product, quantity = 1) {
|
|
1604
|
-
var _this24 = this;
|
|
1605
|
-
|
|
1606
|
-
return asyncToGenerator(function* () {
|
|
1607
|
-
return _this24.ui({
|
|
1608
|
-
method: 'pay',
|
|
1609
|
-
action: 'purchaseitem',
|
|
1610
|
-
product,
|
|
1611
|
-
quantity
|
|
1612
|
-
});
|
|
1613
|
-
})();
|
|
1614
|
-
}
|
|
1615
|
-
|
|
1616
|
-
pay(product, options) {
|
|
1617
|
-
var _this25 = this;
|
|
1618
|
-
|
|
1619
|
-
return asyncToGenerator(function* () {
|
|
1620
|
-
return _this25.ui(_objectSpread({
|
|
1621
|
-
method: 'pay',
|
|
1622
|
-
action: 'purchaseitem',
|
|
1623
|
-
product
|
|
1624
|
-
}, options));
|
|
1625
|
-
})();
|
|
1626
|
-
}
|
|
1627
|
-
|
|
1628
|
-
}
|
|
1629
|
-
/*
|
|
1630
|
-
sendToFriends: function(options, callback) {
|
|
1631
|
-
if(!options) {
|
|
1632
|
-
options = {};
|
|
1633
|
-
}
|
|
1634
|
-
|
|
1635
|
-
options.method = 'send';
|
|
1636
|
-
|
|
1637
|
-
this.afterLoad(function(err, fbApi) {
|
|
1638
|
-
if(err) {
|
|
1639
|
-
return callback(err);
|
|
1640
|
-
}
|
|
1641
|
-
|
|
1642
|
-
FB.ui(options, function(response) {
|
|
1643
|
-
fbApi._callCallbackByResponse(callback, response);
|
|
1644
|
-
});
|
|
1645
|
-
});
|
|
1646
|
-
},
|
|
1647
|
-
|
|
1648
|
-
sendMessage: function(message, name, caption, description, url, imgUrl, callback) {
|
|
1649
|
-
this.afterLoad(function(err, fbApi) {
|
|
1650
|
-
if(err) {
|
|
1651
|
-
return callback(err);
|
|
1652
|
-
}
|
|
1653
|
-
|
|
1654
|
-
FB.ui({
|
|
1655
|
-
method: 'stream.publish',
|
|
1656
|
-
message: message,
|
|
1657
|
-
attachment: {
|
|
1658
|
-
name: name,
|
|
1659
|
-
caption: caption,
|
|
1660
|
-
description: description,
|
|
1661
|
-
href: url,
|
|
1662
|
-
media:[{
|
|
1663
|
-
type: 'image',
|
|
1664
|
-
src: imgUrl,
|
|
1665
|
-
href: url
|
|
1666
|
-
}]
|
|
1667
|
-
},
|
|
1668
|
-
action_links: [{
|
|
1669
|
-
text: 'Code',
|
|
1670
|
-
href: url
|
|
1671
|
-
}],
|
|
1672
|
-
user_prompt_message: message
|
|
1673
|
-
},
|
|
1674
|
-
function(response) {
|
|
1675
|
-
fbApi._callCallbackByResponse(callback, response);
|
|
1676
|
-
});
|
|
1677
|
-
});
|
|
1678
|
-
},
|
|
1679
|
-
|
|
1680
|
-
sendInviteForm: function(options, callback) {
|
|
1681
|
-
if(typeof options === 'function') {
|
|
1682
|
-
callback = options;
|
|
1683
|
-
options = {};
|
|
1684
|
-
}
|
|
1685
|
-
|
|
1686
|
-
this.afterLoad(function(err, fbApi) {
|
|
1687
|
-
if(err) {
|
|
1688
|
-
return callback(err);
|
|
1689
|
-
}
|
|
1690
|
-
|
|
1691
|
-
options.method = options.method || 'apprequests';
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
FB.ui(options, function(response) {
|
|
1695
|
-
fbApi._callCallbackByResponse(callback, response);
|
|
1696
|
-
});
|
|
1697
|
-
});
|
|
1698
|
-
},
|
|
1699
|
-
|
|
1700
|
-
checkPageLike: function(pageID, callback) {
|
|
1701
|
-
this.afterLoad(function(err, fbApi) {
|
|
1702
|
-
if(err) {
|
|
1703
|
-
return callback(err);
|
|
1704
|
-
}
|
|
1705
|
-
|
|
1706
|
-
fbApi.getUserID(function(err, userID) {
|
|
1707
|
-
if(err) {
|
|
1708
|
-
return callback(err);
|
|
1709
|
-
}
|
|
1710
|
-
|
|
1711
|
-
var fqlQuery = `SELECT uid FROM page_fan WHERE page_id = ${pageID} and uid = ${userID}`;
|
|
1712
|
-
var query = FB.Data.query(fqlQuery);
|
|
1713
|
-
|
|
1714
|
-
query.wait(function(rows) {
|
|
1715
|
-
if (rows.length === 1 && rows[0].uid === userID) {
|
|
1716
|
-
callback(null, true, query);
|
|
1717
|
-
}
|
|
1718
|
-
else {
|
|
1719
|
-
callback(null, false, query);
|
|
1720
|
-
}
|
|
1721
|
-
});
|
|
1722
|
-
});
|
|
1723
|
-
});
|
|
1724
|
-
},
|
|
1725
|
-
|
|
1726
|
-
sendMessageToFriend: function (friendID, link, callback) {
|
|
1727
|
-
this.afterLoad(function(err, fbApi) {
|
|
1728
|
-
if(err) {
|
|
1729
|
-
return callback(err);
|
|
1730
|
-
}
|
|
1731
|
-
|
|
1732
|
-
FB.ui({
|
|
1733
|
-
to: friendID,
|
|
1734
|
-
method: 'send',
|
|
1735
|
-
link: link
|
|
1736
|
-
}, function(response) {
|
|
1737
|
-
fbApi._callCallbackByResponse(callback, response);
|
|
1738
|
-
});
|
|
1739
|
-
});
|
|
1740
|
-
},
|
|
1741
|
-
|
|
1742
|
-
_prepareUsers: function(data) {
|
|
1743
|
-
var users=[];
|
|
1744
|
-
|
|
1745
|
-
for(var index in data) {
|
|
1746
|
-
var userData=data[index];
|
|
1747
|
-
|
|
1748
|
-
var user = {
|
|
1749
|
-
provider_uid: 'facebook'+'_'+userData.uid,
|
|
1750
|
-
provider: 'facebook',
|
|
1751
|
-
id: userData.uid,
|
|
1752
|
-
name: userData.name,
|
|
1753
|
-
first_name: userData.first_name,
|
|
1754
|
-
last_name: userData.last_name,
|
|
1755
|
-
status: (userData.status!==null) ? userData.status : null,
|
|
1756
|
-
image: '//graph.facebook.com/'+userData.uid+'/picture?'
|
|
1757
|
-
};
|
|
1758
|
-
|
|
1759
|
-
users.push(user);
|
|
1760
|
-
}
|
|
1761
|
-
|
|
1762
|
-
return users;
|
|
1763
|
-
},
|
|
1764
|
-
|
|
1765
|
-
getUserList: function(callback) {
|
|
1766
|
-
this.afterLoad(function(err, fbApi) {
|
|
1767
|
-
if(err) {
|
|
1768
|
-
return callback(err);
|
|
1769
|
-
}
|
|
1770
|
-
|
|
1771
|
-
FB.api('fql', {
|
|
1772
|
-
q: `
|
|
1773
|
-
SELECT uid, name, first_name, last_name, online_presence, status
|
|
1774
|
-
FROM user
|
|
1775
|
-
WHERE uid IN
|
|
1776
|
-
( SELECT uid2 FROM friend WHERE uid1 = me()) ORDER BY name
|
|
1777
|
-
`,
|
|
1778
|
-
}, function (response)
|
|
1779
|
-
{
|
|
1780
|
-
var users = fbApi._prepareUsers(response.data);
|
|
1781
|
-
callback(null, users, response);
|
|
1782
|
-
});
|
|
1783
|
-
});
|
|
1784
|
-
},
|
|
1785
|
-
|
|
1786
|
-
postFeed: function(options, callback) {
|
|
1787
|
-
this.afterLoad(function(err, fbApi) {
|
|
1788
|
-
if(err) {
|
|
1789
|
-
return callback(err);
|
|
1790
|
-
}
|
|
1791
|
-
|
|
1792
|
-
options.method='feed';
|
|
1793
|
-
|
|
1794
|
-
FB.ui(options, function(response) {
|
|
1795
|
-
fbApi._callCallbackByResponse(callback, response);
|
|
1796
|
-
});
|
|
1797
|
-
});
|
|
1798
|
-
},
|
|
1799
|
-
|
|
1800
|
-
//need publish_stream
|
|
1801
|
-
createAlbum: function(name, description, callback) {
|
|
1802
|
-
this.afterLoad(function(err, fbApi) {
|
|
1803
|
-
if(err) {
|
|
1804
|
-
return callback(err);
|
|
1805
|
-
}
|
|
1806
|
-
|
|
1807
|
-
FB.api('/me/albums', 'post', {
|
|
1808
|
-
name: name,
|
|
1809
|
-
description: description
|
|
1810
|
-
},function(response) {
|
|
1811
|
-
fbApi._callCallbackByResponse(callback, response);
|
|
1812
|
-
});
|
|
1813
|
-
});
|
|
1814
|
-
},
|
|
1815
|
-
|
|
1816
|
-
//need publish_stream
|
|
1817
|
-
addImageToAlbum: function(albumID, imageURL, message, callback) {
|
|
1818
|
-
this.afterLoad(function(err, fbApi) {
|
|
1819
|
-
if(err) {
|
|
1820
|
-
return callback(err);
|
|
1821
|
-
}
|
|
1822
|
-
|
|
1823
|
-
FB.api('/'+albumID+'/photos', 'post', {
|
|
1824
|
-
message: message,
|
|
1825
|
-
url: imageURL
|
|
1826
|
-
}, function(response) {
|
|
1827
|
-
fbApi._callCallbackByResponse(callback, response);
|
|
1828
|
-
});
|
|
1829
|
-
});
|
|
1830
|
-
},
|
|
1831
|
-
|
|
1832
|
-
//'user_photos'
|
|
1833
|
-
getAlbums: function(callback) {
|
|
1834
|
-
this.afterLoad(function(err, fbApi) {
|
|
1835
|
-
if(err) {
|
|
1836
|
-
return callback(err);
|
|
1837
|
-
}
|
|
1838
|
-
|
|
1839
|
-
FB.api('/me/albums', function(response) {
|
|
1840
|
-
fbApi._callCallbackByResponse(callback, response);
|
|
1841
|
-
});
|
|
1842
|
-
});
|
|
1843
|
-
},
|
|
1844
|
-
|
|
1845
|
-
//'user_photos'
|
|
1846
|
-
getAlbumPhotos: function(albumID, callback) {
|
|
1847
|
-
this.afterLoad(function(err, fbApi) {
|
|
1848
|
-
if(err) {
|
|
1849
|
-
return callback(err);
|
|
1850
|
-
}
|
|
1851
|
-
|
|
1852
|
-
FB.api('/'+albumID+'/photos', function(response) {
|
|
1853
|
-
fbApi._callCallbackByResponse(callback, response);
|
|
1854
|
-
});
|
|
1855
|
-
});
|
|
1856
|
-
},
|
|
1857
|
-
|
|
1858
|
-
//'user_photos'
|
|
1859
|
-
getAlbumCoverPicture: function(albumID, callback) {
|
|
1860
|
-
this.afterLoad(function(err, fbApi) {
|
|
1861
|
-
if(err) {
|
|
1862
|
-
return callback(err);
|
|
1863
|
-
}
|
|
1864
|
-
|
|
1865
|
-
FB.api('/'+albumID+'/picture', function(response) {
|
|
1866
|
-
fbApi._callCallbackByResponse(callback, response);
|
|
1867
|
-
});
|
|
1868
|
-
});
|
|
1869
|
-
},
|
|
1870
|
-
|
|
1871
|
-
//'publish_stream'
|
|
1872
|
-
postPhoto: function(photoUrl, message, callback) {
|
|
1873
|
-
this.afterLoad(function(err, fbApi) {
|
|
1874
|
-
if(err) {
|
|
1875
|
-
return callback(err);
|
|
1876
|
-
}
|
|
1877
|
-
|
|
1878
|
-
FB.api('/me/photos', 'post', {
|
|
1879
|
-
message: message,
|
|
1880
|
-
url: photoUrl
|
|
1881
|
-
},function(response) {
|
|
1882
|
-
fbApi._callCallbackByResponse(callback, response);
|
|
1883
|
-
});
|
|
1884
|
-
});
|
|
1885
|
-
},
|
|
1886
|
-
|
|
1887
|
-
getPageInfo: function(callback) {
|
|
1888
|
-
this.afterLoad(function(err, fbApi) {
|
|
1889
|
-
if(err) {
|
|
1890
|
-
return callback(err);
|
|
1891
|
-
}
|
|
1892
|
-
|
|
1893
|
-
FB.Canvas.getPageInfo(function(response) {
|
|
1894
|
-
fbApi._callCallbackByResponse(callback, response);
|
|
1895
|
-
});
|
|
1896
|
-
});
|
|
1897
|
-
}
|
|
1898
|
-
*/
|
|
1899
|
-
|
|
1900
|
-
var FacebookContext = createContext();
|
|
1901
|
-
|
|
1902
|
-
let api = null;
|
|
1903
|
-
class Facebook$1 extends Component {
|
|
1904
|
-
constructor(...args) {
|
|
1905
|
-
var _this;
|
|
1906
|
-
|
|
1907
|
-
super(...args);
|
|
1908
|
-
_this = this;
|
|
1909
|
-
|
|
1910
|
-
defineProperty(this, "state", {
|
|
1911
|
-
isReady: false
|
|
1912
|
-
});
|
|
1913
|
-
|
|
1914
|
-
defineProperty(this, "handleInit",
|
|
1915
|
-
/*#__PURE__*/
|
|
1916
|
-
asyncToGenerator(function* () {
|
|
1917
|
-
// do not run if SSR
|
|
1918
|
-
if (!canUseDom) {
|
|
1919
|
-
throw new Error('You can not use Facebook without DOM');
|
|
1920
|
-
}
|
|
1921
|
-
|
|
1922
|
-
const {
|
|
1923
|
-
isReady
|
|
1924
|
-
} = _this.state;
|
|
1925
|
-
|
|
1926
|
-
if (isReady) {
|
|
1927
|
-
return api;
|
|
1928
|
-
}
|
|
1929
|
-
|
|
1930
|
-
if (!api) {
|
|
1931
|
-
const {
|
|
1932
|
-
domain,
|
|
1933
|
-
version,
|
|
1934
|
-
appId,
|
|
1935
|
-
cookie,
|
|
1936
|
-
status,
|
|
1937
|
-
xfbml,
|
|
1938
|
-
language,
|
|
1939
|
-
frictionlessRequests,
|
|
1940
|
-
wait,
|
|
1941
|
-
debug,
|
|
1942
|
-
chatSupport
|
|
1943
|
-
} = _this.props;
|
|
1944
|
-
api = new Facebook({
|
|
1945
|
-
domain,
|
|
1946
|
-
appId,
|
|
1947
|
-
version,
|
|
1948
|
-
cookie,
|
|
1949
|
-
status,
|
|
1950
|
-
xfbml,
|
|
1951
|
-
language,
|
|
1952
|
-
frictionlessRequests,
|
|
1953
|
-
wait,
|
|
1954
|
-
debug,
|
|
1955
|
-
chatSupport
|
|
1956
|
-
});
|
|
1957
|
-
}
|
|
1958
|
-
|
|
1959
|
-
yield api.init();
|
|
1960
|
-
|
|
1961
|
-
if (!_this.state.isReady) {
|
|
1962
|
-
_this.setState({
|
|
1963
|
-
isReady: true
|
|
1964
|
-
});
|
|
1965
|
-
}
|
|
1966
|
-
|
|
1967
|
-
return api;
|
|
1968
|
-
}));
|
|
1969
|
-
}
|
|
1970
|
-
|
|
1971
|
-
componentDidMount() {
|
|
1972
|
-
const {
|
|
1973
|
-
wait
|
|
1974
|
-
} = this.props;
|
|
1975
|
-
|
|
1976
|
-
if (!wait) {
|
|
1977
|
-
this.handleInit();
|
|
1978
|
-
}
|
|
1979
|
-
}
|
|
1980
|
-
|
|
1981
|
-
render() {
|
|
1982
|
-
const {
|
|
1983
|
-
children
|
|
1984
|
-
} = this.props;
|
|
1985
|
-
const {
|
|
1986
|
-
isReady,
|
|
1987
|
-
error
|
|
1988
|
-
} = this.state;
|
|
1989
|
-
const {
|
|
1990
|
-
handleInit
|
|
1991
|
-
} = this;
|
|
1992
|
-
const value = {
|
|
1993
|
-
isReady,
|
|
1994
|
-
error,
|
|
1995
|
-
handleInit,
|
|
1996
|
-
api
|
|
1997
|
-
};
|
|
1998
|
-
return React__default.createElement(FacebookContext.Provider, {
|
|
1999
|
-
value: value
|
|
2000
|
-
}, children);
|
|
2001
|
-
}
|
|
2002
|
-
|
|
2003
|
-
}
|
|
2004
|
-
|
|
2005
|
-
defineProperty(Facebook$1, "defaultProps", {
|
|
2006
|
-
version: 'v3.1',
|
|
2007
|
-
cookie: false,
|
|
2008
|
-
status: false,
|
|
2009
|
-
xfbml: false,
|
|
2010
|
-
language: 'en_US',
|
|
2011
|
-
frictionlessRequests: false,
|
|
2012
|
-
domain: 'connect.facebook.net',
|
|
2013
|
-
children: undefined,
|
|
2014
|
-
wait: false,
|
|
2015
|
-
debug: false,
|
|
2016
|
-
chatSupport: false
|
|
2017
|
-
});
|
|
2018
|
-
|
|
2019
|
-
var _extends_1 = createCommonjsModule(function (module) {
|
|
2020
|
-
function _extends() {
|
|
2021
|
-
module.exports = _extends = Object.assign || function (target) {
|
|
2022
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
2023
|
-
var source = arguments[i];
|
|
2024
|
-
|
|
2025
|
-
for (var key in source) {
|
|
2026
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2027
|
-
target[key] = source[key];
|
|
2028
|
-
}
|
|
2029
|
-
}
|
|
2030
|
-
}
|
|
2031
|
-
|
|
2032
|
-
return target;
|
|
2033
|
-
};
|
|
2034
|
-
|
|
2035
|
-
return _extends.apply(this, arguments);
|
|
2036
|
-
}
|
|
2037
|
-
|
|
2038
|
-
module.exports = _extends;
|
|
2039
|
-
});
|
|
2040
|
-
|
|
2041
|
-
class Initialize extends Component {
|
|
2042
|
-
componentDidMount() {
|
|
2043
|
-
this.$isMounted = true;
|
|
2044
|
-
this.prepare();
|
|
2045
|
-
}
|
|
2046
|
-
|
|
2047
|
-
componentWillUnmount() {
|
|
2048
|
-
this.$isMounted = false;
|
|
2049
|
-
}
|
|
2050
|
-
|
|
2051
|
-
prepare() {
|
|
2052
|
-
var _this = this;
|
|
2053
|
-
|
|
2054
|
-
return asyncToGenerator(function* () {
|
|
2055
|
-
const {
|
|
2056
|
-
onReady,
|
|
2057
|
-
handleInit
|
|
2058
|
-
} = _this.props;
|
|
2059
|
-
const api = yield handleInit();
|
|
2060
|
-
|
|
2061
|
-
if (onReady && _this.$isMounted) {
|
|
2062
|
-
onReady(api);
|
|
2063
|
-
}
|
|
2064
|
-
})();
|
|
2065
|
-
}
|
|
2066
|
-
|
|
2067
|
-
render() {
|
|
2068
|
-
const {
|
|
2069
|
-
children,
|
|
2070
|
-
isReady,
|
|
2071
|
-
api
|
|
2072
|
-
} = this.props;
|
|
2073
|
-
const childrenProps = {
|
|
2074
|
-
isReady,
|
|
2075
|
-
api
|
|
2076
|
-
};
|
|
2077
|
-
|
|
2078
|
-
if (typeof children === 'function') {
|
|
2079
|
-
return children(childrenProps);
|
|
2080
|
-
}
|
|
2081
|
-
|
|
2082
|
-
return children;
|
|
2083
|
-
}
|
|
2084
|
-
|
|
2085
|
-
}
|
|
2086
|
-
|
|
2087
|
-
defineProperty(Initialize, "defaultProps", {
|
|
2088
|
-
onReady: undefined,
|
|
2089
|
-
api: undefined
|
|
2090
|
-
});
|
|
2091
|
-
|
|
2092
|
-
var Initialize$1 = forwardRef((props, ref) => React__default.createElement(FacebookContext.Consumer, null, ({
|
|
2093
|
-
handleInit,
|
|
2094
|
-
isReady,
|
|
2095
|
-
api
|
|
2096
|
-
}) => React__default.createElement(Initialize, _extends_1({}, props, {
|
|
2097
|
-
handleInit: handleInit,
|
|
2098
|
-
isReady: isReady,
|
|
2099
|
-
api: api,
|
|
2100
|
-
ref: ref
|
|
2101
|
-
}))));
|
|
2102
|
-
|
|
2103
|
-
class Parser extends Component {
|
|
2104
|
-
constructor(...args) {
|
|
2105
|
-
super(...args);
|
|
2106
|
-
|
|
2107
|
-
defineProperty(this, "state", {});
|
|
2108
|
-
|
|
2109
|
-
defineProperty(this, "handleReady", api => {
|
|
2110
|
-
this.setState({
|
|
2111
|
-
api
|
|
2112
|
-
}, this.handleParse);
|
|
2113
|
-
});
|
|
2114
|
-
|
|
2115
|
-
defineProperty(this, "handleContainer", container => {
|
|
2116
|
-
this.setState({
|
|
2117
|
-
container
|
|
2118
|
-
}, this.handleParse);
|
|
2119
|
-
});
|
|
2120
|
-
|
|
2121
|
-
defineProperty(this, "handleParse", () => {
|
|
2122
|
-
const {
|
|
2123
|
-
api,
|
|
2124
|
-
container
|
|
2125
|
-
} = this.state;
|
|
2126
|
-
|
|
2127
|
-
if (!api || !container) {
|
|
2128
|
-
return;
|
|
2129
|
-
}
|
|
2130
|
-
|
|
2131
|
-
api.parse(container);
|
|
2132
|
-
});
|
|
2133
|
-
}
|
|
2134
|
-
|
|
2135
|
-
render() {
|
|
2136
|
-
const {
|
|
2137
|
-
className,
|
|
2138
|
-
children
|
|
2139
|
-
} = this.props;
|
|
2140
|
-
return React__default.createElement("div", {
|
|
2141
|
-
className: className,
|
|
2142
|
-
ref: this.handleContainer
|
|
2143
|
-
}, React__default.createElement(Initialize$1, {
|
|
2144
|
-
onReady: this.handleReady
|
|
2145
|
-
}, children({
|
|
2146
|
-
handleParse: this.handleParse
|
|
2147
|
-
})));
|
|
2148
|
-
}
|
|
2149
|
-
|
|
2150
|
-
}
|
|
2151
|
-
|
|
2152
|
-
defineProperty(Parser, "defaultProps", {
|
|
2153
|
-
className: undefined
|
|
2154
|
-
});
|
|
2155
|
-
|
|
2156
|
-
function getCurrentHref() {
|
|
2157
|
-
if (!canUseDom) {
|
|
2158
|
-
return 'https://www.facebook.com';
|
|
2159
|
-
}
|
|
2160
|
-
|
|
2161
|
-
return window.location.href;
|
|
2162
|
-
}
|
|
2163
|
-
|
|
2164
|
-
class Like extends PureComponent {
|
|
2165
|
-
componentDidUpdate() {
|
|
2166
|
-
const {
|
|
2167
|
-
handleParse
|
|
2168
|
-
} = this.props;
|
|
2169
|
-
handleParse();
|
|
2170
|
-
}
|
|
2171
|
-
|
|
2172
|
-
render() {
|
|
2173
|
-
const {
|
|
2174
|
-
href = getCurrentHref(),
|
|
2175
|
-
layout,
|
|
2176
|
-
colorScheme,
|
|
2177
|
-
action,
|
|
2178
|
-
showFaces,
|
|
2179
|
-
share,
|
|
2180
|
-
children,
|
|
2181
|
-
width,
|
|
2182
|
-
size,
|
|
2183
|
-
kidDirectedSite,
|
|
2184
|
-
referral
|
|
2185
|
-
} = this.props;
|
|
2186
|
-
return React__default.createElement("div", {
|
|
2187
|
-
className: "fb-like",
|
|
2188
|
-
"data-ref": referral,
|
|
2189
|
-
"data-href": href,
|
|
2190
|
-
"data-layout": layout,
|
|
2191
|
-
"data-colorscheme": colorScheme,
|
|
2192
|
-
"data-action": action,
|
|
2193
|
-
"data-show-faces": showFaces,
|
|
2194
|
-
"data-share": share,
|
|
2195
|
-
"data-width": width,
|
|
2196
|
-
"data-size": size,
|
|
2197
|
-
"data-kid-directed-site": kidDirectedSite
|
|
2198
|
-
}, children);
|
|
2199
|
-
}
|
|
2200
|
-
|
|
2201
|
-
}
|
|
2202
|
-
|
|
2203
|
-
defineProperty(Like, "defaultProps", {
|
|
2204
|
-
layout: undefined,
|
|
2205
|
-
showFaces: undefined,
|
|
2206
|
-
colorScheme: undefined,
|
|
2207
|
-
action: undefined,
|
|
2208
|
-
share: undefined,
|
|
2209
|
-
size: undefined,
|
|
2210
|
-
kidDirectedSite: undefined,
|
|
2211
|
-
children: undefined,
|
|
2212
|
-
href: undefined,
|
|
2213
|
-
referral: undefined,
|
|
2214
|
-
width: undefined
|
|
2215
|
-
});
|
|
2216
|
-
|
|
2217
|
-
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
2218
|
-
handleParse
|
|
2219
|
-
}) => React__default.createElement(Like, _extends_1({}, props, {
|
|
2220
|
-
handleParse: handleParse,
|
|
2221
|
-
ref: ref
|
|
2222
|
-
}))));
|
|
2223
|
-
|
|
2224
|
-
function clearUndefinedProperties(obj) {
|
|
2225
|
-
if (!obj) {
|
|
2226
|
-
return obj;
|
|
2227
|
-
}
|
|
2228
|
-
|
|
2229
|
-
const newObj = {};
|
|
2230
|
-
Object.keys(obj).forEach(propertyName => {
|
|
2231
|
-
const value = obj[propertyName];
|
|
2232
|
-
|
|
2233
|
-
if (value !== undefined) {
|
|
2234
|
-
newObj[propertyName] = value;
|
|
2235
|
-
}
|
|
2236
|
-
});
|
|
2237
|
-
return newObj;
|
|
2238
|
-
}
|
|
2239
|
-
|
|
2240
|
-
class Process extends Component {
|
|
2241
|
-
constructor(...args) {
|
|
2242
|
-
var _this;
|
|
2243
|
-
|
|
2244
|
-
super(...args);
|
|
2245
|
-
_this = this;
|
|
2246
|
-
|
|
2247
|
-
defineProperty(this, "state", {
|
|
2248
|
-
api: undefined
|
|
2249
|
-
});
|
|
2250
|
-
|
|
2251
|
-
defineProperty(this, "handleProcess",
|
|
2252
|
-
/*#__PURE__*/
|
|
2253
|
-
function () {
|
|
2254
|
-
var _ref = asyncToGenerator(function* (fn, handleSuccess = () => {}) {
|
|
2255
|
-
_this.setState({
|
|
2256
|
-
data: undefined,
|
|
2257
|
-
error: undefined,
|
|
2258
|
-
loading: true
|
|
2259
|
-
});
|
|
2260
|
-
|
|
2261
|
-
try {
|
|
2262
|
-
const {
|
|
2263
|
-
api
|
|
2264
|
-
} = _this.state;
|
|
2265
|
-
|
|
2266
|
-
if (!api) {
|
|
2267
|
-
throw new Error('Facebook is not initialized. Wait for isReady');
|
|
2268
|
-
}
|
|
2269
|
-
|
|
2270
|
-
const data = yield fn(api);
|
|
2271
|
-
|
|
2272
|
-
_this.setState({
|
|
2273
|
-
data,
|
|
2274
|
-
loading: false
|
|
2275
|
-
}, handleSuccess);
|
|
2276
|
-
|
|
2277
|
-
return data;
|
|
2278
|
-
} catch (error) {
|
|
2279
|
-
_this.setState({
|
|
2280
|
-
error,
|
|
2281
|
-
loading: false
|
|
2282
|
-
});
|
|
2283
|
-
|
|
2284
|
-
throw error;
|
|
2285
|
-
}
|
|
2286
|
-
});
|
|
2287
|
-
|
|
2288
|
-
return function (_x) {
|
|
2289
|
-
return _ref.apply(this, arguments);
|
|
2290
|
-
};
|
|
2291
|
-
}());
|
|
2292
|
-
|
|
2293
|
-
defineProperty(this, "handleReady", api => {
|
|
2294
|
-
this.setState({
|
|
2295
|
-
api
|
|
2296
|
-
});
|
|
2297
|
-
});
|
|
2298
|
-
}
|
|
2299
|
-
|
|
2300
|
-
render() {
|
|
2301
|
-
const {
|
|
2302
|
-
children
|
|
2303
|
-
} = this.props;
|
|
2304
|
-
const {
|
|
2305
|
-
api,
|
|
2306
|
-
loading,
|
|
2307
|
-
data,
|
|
2308
|
-
error
|
|
2309
|
-
} = this.state;
|
|
2310
|
-
return React__default.createElement(Initialize$1, {
|
|
2311
|
-
onReady: this.handleReady
|
|
2312
|
-
}, children({
|
|
2313
|
-
loading: !api || loading,
|
|
2314
|
-
handleProcess: this.handleProcess,
|
|
2315
|
-
data,
|
|
2316
|
-
error
|
|
2317
|
-
}));
|
|
2318
|
-
}
|
|
2319
|
-
|
|
2320
|
-
}
|
|
2321
|
-
|
|
2322
|
-
class Send extends Component {
|
|
2323
|
-
constructor(...args) {
|
|
2324
|
-
var _this;
|
|
2325
|
-
|
|
2326
|
-
super(...args);
|
|
2327
|
-
_this = this;
|
|
2328
|
-
|
|
2329
|
-
defineProperty(this, "handleClick",
|
|
2330
|
-
/*#__PURE__*/
|
|
2331
|
-
function () {
|
|
2332
|
-
var _ref = asyncToGenerator(function* (evn) {
|
|
2333
|
-
evn.preventDefault();
|
|
2334
|
-
const {
|
|
2335
|
-
handleProcess
|
|
2336
|
-
} = _this.props;
|
|
2337
|
-
return handleProcess(
|
|
2338
|
-
/*#__PURE__*/
|
|
2339
|
-
function () {
|
|
2340
|
-
var _ref2 = asyncToGenerator(function* (api) {
|
|
2341
|
-
const {
|
|
2342
|
-
link = getCurrentHref(),
|
|
2343
|
-
display,
|
|
2344
|
-
appId = api.getAppId(),
|
|
2345
|
-
to,
|
|
2346
|
-
redirectURI
|
|
2347
|
-
} = _this.props;
|
|
2348
|
-
return api.ui(clearUndefinedProperties({
|
|
2349
|
-
method: 'send',
|
|
2350
|
-
link,
|
|
2351
|
-
display,
|
|
2352
|
-
app_id: appId,
|
|
2353
|
-
to,
|
|
2354
|
-
redirect_uri: redirectURI
|
|
2355
|
-
}));
|
|
2356
|
-
});
|
|
2357
|
-
|
|
2358
|
-
return function (_x2) {
|
|
2359
|
-
return _ref2.apply(this, arguments);
|
|
2360
|
-
};
|
|
2361
|
-
}());
|
|
2362
|
-
});
|
|
2363
|
-
|
|
2364
|
-
return function (_x) {
|
|
2365
|
-
return _ref.apply(this, arguments);
|
|
2366
|
-
};
|
|
2367
|
-
}());
|
|
2368
|
-
}
|
|
2369
|
-
|
|
2370
|
-
render() {
|
|
2371
|
-
const {
|
|
2372
|
-
children,
|
|
2373
|
-
loading
|
|
2374
|
-
} = this.props;
|
|
2375
|
-
return children({
|
|
2376
|
-
loading,
|
|
2377
|
-
handleClick: this.handleClick
|
|
2378
|
-
});
|
|
2379
|
-
}
|
|
2380
|
-
|
|
2381
|
-
}
|
|
2382
|
-
|
|
2383
|
-
defineProperty(Send, "defaultProps", {
|
|
2384
|
-
to: undefined,
|
|
2385
|
-
display: undefined,
|
|
2386
|
-
appId: undefined,
|
|
2387
|
-
redirectURI: undefined
|
|
2388
|
-
});
|
|
2389
|
-
|
|
2390
|
-
forwardRef((props, ref) => React__default.createElement(Process, null, ({
|
|
2391
|
-
loading,
|
|
2392
|
-
handleProcess
|
|
2393
|
-
}) => React__default.createElement(Send, _extends_1({}, props, {
|
|
2394
|
-
loading: loading,
|
|
2395
|
-
handleProcess: handleProcess,
|
|
2396
|
-
ref: ref
|
|
2397
|
-
}))));
|
|
2398
|
-
|
|
2399
|
-
class Share extends Component {
|
|
2400
|
-
constructor(...args) {
|
|
2401
|
-
var _this;
|
|
2402
|
-
|
|
2403
|
-
super(...args);
|
|
2404
|
-
_this = this;
|
|
2405
|
-
|
|
2406
|
-
defineProperty(this, "handleClick",
|
|
2407
|
-
/*#__PURE__*/
|
|
2408
|
-
function () {
|
|
2409
|
-
var _ref = asyncToGenerator(function* (evn) {
|
|
2410
|
-
evn.preventDefault();
|
|
2411
|
-
const {
|
|
2412
|
-
handleProcess
|
|
2413
|
-
} = _this.props;
|
|
2414
|
-
return handleProcess(
|
|
2415
|
-
/*#__PURE__*/
|
|
2416
|
-
function () {
|
|
2417
|
-
var _ref2 = asyncToGenerator(function* (api) {
|
|
2418
|
-
const {
|
|
2419
|
-
href = getCurrentHref(),
|
|
2420
|
-
display,
|
|
2421
|
-
appId = api.getAppId(),
|
|
2422
|
-
hashtag,
|
|
2423
|
-
redirectURI,
|
|
2424
|
-
quote,
|
|
2425
|
-
mobileIframe
|
|
2426
|
-
} = _this.props;
|
|
2427
|
-
return api.ui(clearUndefinedProperties({
|
|
2428
|
-
method: 'share',
|
|
2429
|
-
href,
|
|
2430
|
-
display,
|
|
2431
|
-
app_id: appId,
|
|
2432
|
-
hashtag,
|
|
2433
|
-
redirect_uri: redirectURI,
|
|
2434
|
-
quote,
|
|
2435
|
-
mobile_iframe: mobileIframe
|
|
2436
|
-
}));
|
|
2437
|
-
});
|
|
2438
|
-
|
|
2439
|
-
return function (_x2) {
|
|
2440
|
-
return _ref2.apply(this, arguments);
|
|
2441
|
-
};
|
|
2442
|
-
}());
|
|
2443
|
-
});
|
|
2444
|
-
|
|
2445
|
-
return function (_x) {
|
|
2446
|
-
return _ref.apply(this, arguments);
|
|
2447
|
-
};
|
|
2448
|
-
}());
|
|
2449
|
-
}
|
|
2450
|
-
|
|
2451
|
-
render() {
|
|
2452
|
-
const {
|
|
2453
|
-
children,
|
|
2454
|
-
loading,
|
|
2455
|
-
error,
|
|
2456
|
-
data
|
|
2457
|
-
} = this.props;
|
|
2458
|
-
return children({
|
|
2459
|
-
loading,
|
|
2460
|
-
handleClick: this.handleClick,
|
|
2461
|
-
error,
|
|
2462
|
-
data
|
|
2463
|
-
});
|
|
2464
|
-
}
|
|
2465
|
-
|
|
2466
|
-
}
|
|
2467
|
-
|
|
2468
|
-
defineProperty(Share, "defaultProps", {
|
|
2469
|
-
href: undefined,
|
|
2470
|
-
hashtag: undefined,
|
|
2471
|
-
quote: undefined,
|
|
2472
|
-
mobileIframe: undefined,
|
|
2473
|
-
display: undefined,
|
|
2474
|
-
appId: undefined,
|
|
2475
|
-
redirectURI: undefined
|
|
2476
|
-
});
|
|
2477
|
-
|
|
2478
|
-
var Share$1 = forwardRef((props, ref) => React__default.createElement(Process, null, ({
|
|
2479
|
-
loading,
|
|
2480
|
-
handleProcess,
|
|
2481
|
-
data,
|
|
2482
|
-
error
|
|
2483
|
-
}) => React__default.createElement(Share, _extends_1({}, props, {
|
|
2484
|
-
loading: loading,
|
|
2485
|
-
handleProcess: handleProcess,
|
|
2486
|
-
data: data,
|
|
2487
|
-
error: error,
|
|
2488
|
-
ref: ref
|
|
2489
|
-
}))));
|
|
2490
|
-
|
|
2491
|
-
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; }
|
|
2492
|
-
|
|
2493
|
-
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; }
|
|
2494
|
-
function ShareButton(props) {
|
|
2495
|
-
const {
|
|
2496
|
-
className,
|
|
2497
|
-
children
|
|
2498
|
-
} = props,
|
|
2499
|
-
rest = objectWithoutProperties(props, ["className", "children"]);
|
|
2500
|
-
|
|
2501
|
-
return React__default.createElement(Share$1, rest, ({
|
|
2502
|
-
loading,
|
|
2503
|
-
handleClick
|
|
2504
|
-
}) => React__default.createElement("button", {
|
|
2505
|
-
type: "button",
|
|
2506
|
-
disabled: loading,
|
|
2507
|
-
className: className,
|
|
2508
|
-
onClick: handleClick
|
|
2509
|
-
}, children));
|
|
2510
|
-
}
|
|
2511
|
-
ShareButton.defaultProps = _objectSpread$1({}, Share$1.defaultProps, {
|
|
2512
|
-
className: undefined
|
|
2513
|
-
});
|
|
2514
|
-
|
|
2515
|
-
class Page extends PureComponent {
|
|
2516
|
-
componentDidUpdate() {
|
|
2517
|
-
const {
|
|
2518
|
-
handleParse
|
|
2519
|
-
} = this.props;
|
|
2520
|
-
handleParse();
|
|
2521
|
-
}
|
|
2522
|
-
|
|
2523
|
-
render() {
|
|
2524
|
-
const {
|
|
2525
|
-
style,
|
|
2526
|
-
href = getCurrentHref(),
|
|
2527
|
-
tabs,
|
|
2528
|
-
hideCover,
|
|
2529
|
-
width,
|
|
2530
|
-
height,
|
|
2531
|
-
showFacepile,
|
|
2532
|
-
hideCTA,
|
|
2533
|
-
smallHeader,
|
|
2534
|
-
adaptContainerWidth,
|
|
2535
|
-
children
|
|
2536
|
-
} = this.props;
|
|
2537
|
-
return React__default.createElement("div", {
|
|
2538
|
-
className: "fb-page",
|
|
2539
|
-
style: style,
|
|
2540
|
-
"data-tabs": tabs,
|
|
2541
|
-
"data-hide-cover": hideCover,
|
|
2542
|
-
"data-show-facepile": showFacepile,
|
|
2543
|
-
"data-hide-cta": hideCTA,
|
|
2544
|
-
"data-href": href,
|
|
2545
|
-
"data-small-header": smallHeader,
|
|
2546
|
-
"data-adapt-container-width": adaptContainerWidth,
|
|
2547
|
-
"data-height": height,
|
|
2548
|
-
"data-width": width
|
|
2549
|
-
}, children);
|
|
2550
|
-
}
|
|
2551
|
-
|
|
2552
|
-
}
|
|
2553
|
-
|
|
2554
|
-
defineProperty(Page, "defaultProps", {
|
|
2555
|
-
width: undefined,
|
|
2556
|
-
height: undefined,
|
|
2557
|
-
tabs: undefined,
|
|
2558
|
-
hideCover: undefined,
|
|
2559
|
-
showFacepile: undefined,
|
|
2560
|
-
hideCTA: undefined,
|
|
2561
|
-
smallHeader: undefined,
|
|
2562
|
-
adaptContainerWidth: undefined,
|
|
2563
|
-
children: undefined,
|
|
2564
|
-
style: undefined,
|
|
2565
|
-
href: undefined
|
|
2566
|
-
});
|
|
2567
|
-
|
|
2568
|
-
var Page$1 = forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
2569
|
-
handleParse
|
|
2570
|
-
}) => React__default.createElement(Page, _extends_1({}, props, {
|
|
2571
|
-
handleParse: handleParse,
|
|
2572
|
-
ref: ref
|
|
2573
|
-
}))));
|
|
2574
|
-
|
|
2575
|
-
// 3.0 fields without app review https://developers.facebook.com/docs/facebook-login/permissions/?locale=en_US#reference-default
|
|
2576
|
-
var Fields = ['id', 'first_name', 'last_name', 'middle_name', 'name', 'name_format', 'picture', 'short_name', 'email'];
|
|
2577
|
-
|
|
2578
|
-
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; }
|
|
2579
|
-
|
|
2580
|
-
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; }
|
|
2581
|
-
|
|
2582
|
-
class Login extends Component {
|
|
2583
|
-
constructor(...args) {
|
|
2584
|
-
var _this;
|
|
2585
|
-
|
|
2586
|
-
super(...args);
|
|
2587
|
-
_this = this;
|
|
2588
|
-
|
|
2589
|
-
defineProperty(this, "handleClick",
|
|
2590
|
-
/*#__PURE__*/
|
|
2591
|
-
function () {
|
|
2592
|
-
var _ref = asyncToGenerator(function* (evn) {
|
|
2593
|
-
evn.preventDefault();
|
|
2594
|
-
const {
|
|
2595
|
-
handleProcess,
|
|
2596
|
-
onCompleted,
|
|
2597
|
-
onError,
|
|
2598
|
-
onSuccess
|
|
2599
|
-
} = _this.props;
|
|
2600
|
-
|
|
2601
|
-
try {
|
|
2602
|
-
yield handleProcess(
|
|
2603
|
-
/*#__PURE__*/
|
|
2604
|
-
function () {
|
|
2605
|
-
var _ref2 = asyncToGenerator(function* (api) {
|
|
2606
|
-
const {
|
|
2607
|
-
scope,
|
|
2608
|
-
fields,
|
|
2609
|
-
returnScopes,
|
|
2610
|
-
rerequest,
|
|
2611
|
-
reauthorize,
|
|
2612
|
-
eventKey
|
|
2613
|
-
} = _this.props;
|
|
2614
|
-
const loginQpts = {
|
|
2615
|
-
scope
|
|
2616
|
-
};
|
|
2617
|
-
const authType = [];
|
|
2618
|
-
|
|
2619
|
-
if (returnScopes) {
|
|
2620
|
-
loginQpts.return_scopes = true;
|
|
2621
|
-
}
|
|
2622
|
-
|
|
2623
|
-
if (rerequest) {
|
|
2624
|
-
authType.push('rerequest');
|
|
2625
|
-
}
|
|
2626
|
-
|
|
2627
|
-
if (reauthorize) {
|
|
2628
|
-
authType.push('reauthenticate');
|
|
2629
|
-
}
|
|
2630
|
-
|
|
2631
|
-
if (authType.length) {
|
|
2632
|
-
loginQpts.auth_type = authType.join(',');
|
|
2633
|
-
}
|
|
2634
|
-
|
|
2635
|
-
const loginResponse = yield api.login(loginQpts);
|
|
2636
|
-
|
|
2637
|
-
if (loginResponse.status !== 'connected') {
|
|
2638
|
-
throw new Error('Unauthorized user');
|
|
2639
|
-
}
|
|
2640
|
-
|
|
2641
|
-
const data = yield api.getTokenDetailWithProfile({
|
|
2642
|
-
fields
|
|
2643
|
-
}, loginResponse);
|
|
2644
|
-
|
|
2645
|
-
if (onCompleted) {
|
|
2646
|
-
yield onCompleted(_objectSpread$2({}, data, {
|
|
2647
|
-
eventKey
|
|
2648
|
-
}));
|
|
2649
|
-
}
|
|
2650
|
-
|
|
2651
|
-
return data;
|
|
2652
|
-
});
|
|
2653
|
-
|
|
2654
|
-
return function (_x2) {
|
|
2655
|
-
return _ref2.apply(this, arguments);
|
|
2656
|
-
};
|
|
2657
|
-
}(), onSuccess);
|
|
2658
|
-
} catch (error) {
|
|
2659
|
-
if (onError) {
|
|
2660
|
-
onError(error);
|
|
2661
|
-
}
|
|
2662
|
-
}
|
|
2663
|
-
});
|
|
2664
|
-
|
|
2665
|
-
return function (_x) {
|
|
2666
|
-
return _ref.apply(this, arguments);
|
|
2667
|
-
};
|
|
2668
|
-
}());
|
|
2669
|
-
}
|
|
2670
|
-
|
|
2671
|
-
render() {
|
|
2672
|
-
const {
|
|
2673
|
-
children,
|
|
2674
|
-
loading,
|
|
2675
|
-
error,
|
|
2676
|
-
data
|
|
2677
|
-
} = this.props;
|
|
2678
|
-
return children({
|
|
2679
|
-
loading,
|
|
2680
|
-
handleClick: this.handleClick,
|
|
2681
|
-
error,
|
|
2682
|
-
data
|
|
2683
|
-
});
|
|
2684
|
-
}
|
|
2685
|
-
|
|
2686
|
-
}
|
|
2687
|
-
|
|
2688
|
-
defineProperty(Login, "defaultProps", {
|
|
2689
|
-
scope: '',
|
|
2690
|
-
fields: Fields,
|
|
2691
|
-
returnScopes: false,
|
|
2692
|
-
rerequest: false,
|
|
2693
|
-
reauthorize: false,
|
|
2694
|
-
onCompleted: undefined,
|
|
2695
|
-
onError: undefined,
|
|
2696
|
-
eventKey: undefined
|
|
2697
|
-
});
|
|
2698
|
-
|
|
2699
|
-
var Login$1 = forwardRef((props, ref) => React__default.createElement(Process, null, ({
|
|
2700
|
-
loading,
|
|
2701
|
-
handleProcess,
|
|
2702
|
-
data,
|
|
2703
|
-
error
|
|
2704
|
-
}) => React__default.createElement(Login, _extends_1({}, props, {
|
|
2705
|
-
loading: loading,
|
|
2706
|
-
handleProcess: handleProcess,
|
|
2707
|
-
data: data,
|
|
2708
|
-
error: error,
|
|
2709
|
-
ref: ref
|
|
2710
|
-
}))));
|
|
2711
|
-
|
|
2712
|
-
var spin = createCommonjsModule(function (module) {
|
|
2713
|
-
(function (root, factory) {
|
|
2714
|
-
|
|
2715
|
-
/* CommonJS */
|
|
2716
|
-
if ( module.exports) module.exports = factory();
|
|
2717
|
-
|
|
2718
|
-
/* AMD module */
|
|
2719
|
-
else root.Spinner = factory();
|
|
2720
|
-
}(commonjsGlobal, function () {
|
|
2721
|
-
|
|
2722
|
-
var prefixes = ['webkit', 'Moz', 'ms', 'O'] /* Vendor prefixes */
|
|
2723
|
-
, animations = {} /* Animation rules keyed by their name */
|
|
2724
|
-
, useCssAnimations /* Whether to use CSS animations or setTimeout */
|
|
2725
|
-
, sheet; /* A stylesheet to hold the @keyframe or VML rules. */
|
|
2726
|
-
|
|
2727
|
-
/**
|
|
2728
|
-
* Utility function to create elements. If no tag name is given,
|
|
2729
|
-
* a DIV is created. Optionally properties can be passed.
|
|
2730
|
-
*/
|
|
2731
|
-
function createEl (tag, prop) {
|
|
2732
|
-
var el = document.createElement(tag || 'div')
|
|
2733
|
-
, n;
|
|
2734
|
-
|
|
2735
|
-
for (n in prop) el[n] = prop[n];
|
|
2736
|
-
return el
|
|
2737
|
-
}
|
|
2738
|
-
|
|
2739
|
-
/**
|
|
2740
|
-
* Appends children and returns the parent.
|
|
2741
|
-
*/
|
|
2742
|
-
function ins (parent /* child1, child2, ...*/) {
|
|
2743
|
-
for (var i = 1, n = arguments.length; i < n; i++) {
|
|
2744
|
-
parent.appendChild(arguments[i]);
|
|
2745
|
-
}
|
|
2746
|
-
|
|
2747
|
-
return parent
|
|
2748
|
-
}
|
|
2749
|
-
|
|
2750
|
-
/**
|
|
2751
|
-
* Creates an opacity keyframe animation rule and returns its name.
|
|
2752
|
-
* Since most mobile Webkits have timing issues with animation-delay,
|
|
2753
|
-
* we create separate rules for each line/segment.
|
|
2754
|
-
*/
|
|
2755
|
-
function addAnimation (alpha, trail, i, lines) {
|
|
2756
|
-
var name = ['opacity', trail, ~~(alpha * 100), i, lines].join('-')
|
|
2757
|
-
, start = 0.01 + i/lines * 100
|
|
2758
|
-
, z = Math.max(1 - (1-alpha) / trail * (100-start), alpha)
|
|
2759
|
-
, prefix = useCssAnimations.substring(0, useCssAnimations.indexOf('Animation')).toLowerCase()
|
|
2760
|
-
, pre = prefix && '-' + prefix + '-' || '';
|
|
2761
|
-
|
|
2762
|
-
if (!animations[name]) {
|
|
2763
|
-
sheet.insertRule(
|
|
2764
|
-
'@' + pre + 'keyframes ' + name + '{' +
|
|
2765
|
-
'0%{opacity:' + z + '}' +
|
|
2766
|
-
start + '%{opacity:' + alpha + '}' +
|
|
2767
|
-
(start+0.01) + '%{opacity:1}' +
|
|
2768
|
-
(start+trail) % 100 + '%{opacity:' + alpha + '}' +
|
|
2769
|
-
'100%{opacity:' + z + '}' +
|
|
2770
|
-
'}', sheet.cssRules.length);
|
|
2771
|
-
|
|
2772
|
-
animations[name] = 1;
|
|
2773
|
-
}
|
|
2774
|
-
|
|
2775
|
-
return name
|
|
2776
|
-
}
|
|
2777
|
-
|
|
2778
|
-
/**
|
|
2779
|
-
* Tries various vendor prefixes and returns the first supported property.
|
|
2780
|
-
*/
|
|
2781
|
-
function vendor (el, prop) {
|
|
2782
|
-
var s = el.style
|
|
2783
|
-
, pp
|
|
2784
|
-
, i;
|
|
2785
|
-
|
|
2786
|
-
prop = prop.charAt(0).toUpperCase() + prop.slice(1);
|
|
2787
|
-
if (s[prop] !== undefined) return prop
|
|
2788
|
-
for (i = 0; i < prefixes.length; i++) {
|
|
2789
|
-
pp = prefixes[i]+prop;
|
|
2790
|
-
if (s[pp] !== undefined) return pp
|
|
2791
|
-
}
|
|
2792
|
-
}
|
|
2793
|
-
|
|
2794
|
-
/**
|
|
2795
|
-
* Sets multiple style properties at once.
|
|
2796
|
-
*/
|
|
2797
|
-
function css (el, prop) {
|
|
2798
|
-
for (var n in prop) {
|
|
2799
|
-
el.style[vendor(el, n) || n] = prop[n];
|
|
2800
|
-
}
|
|
2801
|
-
|
|
2802
|
-
return el
|
|
2803
|
-
}
|
|
2804
|
-
|
|
2805
|
-
/**
|
|
2806
|
-
* Fills in default values.
|
|
2807
|
-
*/
|
|
2808
|
-
function merge (obj) {
|
|
2809
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
2810
|
-
var def = arguments[i];
|
|
2811
|
-
for (var n in def) {
|
|
2812
|
-
if (obj[n] === undefined) obj[n] = def[n];
|
|
2813
|
-
}
|
|
2814
|
-
}
|
|
2815
|
-
return obj
|
|
2816
|
-
}
|
|
2817
|
-
|
|
2818
|
-
/**
|
|
2819
|
-
* Returns the line color from the given string or array.
|
|
2820
|
-
*/
|
|
2821
|
-
function getColor (color, idx) {
|
|
2822
|
-
return typeof color == 'string' ? color : color[idx % color.length]
|
|
2823
|
-
}
|
|
2824
|
-
|
|
2825
|
-
// Built-in defaults
|
|
2826
|
-
|
|
2827
|
-
var defaults = {
|
|
2828
|
-
lines: 12 // The number of lines to draw
|
|
2829
|
-
, length: 7 // The length of each line
|
|
2830
|
-
, width: 5 // The line thickness
|
|
2831
|
-
, radius: 10 // The radius of the inner circle
|
|
2832
|
-
, scale: 1.0 // Scales overall size of the spinner
|
|
2833
|
-
, corners: 1 // Roundness (0..1)
|
|
2834
|
-
, color: '#000' // #rgb or #rrggbb
|
|
2835
|
-
, opacity: 1/4 // Opacity of the lines
|
|
2836
|
-
, rotate: 0 // Rotation offset
|
|
2837
|
-
, direction: 1 // 1: clockwise, -1: counterclockwise
|
|
2838
|
-
, speed: 1 // Rounds per second
|
|
2839
|
-
, trail: 100 // Afterglow percentage
|
|
2840
|
-
, fps: 20 // Frames per second when using setTimeout()
|
|
2841
|
-
, zIndex: 2e9 // Use a high z-index by default
|
|
2842
|
-
, className: 'spinner' // CSS class to assign to the element
|
|
2843
|
-
, top: '50%' // center vertically
|
|
2844
|
-
, left: '50%' // center horizontally
|
|
2845
|
-
, shadow: false // Whether to render a shadow
|
|
2846
|
-
, hwaccel: false // Whether to use hardware acceleration (might be buggy)
|
|
2847
|
-
, position: 'absolute' // Element positioning
|
|
2848
|
-
};
|
|
2849
|
-
|
|
2850
|
-
/** The constructor */
|
|
2851
|
-
function Spinner (o) {
|
|
2852
|
-
this.opts = merge(o || {}, Spinner.defaults, defaults);
|
|
2853
|
-
}
|
|
2854
|
-
|
|
2855
|
-
// Global defaults that override the built-ins:
|
|
2856
|
-
Spinner.defaults = {};
|
|
2857
|
-
|
|
2858
|
-
merge(Spinner.prototype, {
|
|
2859
|
-
/**
|
|
2860
|
-
* Adds the spinner to the given target element. If this instance is already
|
|
2861
|
-
* spinning, it is automatically removed from its previous target b calling
|
|
2862
|
-
* stop() internally.
|
|
2863
|
-
*/
|
|
2864
|
-
spin: function (target) {
|
|
2865
|
-
this.stop();
|
|
2866
|
-
|
|
2867
|
-
var self = this
|
|
2868
|
-
, o = self.opts
|
|
2869
|
-
, el = self.el = createEl(null, {className: o.className});
|
|
2870
|
-
|
|
2871
|
-
css(el, {
|
|
2872
|
-
position: o.position
|
|
2873
|
-
, width: 0
|
|
2874
|
-
, zIndex: o.zIndex
|
|
2875
|
-
, left: o.left
|
|
2876
|
-
, top: o.top
|
|
2877
|
-
});
|
|
2878
|
-
|
|
2879
|
-
if (target) {
|
|
2880
|
-
target.insertBefore(el, target.firstChild || null);
|
|
2881
|
-
}
|
|
2882
|
-
|
|
2883
|
-
el.setAttribute('role', 'progressbar');
|
|
2884
|
-
self.lines(el, self.opts);
|
|
2885
|
-
|
|
2886
|
-
if (!useCssAnimations) {
|
|
2887
|
-
// No CSS animation support, use setTimeout() instead
|
|
2888
|
-
var i = 0
|
|
2889
|
-
, start = (o.lines - 1) * (1 - o.direction) / 2
|
|
2890
|
-
, alpha
|
|
2891
|
-
, fps = o.fps
|
|
2892
|
-
, f = fps / o.speed
|
|
2893
|
-
, ostep = (1 - o.opacity) / (f * o.trail / 100)
|
|
2894
|
-
, astep = f / o.lines
|
|
2895
|
-
|
|
2896
|
-
;(function anim () {
|
|
2897
|
-
i++;
|
|
2898
|
-
for (var j = 0; j < o.lines; j++) {
|
|
2899
|
-
alpha = Math.max(1 - (i + (o.lines - j) * astep) % f * ostep, o.opacity);
|
|
2900
|
-
|
|
2901
|
-
self.opacity(el, j * o.direction + start, alpha, o);
|
|
2902
|
-
}
|
|
2903
|
-
self.timeout = self.el && setTimeout(anim, ~~(1000 / fps));
|
|
2904
|
-
})();
|
|
2905
|
-
}
|
|
2906
|
-
return self
|
|
2907
|
-
}
|
|
2908
|
-
|
|
2909
|
-
/**
|
|
2910
|
-
* Stops and removes the Spinner.
|
|
2911
|
-
*/
|
|
2912
|
-
, stop: function () {
|
|
2913
|
-
var el = this.el;
|
|
2914
|
-
if (el) {
|
|
2915
|
-
clearTimeout(this.timeout);
|
|
2916
|
-
if (el.parentNode) el.parentNode.removeChild(el);
|
|
2917
|
-
this.el = undefined;
|
|
2918
|
-
}
|
|
2919
|
-
return this
|
|
2920
|
-
}
|
|
2921
|
-
|
|
2922
|
-
/**
|
|
2923
|
-
* Internal method that draws the individual lines. Will be overwritten
|
|
2924
|
-
* in VML fallback mode below.
|
|
2925
|
-
*/
|
|
2926
|
-
, lines: function (el, o) {
|
|
2927
|
-
var i = 0
|
|
2928
|
-
, start = (o.lines - 1) * (1 - o.direction) / 2
|
|
2929
|
-
, seg;
|
|
2930
|
-
|
|
2931
|
-
function fill (color, shadow) {
|
|
2932
|
-
return css(createEl(), {
|
|
2933
|
-
position: 'absolute'
|
|
2934
|
-
, width: o.scale * (o.length + o.width) + 'px'
|
|
2935
|
-
, height: o.scale * o.width + 'px'
|
|
2936
|
-
, background: color
|
|
2937
|
-
, boxShadow: shadow
|
|
2938
|
-
, transformOrigin: 'left'
|
|
2939
|
-
, transform: 'rotate(' + ~~(360/o.lines*i + o.rotate) + 'deg) translate(' + o.scale*o.radius + 'px' + ',0)'
|
|
2940
|
-
, borderRadius: (o.corners * o.scale * o.width >> 1) + 'px'
|
|
2941
|
-
})
|
|
2942
|
-
}
|
|
2943
|
-
|
|
2944
|
-
for (; i < o.lines; i++) {
|
|
2945
|
-
seg = css(createEl(), {
|
|
2946
|
-
position: 'absolute'
|
|
2947
|
-
, top: 1 + ~(o.scale * o.width / 2) + 'px'
|
|
2948
|
-
, transform: o.hwaccel ? 'translate3d(0,0,0)' : ''
|
|
2949
|
-
, opacity: o.opacity
|
|
2950
|
-
, animation: useCssAnimations && addAnimation(o.opacity, o.trail, start + i * o.direction, o.lines) + ' ' + 1 / o.speed + 's linear infinite'
|
|
2951
|
-
});
|
|
2952
|
-
|
|
2953
|
-
if (o.shadow) ins(seg, css(fill('#000', '0 0 4px #000'), {top: '2px'}));
|
|
2954
|
-
ins(el, ins(seg, fill(getColor(o.color, i), '0 0 1px rgba(0,0,0,.1)')));
|
|
2955
|
-
}
|
|
2956
|
-
return el
|
|
2957
|
-
}
|
|
2958
|
-
|
|
2959
|
-
/**
|
|
2960
|
-
* Internal method that adjusts the opacity of a single line.
|
|
2961
|
-
* Will be overwritten in VML fallback mode below.
|
|
2962
|
-
*/
|
|
2963
|
-
, opacity: function (el, i, val) {
|
|
2964
|
-
if (i < el.childNodes.length) el.childNodes[i].style.opacity = val;
|
|
2965
|
-
}
|
|
2966
|
-
|
|
2967
|
-
});
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
function initVML () {
|
|
2971
|
-
|
|
2972
|
-
/* Utility function to create a VML tag */
|
|
2973
|
-
function vml (tag, attr) {
|
|
2974
|
-
return createEl('<' + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr)
|
|
2975
|
-
}
|
|
2976
|
-
|
|
2977
|
-
// No CSS transforms but VML support, add a CSS rule for VML elements:
|
|
2978
|
-
sheet.addRule('.spin-vml', 'behavior:url(#default#VML)');
|
|
2979
|
-
|
|
2980
|
-
Spinner.prototype.lines = function (el, o) {
|
|
2981
|
-
var r = o.scale * (o.length + o.width)
|
|
2982
|
-
, s = o.scale * 2 * r;
|
|
2983
|
-
|
|
2984
|
-
function grp () {
|
|
2985
|
-
return css(
|
|
2986
|
-
vml('group', {
|
|
2987
|
-
coordsize: s + ' ' + s
|
|
2988
|
-
, coordorigin: -r + ' ' + -r
|
|
2989
|
-
})
|
|
2990
|
-
, { width: s, height: s }
|
|
2991
|
-
)
|
|
2992
|
-
}
|
|
2993
|
-
|
|
2994
|
-
var margin = -(o.width + o.length) * o.scale * 2 + 'px'
|
|
2995
|
-
, g = css(grp(), {position: 'absolute', top: margin, left: margin})
|
|
2996
|
-
, i;
|
|
2997
|
-
|
|
2998
|
-
function seg (i, dx, filter) {
|
|
2999
|
-
ins(
|
|
3000
|
-
g
|
|
3001
|
-
, ins(
|
|
3002
|
-
css(grp(), {rotation: 360 / o.lines * i + 'deg', left: ~~dx})
|
|
3003
|
-
, ins(
|
|
3004
|
-
css(
|
|
3005
|
-
vml('roundrect', {arcsize: o.corners})
|
|
3006
|
-
, { width: r
|
|
3007
|
-
, height: o.scale * o.width
|
|
3008
|
-
, left: o.scale * o.radius
|
|
3009
|
-
, top: -o.scale * o.width >> 1
|
|
3010
|
-
, filter: filter
|
|
3011
|
-
}
|
|
3012
|
-
)
|
|
3013
|
-
, vml('fill', {color: getColor(o.color, i), opacity: o.opacity})
|
|
3014
|
-
, vml('stroke', {opacity: 0}) // transparent stroke to fix color bleeding upon opacity change
|
|
3015
|
-
)
|
|
3016
|
-
)
|
|
3017
|
-
);
|
|
3018
|
-
}
|
|
3019
|
-
|
|
3020
|
-
if (o.shadow)
|
|
3021
|
-
for (i = 1; i <= o.lines; i++) {
|
|
3022
|
-
seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)');
|
|
3023
|
-
}
|
|
3024
|
-
|
|
3025
|
-
for (i = 1; i <= o.lines; i++) seg(i);
|
|
3026
|
-
return ins(el, g)
|
|
3027
|
-
};
|
|
3028
|
-
|
|
3029
|
-
Spinner.prototype.opacity = function (el, i, val, o) {
|
|
3030
|
-
var c = el.firstChild;
|
|
3031
|
-
o = o.shadow && o.lines || 0;
|
|
3032
|
-
if (c && i + o < c.childNodes.length) {
|
|
3033
|
-
c = c.childNodes[i + o]; c = c && c.firstChild; c = c && c.firstChild;
|
|
3034
|
-
if (c) c.opacity = val;
|
|
3035
|
-
}
|
|
3036
|
-
};
|
|
3037
|
-
}
|
|
3038
|
-
|
|
3039
|
-
if (typeof document !== 'undefined') {
|
|
3040
|
-
sheet = (function () {
|
|
3041
|
-
var el = createEl('style', {type : 'text/css'});
|
|
3042
|
-
ins(document.getElementsByTagName('head')[0], el);
|
|
3043
|
-
return el.sheet || el.styleSheet
|
|
3044
|
-
}());
|
|
3045
|
-
|
|
3046
|
-
var probe = css(createEl('group'), {behavior: 'url(#default#VML)'});
|
|
3047
|
-
|
|
3048
|
-
if (!vendor(probe, 'transform') && probe.adj) initVML();
|
|
3049
|
-
else useCssAnimations = vendor(probe, 'animation');
|
|
3050
|
-
}
|
|
3051
|
-
|
|
3052
|
-
return Spinner
|
|
3053
|
-
|
|
3054
|
-
}));
|
|
3055
|
-
});
|
|
3056
|
-
|
|
3057
|
-
var dist = createCommonjsModule(function (module, exports) {
|
|
3058
|
-
|
|
3059
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3060
|
-
value: true
|
|
3061
|
-
});
|
|
3062
|
-
|
|
3063
|
-
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; }; }();
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
var _react2 = _interopRequireDefault(React__default);
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
var _propTypes2 = _interopRequireDefault(PropTypes);
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
var _spin2 = _interopRequireDefault(spin);
|
|
3076
|
-
|
|
3077
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
3078
|
-
|
|
3079
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3080
|
-
|
|
3081
|
-
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; }
|
|
3082
|
-
|
|
3083
|
-
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; }
|
|
3084
|
-
|
|
3085
|
-
var Spinner = function (_Component) {
|
|
3086
|
-
_inherits(Spinner, _Component);
|
|
3087
|
-
|
|
3088
|
-
function Spinner() {
|
|
3089
|
-
_classCallCheck(this, Spinner);
|
|
3090
|
-
|
|
3091
|
-
return _possibleConstructorReturn(this, (Spinner.__proto__ || Object.getPrototypeOf(Spinner)).apply(this, arguments));
|
|
3092
|
-
}
|
|
3093
|
-
|
|
3094
|
-
_createClass(Spinner, [{
|
|
3095
|
-
key: 'componentDidMount',
|
|
3096
|
-
value: function componentDidMount() {
|
|
3097
|
-
this.updateSpinner();
|
|
3098
|
-
}
|
|
3099
|
-
}, {
|
|
3100
|
-
key: 'componentDidUpdate',
|
|
3101
|
-
value: function componentDidUpdate() {
|
|
3102
|
-
this.updateSpinner();
|
|
3103
|
-
}
|
|
3104
|
-
}, {
|
|
3105
|
-
key: 'componentWillUnmount',
|
|
3106
|
-
value: function componentWillUnmount() {
|
|
3107
|
-
if (this.spinner) {
|
|
3108
|
-
this.spinner.stop();
|
|
3109
|
-
this.spinner = null;
|
|
3110
|
-
}
|
|
3111
|
-
}
|
|
3112
|
-
}, {
|
|
3113
|
-
key: 'updateSpinner',
|
|
3114
|
-
value: function updateSpinner() {
|
|
3115
|
-
var loaded = this.props.loaded;
|
|
3116
|
-
|
|
3117
|
-
if (!loaded && !this.spinner) {
|
|
3118
|
-
this.spinner = new _spin2.default(this.props.config);
|
|
3119
|
-
this.spinner.spin(this.refs.loader);
|
|
3120
|
-
} else if (loaded && this.spinner) {
|
|
3121
|
-
this.spinner.stop();
|
|
3122
|
-
this.spinner = null;
|
|
3123
|
-
}
|
|
3124
|
-
}
|
|
3125
|
-
}, {
|
|
3126
|
-
key: 'render',
|
|
3127
|
-
value: function render() {
|
|
3128
|
-
var _props = this.props,
|
|
3129
|
-
loaded = _props.loaded,
|
|
3130
|
-
className = _props.className;
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
if (loaded) {
|
|
3134
|
-
return this.props.children ? React__default.Children.only(this.props.children) : null;
|
|
3135
|
-
}
|
|
3136
|
-
|
|
3137
|
-
return _react2.default.createElement('div', { className: className, ref: 'loader' });
|
|
3138
|
-
}
|
|
3139
|
-
}]);
|
|
3140
|
-
|
|
3141
|
-
return Spinner;
|
|
3142
|
-
}(React__default.Component);
|
|
3143
|
-
|
|
3144
|
-
Spinner.propTypes = {
|
|
3145
|
-
className: _propTypes2.default.string,
|
|
3146
|
-
config: _propTypes2.default.object.isRequired,
|
|
3147
|
-
loaded: _propTypes2.default.bool.isRequired,
|
|
3148
|
-
children: _propTypes2.default.node
|
|
3149
|
-
};
|
|
3150
|
-
Spinner.defaultProps = {
|
|
3151
|
-
config: {},
|
|
3152
|
-
loaded: false,
|
|
3153
|
-
className: 'loader'
|
|
3154
|
-
};
|
|
3155
|
-
exports.default = Spinner;
|
|
3156
|
-
});
|
|
3157
|
-
|
|
3158
|
-
var Spinner = unwrapExports(dist);
|
|
3159
|
-
|
|
3160
|
-
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; }
|
|
3161
|
-
|
|
3162
|
-
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; }
|
|
3163
|
-
function LoginButton(props) {
|
|
3164
|
-
const {
|
|
3165
|
-
children,
|
|
3166
|
-
className,
|
|
3167
|
-
spinner,
|
|
3168
|
-
spinnerConfig
|
|
3169
|
-
} = props,
|
|
3170
|
-
rest = objectWithoutProperties(props, ["children", "className", "spinner", "spinnerConfig"]);
|
|
3171
|
-
|
|
3172
|
-
return React__default.createElement(Login$1, rest, ({
|
|
3173
|
-
loading,
|
|
3174
|
-
handleClick
|
|
3175
|
-
}) => React__default.createElement("button", {
|
|
3176
|
-
type: "button",
|
|
3177
|
-
className: className,
|
|
3178
|
-
onClick: handleClick,
|
|
3179
|
-
disabled: loading
|
|
3180
|
-
}, children, spinner && loading && React__default.createElement(Spinner, {
|
|
3181
|
-
config: spinnerConfig
|
|
3182
|
-
})));
|
|
3183
|
-
}
|
|
3184
|
-
LoginButton.defaultProps = _objectSpread$3({}, Login$1.defaultProps, {
|
|
3185
|
-
className: undefined,
|
|
3186
|
-
spinnerConfig: {},
|
|
3187
|
-
spinner: true
|
|
3188
|
-
});
|
|
3189
|
-
|
|
3190
|
-
class EmbeddedPost extends PureComponent {
|
|
3191
|
-
componentDidUpdate() {
|
|
3192
|
-
const {
|
|
3193
|
-
handleParse
|
|
3194
|
-
} = this.props;
|
|
3195
|
-
handleParse();
|
|
3196
|
-
}
|
|
3197
|
-
|
|
3198
|
-
render() {
|
|
3199
|
-
const {
|
|
3200
|
-
href,
|
|
3201
|
-
width,
|
|
3202
|
-
showText,
|
|
3203
|
-
children
|
|
3204
|
-
} = this.props;
|
|
3205
|
-
return React__default.createElement("div", {
|
|
3206
|
-
className: "fb-post",
|
|
3207
|
-
"data-href": href,
|
|
3208
|
-
"data-width": width,
|
|
3209
|
-
"data-show-text": showText
|
|
3210
|
-
}, children);
|
|
3211
|
-
}
|
|
3212
|
-
|
|
3213
|
-
}
|
|
3214
|
-
|
|
3215
|
-
defineProperty(EmbeddedPost, "defaultProps", {
|
|
3216
|
-
width: undefined,
|
|
3217
|
-
showText: undefined,
|
|
3218
|
-
children: undefined
|
|
3219
|
-
});
|
|
3220
|
-
|
|
3221
|
-
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3222
|
-
handleParse
|
|
3223
|
-
}) => React__default.createElement(EmbeddedPost, _extends_1({}, props, {
|
|
3224
|
-
handleParse: handleParse,
|
|
3225
|
-
ref: ref
|
|
3226
|
-
}))));
|
|
3227
|
-
|
|
3228
|
-
class EmbeddedVideo extends PureComponent {
|
|
3229
|
-
componentDidUpdate() {
|
|
3230
|
-
const {
|
|
3231
|
-
handleParse
|
|
3232
|
-
} = this.props;
|
|
3233
|
-
handleParse();
|
|
3234
|
-
}
|
|
3235
|
-
|
|
3236
|
-
render() {
|
|
3237
|
-
const {
|
|
3238
|
-
href,
|
|
3239
|
-
width,
|
|
3240
|
-
showText,
|
|
3241
|
-
allowFullScreen,
|
|
3242
|
-
autoPlay,
|
|
3243
|
-
showCaptions,
|
|
3244
|
-
children
|
|
3245
|
-
} = this.props;
|
|
3246
|
-
return React__default.createElement("div", {
|
|
3247
|
-
className: "fb-video",
|
|
3248
|
-
"data-href": href,
|
|
3249
|
-
"data-width": width,
|
|
3250
|
-
"data-show-text": showText,
|
|
3251
|
-
"data-show-captions": showCaptions,
|
|
3252
|
-
"data-autoplay": autoPlay,
|
|
3253
|
-
"data-allowfullscreen": allowFullScreen
|
|
3254
|
-
}, children);
|
|
3255
|
-
}
|
|
3256
|
-
|
|
3257
|
-
}
|
|
3258
|
-
|
|
3259
|
-
defineProperty(EmbeddedVideo, "defaultProps", {
|
|
3260
|
-
width: undefined,
|
|
3261
|
-
showText: undefined,
|
|
3262
|
-
allowFullScreen: undefined,
|
|
3263
|
-
autoPlay: undefined,
|
|
3264
|
-
showCaptions: undefined,
|
|
3265
|
-
children: undefined
|
|
3266
|
-
});
|
|
3267
|
-
|
|
3268
|
-
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3269
|
-
handleParse
|
|
3270
|
-
}) => React__default.createElement(EmbeddedVideo, _extends_1({}, props, {
|
|
3271
|
-
handleParse: handleParse,
|
|
3272
|
-
ref: ref
|
|
3273
|
-
}))));
|
|
3274
|
-
|
|
3275
|
-
class Comments extends PureComponent {
|
|
3276
|
-
componentDidUpdate() {
|
|
3277
|
-
const {
|
|
3278
|
-
handleParse
|
|
3279
|
-
} = this.props;
|
|
3280
|
-
handleParse();
|
|
3281
|
-
}
|
|
3282
|
-
|
|
3283
|
-
render() {
|
|
3284
|
-
const {
|
|
3285
|
-
colorScheme,
|
|
3286
|
-
href = getCurrentHref(),
|
|
3287
|
-
numPosts,
|
|
3288
|
-
orderBy,
|
|
3289
|
-
width,
|
|
3290
|
-
children,
|
|
3291
|
-
mobile
|
|
3292
|
-
} = this.props;
|
|
3293
|
-
return React__default.createElement("div", {
|
|
3294
|
-
className: "fb-comments",
|
|
3295
|
-
"data-colorscheme": colorScheme,
|
|
3296
|
-
"data-numposts": numPosts,
|
|
3297
|
-
"data-href": href,
|
|
3298
|
-
"data-order-by": orderBy,
|
|
3299
|
-
"data-width": width,
|
|
3300
|
-
"data-skin": colorScheme,
|
|
3301
|
-
"data-mobile": mobile
|
|
3302
|
-
}, children);
|
|
3303
|
-
}
|
|
3304
|
-
|
|
3305
|
-
}
|
|
3306
|
-
|
|
3307
|
-
defineProperty(Comments, "defaultProps", {
|
|
3308
|
-
href: undefined,
|
|
3309
|
-
numPosts: undefined,
|
|
3310
|
-
orderBy: undefined,
|
|
3311
|
-
width: undefined,
|
|
3312
|
-
colorScheme: undefined,
|
|
3313
|
-
children: undefined,
|
|
3314
|
-
mobile: undefined
|
|
3315
|
-
});
|
|
3316
|
-
|
|
3317
|
-
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3318
|
-
handleParse
|
|
3319
|
-
}) => React__default.createElement(Comments, _extends_1({}, props, {
|
|
3320
|
-
handleParse: handleParse,
|
|
3321
|
-
ref: ref
|
|
3322
|
-
}))));
|
|
3323
|
-
|
|
3324
|
-
class CommentsCount extends PureComponent {
|
|
3325
|
-
componentDidUpdate() {
|
|
3326
|
-
const {
|
|
3327
|
-
handleParse
|
|
3328
|
-
} = this.props;
|
|
3329
|
-
handleParse();
|
|
3330
|
-
}
|
|
3331
|
-
|
|
3332
|
-
render() {
|
|
3333
|
-
const {
|
|
3334
|
-
href = getCurrentHref(),
|
|
3335
|
-
children
|
|
3336
|
-
} = this.props;
|
|
3337
|
-
return React__default.createElement("span", {
|
|
3338
|
-
className: "fb-comments-count",
|
|
3339
|
-
"data-href": href
|
|
3340
|
-
}, children);
|
|
3341
|
-
}
|
|
3342
|
-
|
|
3343
|
-
}
|
|
3344
|
-
|
|
3345
|
-
defineProperty(CommentsCount, "defaultProps", {
|
|
3346
|
-
href: undefined,
|
|
3347
|
-
children: undefined
|
|
3348
|
-
});
|
|
3349
|
-
|
|
3350
|
-
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3351
|
-
handleParse
|
|
3352
|
-
}) => React__default.createElement(CommentsCount, _extends_1({}, props, {
|
|
3353
|
-
handleParse: handleParse,
|
|
3354
|
-
ref: ref
|
|
3355
|
-
}))));
|
|
3356
|
-
|
|
3357
|
-
class Feed extends Component {
|
|
3358
|
-
constructor(...args) {
|
|
3359
|
-
var _this;
|
|
3360
|
-
|
|
3361
|
-
super(...args);
|
|
3362
|
-
_this = this;
|
|
3363
|
-
|
|
3364
|
-
defineProperty(this, "handleClick",
|
|
3365
|
-
/*#__PURE__*/
|
|
3366
|
-
function () {
|
|
3367
|
-
var _ref = asyncToGenerator(function* (evn) {
|
|
3368
|
-
evn.preventDefault();
|
|
3369
|
-
const {
|
|
3370
|
-
handleProcess
|
|
3371
|
-
} = _this.props;
|
|
3372
|
-
return handleProcess(
|
|
3373
|
-
/*#__PURE__*/
|
|
3374
|
-
function () {
|
|
3375
|
-
var _ref2 = asyncToGenerator(function* (api) {
|
|
3376
|
-
const {
|
|
3377
|
-
link = getCurrentHref(),
|
|
3378
|
-
display,
|
|
3379
|
-
appId = api.getAppId(),
|
|
3380
|
-
redirectURI,
|
|
3381
|
-
from,
|
|
3382
|
-
to,
|
|
3383
|
-
picture,
|
|
3384
|
-
source,
|
|
3385
|
-
name,
|
|
3386
|
-
caption,
|
|
3387
|
-
description,
|
|
3388
|
-
dataRef
|
|
3389
|
-
} = _this.props;
|
|
3390
|
-
return api.ui(clearUndefinedProperties({
|
|
3391
|
-
method: 'feed',
|
|
3392
|
-
link,
|
|
3393
|
-
display,
|
|
3394
|
-
app_id: appId,
|
|
3395
|
-
redirect_uri: redirectURI,
|
|
3396
|
-
from,
|
|
3397
|
-
to,
|
|
3398
|
-
picture,
|
|
3399
|
-
source,
|
|
3400
|
-
name,
|
|
3401
|
-
caption,
|
|
3402
|
-
description,
|
|
3403
|
-
ref: dataRef
|
|
3404
|
-
}));
|
|
3405
|
-
});
|
|
3406
|
-
|
|
3407
|
-
return function (_x2) {
|
|
3408
|
-
return _ref2.apply(this, arguments);
|
|
3409
|
-
};
|
|
3410
|
-
}());
|
|
3411
|
-
});
|
|
3412
|
-
|
|
3413
|
-
return function (_x) {
|
|
3414
|
-
return _ref.apply(this, arguments);
|
|
3415
|
-
};
|
|
3416
|
-
}());
|
|
3417
|
-
}
|
|
3418
|
-
|
|
3419
|
-
render() {
|
|
3420
|
-
const {
|
|
3421
|
-
children,
|
|
3422
|
-
loading,
|
|
3423
|
-
error,
|
|
3424
|
-
data
|
|
3425
|
-
} = this.props;
|
|
3426
|
-
return children({
|
|
3427
|
-
loading,
|
|
3428
|
-
handleClick: this.handleClick,
|
|
3429
|
-
error,
|
|
3430
|
-
data
|
|
3431
|
-
});
|
|
3432
|
-
}
|
|
3433
|
-
|
|
3434
|
-
}
|
|
3435
|
-
|
|
3436
|
-
defineProperty(Feed, "defaultProps", {
|
|
3437
|
-
link: undefined,
|
|
3438
|
-
display: undefined,
|
|
3439
|
-
appId: undefined,
|
|
3440
|
-
redirectURI: undefined,
|
|
3441
|
-
from: undefined,
|
|
3442
|
-
to: undefined,
|
|
3443
|
-
source: undefined,
|
|
3444
|
-
picture: undefined,
|
|
3445
|
-
name: undefined,
|
|
3446
|
-
caption: undefined,
|
|
3447
|
-
description: undefined,
|
|
3448
|
-
dataRef: undefined
|
|
3449
|
-
});
|
|
3450
|
-
|
|
3451
|
-
forwardRef((props, ref) => React__default.createElement(Process, null, ({
|
|
3452
|
-
loading,
|
|
3453
|
-
handleProcess,
|
|
3454
|
-
error,
|
|
3455
|
-
data
|
|
3456
|
-
}) => React__default.createElement(Feed, _extends_1({}, props, {
|
|
3457
|
-
loading: loading,
|
|
3458
|
-
handleProcess: handleProcess,
|
|
3459
|
-
data: data,
|
|
3460
|
-
error: error,
|
|
3461
|
-
ref: ref
|
|
3462
|
-
}))));
|
|
3463
|
-
|
|
3464
|
-
class Group extends PureComponent {
|
|
3465
|
-
componentDidUpdate() {
|
|
3466
|
-
const {
|
|
3467
|
-
handleParse
|
|
3468
|
-
} = this.props;
|
|
3469
|
-
handleParse();
|
|
3470
|
-
}
|
|
3471
|
-
|
|
3472
|
-
render() {
|
|
3473
|
-
const {
|
|
3474
|
-
style,
|
|
3475
|
-
href = getCurrentHref(),
|
|
3476
|
-
width,
|
|
3477
|
-
showSocialContext,
|
|
3478
|
-
showMetaData,
|
|
3479
|
-
children,
|
|
3480
|
-
skin
|
|
3481
|
-
} = this.props;
|
|
3482
|
-
return React__default.createElement("div", {
|
|
3483
|
-
className: "fb-group",
|
|
3484
|
-
style: style,
|
|
3485
|
-
"data-href": href,
|
|
3486
|
-
"data-width": width,
|
|
3487
|
-
"data-show-social-context": showSocialContext,
|
|
3488
|
-
"data-show-metadata": showMetaData,
|
|
3489
|
-
"data-skin": skin
|
|
3490
|
-
}, children);
|
|
3491
|
-
}
|
|
3492
|
-
|
|
3493
|
-
}
|
|
3494
|
-
|
|
3495
|
-
defineProperty(Group, "defaultProps", {
|
|
3496
|
-
showSocialContext: undefined,
|
|
3497
|
-
showMetaData: undefined,
|
|
3498
|
-
width: undefined,
|
|
3499
|
-
children: undefined,
|
|
3500
|
-
style: undefined,
|
|
3501
|
-
href: undefined,
|
|
3502
|
-
skin: undefined
|
|
3503
|
-
});
|
|
3504
|
-
|
|
3505
|
-
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3506
|
-
handleParse
|
|
3507
|
-
}) => React__default.createElement(Group, _extends_1({}, props, {
|
|
3508
|
-
handleParse: handleParse,
|
|
3509
|
-
ref: ref
|
|
3510
|
-
}))));
|
|
3511
|
-
|
|
3512
|
-
class LoginStatus$1 extends Component {
|
|
3513
|
-
constructor(..._args) {
|
|
3514
|
-
var _this;
|
|
3515
|
-
|
|
3516
|
-
super(..._args);
|
|
3517
|
-
_this = this;
|
|
3518
|
-
|
|
3519
|
-
defineProperty(this, "state", {});
|
|
3520
|
-
|
|
3521
|
-
defineProperty(this, "handleReady",
|
|
3522
|
-
/*#__PURE__*/
|
|
3523
|
-
function () {
|
|
3524
|
-
var _ref = asyncToGenerator(function* (api) {
|
|
3525
|
-
const {
|
|
3526
|
-
event
|
|
3527
|
-
} = _this.props;
|
|
3528
|
-
|
|
3529
|
-
_this.setState({
|
|
3530
|
-
api
|
|
3531
|
-
});
|
|
3532
|
-
|
|
3533
|
-
yield api.subscribe(event, _this.handleChange);
|
|
3534
|
-
});
|
|
3535
|
-
|
|
3536
|
-
return function (_x) {
|
|
3537
|
-
return _ref.apply(this, arguments);
|
|
3538
|
-
};
|
|
3539
|
-
}());
|
|
3540
|
-
|
|
3541
|
-
defineProperty(this, "handleChange", (...args) => {
|
|
3542
|
-
const {
|
|
3543
|
-
onChange
|
|
3544
|
-
} = this.props;
|
|
3545
|
-
|
|
3546
|
-
if (onChange) {
|
|
3547
|
-
onChange(...args);
|
|
3548
|
-
}
|
|
3549
|
-
});
|
|
3550
|
-
}
|
|
3551
|
-
|
|
3552
|
-
componentWillUnmount() {
|
|
3553
|
-
const {
|
|
3554
|
-
state: {
|
|
3555
|
-
api
|
|
3556
|
-
},
|
|
3557
|
-
props: {
|
|
3558
|
-
event
|
|
3559
|
-
}
|
|
3560
|
-
} = this;
|
|
3561
|
-
|
|
3562
|
-
if (api) {
|
|
3563
|
-
api.unsubscribe(event, this.handleChange);
|
|
3564
|
-
}
|
|
3565
|
-
}
|
|
3566
|
-
|
|
3567
|
-
render() {
|
|
3568
|
-
const {
|
|
3569
|
-
children
|
|
3570
|
-
} = this.props;
|
|
3571
|
-
return React__default.createElement(Initialize$1, {
|
|
3572
|
-
onReady: this.handleReady
|
|
3573
|
-
}, children);
|
|
3574
|
-
}
|
|
3575
|
-
|
|
3576
|
-
}
|
|
3577
|
-
|
|
3578
|
-
defineProperty(LoginStatus$1, "defaultProps", {
|
|
3579
|
-
onChange: undefined
|
|
3580
|
-
});
|
|
3581
|
-
|
|
3582
|
-
class Profile extends Component {
|
|
3583
|
-
constructor(...args) {
|
|
3584
|
-
var _this;
|
|
3585
|
-
|
|
3586
|
-
super(...args);
|
|
3587
|
-
_this = this;
|
|
3588
|
-
|
|
3589
|
-
defineProperty(this, "state", {
|
|
3590
|
-
loading: true
|
|
3591
|
-
});
|
|
3592
|
-
|
|
3593
|
-
defineProperty(this, "handleReady",
|
|
3594
|
-
/*#__PURE__*/
|
|
3595
|
-
function () {
|
|
3596
|
-
var _ref = asyncToGenerator(function* (api) {
|
|
3597
|
-
_this.api = api;
|
|
3598
|
-
|
|
3599
|
-
_this.updateProfile();
|
|
3600
|
-
});
|
|
3601
|
-
|
|
3602
|
-
return function (_x) {
|
|
3603
|
-
return _ref.apply(this, arguments);
|
|
3604
|
-
};
|
|
3605
|
-
}());
|
|
3606
|
-
|
|
3607
|
-
defineProperty(this, "handleStatusChange", () => {
|
|
3608
|
-
this.updateProfile();
|
|
3609
|
-
});
|
|
3610
|
-
}
|
|
3611
|
-
|
|
3612
|
-
updateProfile() {
|
|
3613
|
-
var _this2 = this;
|
|
3614
|
-
|
|
3615
|
-
return asyncToGenerator(function* () {
|
|
3616
|
-
const {
|
|
3617
|
-
api,
|
|
3618
|
-
props: {
|
|
3619
|
-
fields
|
|
3620
|
-
}
|
|
3621
|
-
} = _this2;
|
|
3622
|
-
|
|
3623
|
-
if (!api) {
|
|
3624
|
-
return;
|
|
3625
|
-
}
|
|
3626
|
-
|
|
3627
|
-
try {
|
|
3628
|
-
const response = yield api.getLoginStatus();
|
|
3629
|
-
|
|
3630
|
-
if (response.status !== LoginStatus.CONNECTED) {
|
|
3631
|
-
_this2.setState({
|
|
3632
|
-
profile: undefined,
|
|
3633
|
-
loading: false,
|
|
3634
|
-
error: undefined
|
|
3635
|
-
});
|
|
3636
|
-
|
|
3637
|
-
return;
|
|
3638
|
-
}
|
|
3639
|
-
|
|
3640
|
-
const profile = yield api.getProfile({
|
|
3641
|
-
fields
|
|
3642
|
-
});
|
|
3643
|
-
|
|
3644
|
-
_this2.setState({
|
|
3645
|
-
profile,
|
|
3646
|
-
loading: false,
|
|
3647
|
-
error: undefined
|
|
3648
|
-
});
|
|
3649
|
-
} catch (error) {
|
|
3650
|
-
_this2.setState({
|
|
3651
|
-
profile: undefined,
|
|
3652
|
-
loading: false,
|
|
3653
|
-
error
|
|
3654
|
-
});
|
|
3655
|
-
}
|
|
3656
|
-
})();
|
|
3657
|
-
}
|
|
3658
|
-
|
|
3659
|
-
render() {
|
|
3660
|
-
const {
|
|
3661
|
-
children
|
|
3662
|
-
} = this.props;
|
|
3663
|
-
const {
|
|
3664
|
-
profile,
|
|
3665
|
-
loading,
|
|
3666
|
-
error
|
|
3667
|
-
} = this.state;
|
|
3668
|
-
return React__default.createElement(Initialize$1, {
|
|
3669
|
-
onReady: this.handleReady
|
|
3670
|
-
}, React__default.createElement(LoginStatus$1, {
|
|
3671
|
-
event: "auth.statusChange",
|
|
3672
|
-
onChange: this.handleStatusChange
|
|
3673
|
-
}, children({
|
|
3674
|
-
profile,
|
|
3675
|
-
loading,
|
|
3676
|
-
error
|
|
3677
|
-
})));
|
|
3678
|
-
}
|
|
3679
|
-
|
|
3680
|
-
}
|
|
3681
|
-
|
|
3682
|
-
defineProperty(Profile, "defaultProps", {
|
|
3683
|
-
fields: Fields
|
|
3684
|
-
});
|
|
3685
|
-
|
|
3686
|
-
class CustomChat extends PureComponent {
|
|
3687
|
-
componentDidUpdate() {
|
|
3688
|
-
const {
|
|
3689
|
-
handleParse
|
|
3690
|
-
} = this.props;
|
|
3691
|
-
handleParse();
|
|
3692
|
-
}
|
|
3693
|
-
|
|
3694
|
-
render() {
|
|
3695
|
-
const {
|
|
3696
|
-
children,
|
|
3697
|
-
pageId,
|
|
3698
|
-
themeColor,
|
|
3699
|
-
loggedInGreeting,
|
|
3700
|
-
loggedOutGreeting,
|
|
3701
|
-
dataRef,
|
|
3702
|
-
greetingDialogDisplay,
|
|
3703
|
-
greetingDialogDelay
|
|
3704
|
-
} = this.props;
|
|
3705
|
-
return React__default.createElement("div", {
|
|
3706
|
-
className: "fb-customerchat",
|
|
3707
|
-
page_id: pageId,
|
|
3708
|
-
theme_color: themeColor,
|
|
3709
|
-
logged_in_greeting: loggedInGreeting,
|
|
3710
|
-
logged_out_greeting: loggedOutGreeting,
|
|
3711
|
-
greeting_dialog_display: greetingDialogDisplay,
|
|
3712
|
-
greeting_dialog_delay: greetingDialogDelay,
|
|
3713
|
-
"data-ref": dataRef
|
|
3714
|
-
}, children);
|
|
3715
|
-
}
|
|
3716
|
-
|
|
3717
|
-
}
|
|
3718
|
-
|
|
3719
|
-
defineProperty(CustomChat, "defaultProps", {
|
|
3720
|
-
children: undefined,
|
|
3721
|
-
themeColor: undefined,
|
|
3722
|
-
loggedInGreeting: undefined,
|
|
3723
|
-
loggedOutGreeting: undefined,
|
|
3724
|
-
dataRef: undefined,
|
|
3725
|
-
greetingDialogDisplay: undefined,
|
|
3726
|
-
greetingDialogDelay: undefined
|
|
3727
|
-
});
|
|
3728
|
-
|
|
3729
|
-
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3730
|
-
handleParse
|
|
3731
|
-
}) => React__default.createElement(CustomChat, _extends_1({}, props, {
|
|
3732
|
-
handleParse: handleParse,
|
|
3733
|
-
ref: ref
|
|
3734
|
-
}))));
|
|
3735
|
-
|
|
3736
|
-
class MessageUs extends PureComponent {
|
|
3737
|
-
componentDidUpdate() {
|
|
3738
|
-
const {
|
|
3739
|
-
handleParse
|
|
3740
|
-
} = this.props;
|
|
3741
|
-
handleParse();
|
|
3742
|
-
}
|
|
3743
|
-
|
|
3744
|
-
render() {
|
|
3745
|
-
const {
|
|
3746
|
-
color,
|
|
3747
|
-
messengerAppId,
|
|
3748
|
-
pageId,
|
|
3749
|
-
children,
|
|
3750
|
-
size
|
|
3751
|
-
} = this.props;
|
|
3752
|
-
return React__default.createElement("div", {
|
|
3753
|
-
className: "fb-messengermessageus",
|
|
3754
|
-
messenger_app_id: messengerAppId,
|
|
3755
|
-
page_id: pageId,
|
|
3756
|
-
"data-color": color,
|
|
3757
|
-
"data-size": size
|
|
3758
|
-
}, children);
|
|
3759
|
-
}
|
|
3760
|
-
|
|
3761
|
-
}
|
|
3762
|
-
|
|
3763
|
-
defineProperty(MessageUs, "defaultProps", {
|
|
3764
|
-
color: undefined,
|
|
3765
|
-
size: undefined,
|
|
3766
|
-
children: undefined
|
|
3767
|
-
});
|
|
3768
|
-
|
|
3769
|
-
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3770
|
-
handleParse
|
|
3771
|
-
}) => React__default.createElement(MessageUs, _extends_1({}, props, {
|
|
3772
|
-
handleParse: handleParse,
|
|
3773
|
-
ref: ref
|
|
3774
|
-
}))));
|
|
3775
|
-
|
|
3776
|
-
class MessengerCheckbox extends PureComponent {
|
|
3777
|
-
componentDidUpdate() {
|
|
3778
|
-
const {
|
|
3779
|
-
handleParse
|
|
3780
|
-
} = this.props;
|
|
3781
|
-
handleParse();
|
|
3782
|
-
}
|
|
3783
|
-
|
|
3784
|
-
render() {
|
|
3785
|
-
const {
|
|
3786
|
-
origin,
|
|
3787
|
-
prechecked,
|
|
3788
|
-
allowLogin,
|
|
3789
|
-
userRef,
|
|
3790
|
-
messengerAppId,
|
|
3791
|
-
pageId,
|
|
3792
|
-
children,
|
|
3793
|
-
size,
|
|
3794
|
-
centerAlign,
|
|
3795
|
-
skin
|
|
3796
|
-
} = this.props;
|
|
3797
|
-
return React__default.createElement("div", {
|
|
3798
|
-
className: "fb-messenger-checkbox",
|
|
3799
|
-
messenger_app_id: messengerAppId,
|
|
3800
|
-
page_id: pageId,
|
|
3801
|
-
size: size,
|
|
3802
|
-
origin: origin,
|
|
3803
|
-
user_ref: userRef,
|
|
3804
|
-
prechecked: prechecked,
|
|
3805
|
-
allow_login: allowLogin,
|
|
3806
|
-
skin: skin,
|
|
3807
|
-
center_align: centerAlign
|
|
3808
|
-
}, children);
|
|
3809
|
-
}
|
|
3810
|
-
|
|
3811
|
-
}
|
|
3812
|
-
|
|
3813
|
-
defineProperty(MessengerCheckbox, "defaultProps", {
|
|
3814
|
-
size: undefined,
|
|
3815
|
-
allowLogin: undefined,
|
|
3816
|
-
prechecked: undefined,
|
|
3817
|
-
userRef: undefined,
|
|
3818
|
-
children: undefined,
|
|
3819
|
-
origin: undefined,
|
|
3820
|
-
skin: undefined,
|
|
3821
|
-
centerAlign: undefined
|
|
3822
|
-
});
|
|
3823
|
-
|
|
3824
|
-
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3825
|
-
handleParse
|
|
3826
|
-
}) => React__default.createElement(MessengerCheckbox, _extends_1({}, props, {
|
|
3827
|
-
handleParse: handleParse,
|
|
3828
|
-
ref: ref
|
|
3829
|
-
}))));
|
|
3830
|
-
|
|
3831
|
-
// import MessengerColor from './constants/MessengerColor';
|
|
3832
|
-
|
|
3833
|
-
class SendToMessenger extends PureComponent {
|
|
3834
|
-
componentDidUpdate() {
|
|
3835
|
-
const {
|
|
3836
|
-
handleParse
|
|
3837
|
-
} = this.props;
|
|
3838
|
-
handleParse();
|
|
3839
|
-
}
|
|
3840
|
-
|
|
3841
|
-
render() {
|
|
3842
|
-
const {
|
|
3843
|
-
color,
|
|
3844
|
-
messengerAppId,
|
|
3845
|
-
pageId,
|
|
3846
|
-
children,
|
|
3847
|
-
dataRef,
|
|
3848
|
-
size
|
|
3849
|
-
} = this.props;
|
|
3850
|
-
return React__default.createElement("div", {
|
|
3851
|
-
className: "fb-send-to-messenger",
|
|
3852
|
-
messenger_app_id: messengerAppId,
|
|
3853
|
-
page_id: pageId,
|
|
3854
|
-
"data-color": color,
|
|
3855
|
-
"data-size": size,
|
|
3856
|
-
"data-ref": dataRef
|
|
3857
|
-
}, children);
|
|
3858
|
-
}
|
|
3859
|
-
|
|
3860
|
-
}
|
|
3861
|
-
|
|
3862
|
-
defineProperty(SendToMessenger, "defaultProps", {
|
|
3863
|
-
color: undefined,
|
|
3864
|
-
size: undefined,
|
|
3865
|
-
dataRef: undefined,
|
|
3866
|
-
children: undefined
|
|
3867
|
-
});
|
|
3868
|
-
|
|
3869
|
-
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3870
|
-
handleParse
|
|
3871
|
-
}) => React__default.createElement(SendToMessenger, _extends_1({}, props, {
|
|
3872
|
-
handleParse: handleParse,
|
|
3873
|
-
ref: ref
|
|
3874
|
-
}))));
|
|
3875
|
-
|
|
3876
1172
|
var ImageSlider = function ImageSlider(props) {
|
|
3877
1173
|
var innerSlider = useRef(null);
|
|
3878
1174
|
var tile = useRef(null);
|
|
@@ -4051,8 +1347,7 @@ var PartnerDetails = function PartnerDetails(_ref) {
|
|
|
4051
1347
|
client = _ref.client,
|
|
4052
1348
|
Settings = _ref.Settings,
|
|
4053
1349
|
pageview = _ref.pageview,
|
|
4054
|
-
page = _ref.page
|
|
4055
|
-
connectWithLinkedinLogo = _ref.connectWithLinkedinLogo;
|
|
1350
|
+
page = _ref.page;
|
|
4056
1351
|
|
|
4057
1352
|
return React__default.createElement(
|
|
4058
1353
|
React__default.Fragment,
|
|
@@ -4098,23 +1393,10 @@ var PartnerDetails = function PartnerDetails(_ref) {
|
|
|
4098
1393
|
{ jsx: 'true' },
|
|
4099
1394
|
'\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 '
|
|
4100
1395
|
),
|
|
4101
|
-
|
|
1396
|
+
partnerDetails.description && React__default.createElement(
|
|
4102
1397
|
'div',
|
|
4103
1398
|
{ className: 'block-content-partners my-4', style: { maxWidth: '100%', paddingLeft: '2rem', flex: '1 1 auto' } },
|
|
4104
|
-
|
|
4105
|
-
partnerDetails.linkedin && connectWithLinkedinLogo && React__default.createElement(
|
|
4106
|
-
'a',
|
|
4107
|
-
{ href: '' + partnerDetails.linkedin + (partnerDetails.linkedin.slice(-1) === '/' ? '' : '/') + 'posts/?feedView=all', target: '_blank', rel: 'noopener noreferrer' },
|
|
4108
|
-
React__default.createElement(
|
|
4109
|
-
'div',
|
|
4110
|
-
{ className: 'embed-responsive embed-responsive-21by9' },
|
|
4111
|
-
React__default.createElement(
|
|
4112
|
-
'div',
|
|
4113
|
-
{ className: 'embed-responsive-item d-flex justify-content-center align-items-center' },
|
|
4114
|
-
React__default.createElement('img', { src: connectWithLinkedinLogo, alt: 'connect with us on LinkedIn', className: 'w-50' })
|
|
4115
|
-
)
|
|
4116
|
-
)
|
|
4117
|
-
)
|
|
1399
|
+
React__default.createElement(BlockContent, _extends({ serializers: getSerializers(client), blocks: partnerDetails.description, imageOptions: { w: 320, h: 240, fit: 'max' } }, client.config()))
|
|
4118
1400
|
)
|
|
4119
1401
|
),
|
|
4120
1402
|
partnerDetails.affiliates && partnerDetails.affiliates[0] && partnerDetails.affiliates[0].slides && React__default.createElement(
|
|
@@ -4141,20 +1423,6 @@ var PartnerDetails = function PartnerDetails(_ref) {
|
|
|
4141
1423
|
React__default.createElement(TwitterTimelineEmbed, { sourceType: 'url', url: partnerDetails.twitter, options: { height: 400 } })
|
|
4142
1424
|
)
|
|
4143
1425
|
),
|
|
4144
|
-
partnerDetails.facebook && React__default.createElement(
|
|
4145
|
-
'div',
|
|
4146
|
-
{
|
|
4147
|
-
className: 'mb-5 w-100 text-center p-3',
|
|
4148
|
-
style: {
|
|
4149
|
-
border: '2px solid #aaa',
|
|
4150
|
-
borderRadius: '15px'
|
|
4151
|
-
} },
|
|
4152
|
-
React__default.createElement(
|
|
4153
|
-
Facebook$1,
|
|
4154
|
-
{ appId: ' ' },
|
|
4155
|
-
React__default.createElement(Page$1, { href: partnerDetails.facebook, tabs: 'timeline', width: '500', height: '500' })
|
|
4156
|
-
)
|
|
4157
|
-
),
|
|
4158
1426
|
React__default.createElement(
|
|
4159
1427
|
'div',
|
|
4160
1428
|
null,
|
|
@@ -4192,7 +1460,7 @@ var PartnerDetails = function PartnerDetails(_ref) {
|
|
|
4192
1460
|
};
|
|
4193
1461
|
|
|
4194
1462
|
PartnerDetails.returnGetInitialProps = function () {
|
|
4195
|
-
var _ref2 = _asyncToGenerator
|
|
1463
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(identifier, partnerPageUrl, partnerDocumentGroupID, params, currentPage, client) {
|
|
4196
1464
|
var category = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
4197
1465
|
|
|
4198
1466
|
var today, featureQuery, partnerQuery, taxonomyQuery, _ref3, _ref4, features, partnerDetails, taxonomyDetails, articlesQuery, articles;
|
|
@@ -4203,14 +1471,14 @@ PartnerDetails.returnGetInitialProps = function () {
|
|
|
4203
1471
|
case 0:
|
|
4204
1472
|
today = moment().utc().format();
|
|
4205
1473
|
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 }';
|
|
4206
|
-
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
|
|
1474
|
+
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 }';
|
|
4207
1475
|
|
|
4208
1476
|
|
|
4209
1477
|
if (category) {
|
|
4210
1478
|
//if partners page has a sub category such as onclive
|
|
4211
1479
|
//e.g. /sap-partner/[category]/[partner]
|
|
4212
1480
|
|
|
4213
|
-
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
|
|
1481
|
+
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 }';
|
|
4214
1482
|
}
|
|
4215
1483
|
|
|
4216
1484
|
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 }';
|