@times-components/article-comments 0.42.0 → 0.42.2-alpha.11
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/CHANGELOG.md +19 -0
- package/dist/article-comments.js +6 -3
- package/dist/comment-login.js +4 -2
- package/dist/comments.js +7 -27
- package/dist/utils.js +3 -43
- package/package.json +11 -11
- package/rnw.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.43.0](https://github.com/newsuk/times-components/compare/@times-components/article-comments@0.42.1...@times-components/article-comments@0.43.0) (2024-03-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **TMRS-88:** article domain reference updates ([#3798](https://github.com/newsuk/times-components/issues/3798)) ([87289ac](https://github.com/newsuk/times-components/commit/87289ac93dfae6322a54ad49f8ce6d3df80073b2))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.42.1](https://github.com/newsuk/times-components/compare/@times-components/article-comments@0.42.0...@times-components/article-comments@0.42.1) (2024-03-11)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @times-components/article-comments
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [0.42.0](https://github.com/newsuk/times-components/compare/@times-components/article-comments@0.41.18...@times-components/article-comments@0.42.0) (2024-02-20)
|
|
7
26
|
|
|
8
27
|
|
package/dist/article-comments.js
CHANGED
|
@@ -26,7 +26,8 @@ const ArticleComments = _ref => {
|
|
|
26
26
|
isReadOnly = _ref.isReadOnly,
|
|
27
27
|
commentingConfig = _ref.commentingConfig,
|
|
28
28
|
isCommentEnabled = _ref.isCommentEnabled,
|
|
29
|
-
storefrontConfig = _ref.storefrontConfig
|
|
29
|
+
storefrontConfig = _ref.storefrontConfig,
|
|
30
|
+
domainSpecificUrl = _ref.domainSpecificUrl;
|
|
30
31
|
return isEnabled && isCommentEnabled ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_userState.default, {
|
|
31
32
|
state: _userState.default.showJoinTheConversationDialog
|
|
32
33
|
}, /*#__PURE__*/_react.default.createElement(_joinTheConversationDialog.default, {
|
|
@@ -36,7 +37,8 @@ const ArticleComments = _ref => {
|
|
|
36
37
|
}, /*#__PURE__*/_react.default.createElement(_comments.default, {
|
|
37
38
|
articleId: articleId,
|
|
38
39
|
isReadOnly: isReadOnly,
|
|
39
|
-
commentingConfig: commentingConfig
|
|
40
|
+
commentingConfig: commentingConfig,
|
|
41
|
+
domainSpecificUrl: domainSpecificUrl
|
|
40
42
|
}))) : /*#__PURE__*/_react.default.createElement(_disabledComments.default, null);
|
|
41
43
|
};
|
|
42
44
|
|
|
@@ -48,7 +50,8 @@ ArticleComments.propTypes = {
|
|
|
48
50
|
account: _propTypes.default.string.isRequired
|
|
49
51
|
}).isRequired,
|
|
50
52
|
storefrontConfig: _propTypes.default.string.isRequired,
|
|
51
|
-
isCommentEnabled: _propTypes.default.bool
|
|
53
|
+
isCommentEnabled: _propTypes.default.bool,
|
|
54
|
+
domainSpecificUrl: _propTypes.default.string.isRequired
|
|
52
55
|
};
|
|
53
56
|
ArticleComments.defaultProps = {
|
|
54
57
|
isReadOnly: false,
|
package/dist/comment-login.js
CHANGED
|
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.ssoCallback = void 0;
|
|
7
7
|
|
|
8
|
-
var _utils = require("./utils");
|
|
8
|
+
var _utils = _interopRequireDefault(require("./utils"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
11
|
|
|
10
12
|
/* eslint-env browser */
|
|
11
13
|
const loginRequest = (url, completeSSOCallback) => {
|
|
@@ -31,7 +33,7 @@ exports.ssoCallback = ssoCallback;
|
|
|
31
33
|
const executeSSOtransaction = () => {
|
|
32
34
|
if (window.SPOTIM && window.SPOTIM.startSSO) {
|
|
33
35
|
const acsTnlCookie = window && window.nuk && window.nuk.getCookieValue && window.nuk.getCookieValue("acs_tnl");
|
|
34
|
-
const cpn = "".concat((0, _utils.
|
|
36
|
+
const cpn = "".concat((0, _utils.default)(acsTnlCookie), "_v2");
|
|
35
37
|
window.SPOTIM.startSSO({
|
|
36
38
|
callback: ssoCallback,
|
|
37
39
|
userId: cpn
|
package/dist/comments.js
CHANGED
|
@@ -15,18 +15,13 @@ var _commentLogin = _interopRequireDefault(require("./comment-login"));
|
|
|
15
15
|
|
|
16
16
|
var _withTrackEvents = _interopRequireDefault(require("./tracking/with-track-events"));
|
|
17
17
|
|
|
18
|
-
var _utils = require("./utils");
|
|
19
|
-
|
|
20
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
19
|
|
|
22
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
21
|
|
|
24
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
29
|
-
|
|
24
|
+
/* eslint-env browser */
|
|
30
25
|
class Comments extends _react.Component {
|
|
31
26
|
constructor() {
|
|
32
27
|
super();
|
|
@@ -60,7 +55,8 @@ class Comments extends _react.Component {
|
|
|
60
55
|
onCommentRecommend = _this$props.onCommentRecommend,
|
|
61
56
|
onCommentNotificationClicked = _this$props.onCommentNotificationClicked,
|
|
62
57
|
onCommentUsernameClicked = _this$props.onCommentUsernameClicked,
|
|
63
|
-
onCommentSettingsClicked = _this$props.onCommentSettingsClicked
|
|
58
|
+
onCommentSettingsClicked = _this$props.onCommentSettingsClicked,
|
|
59
|
+
domainSpecificUrl = _this$props.domainSpecificUrl;
|
|
64
60
|
|
|
65
61
|
if (!this.container || !articleId || !commentingConfig) {
|
|
66
62
|
return;
|
|
@@ -101,24 +97,7 @@ class Comments extends _react.Component {
|
|
|
101
97
|
}
|
|
102
98
|
};
|
|
103
99
|
|
|
104
|
-
document.addEventListener("spot-im-current-user-typing-start",
|
|
105
|
-
var _ref = _asyncToGenerator(function* (event) {
|
|
106
|
-
onCommentStart(event);
|
|
107
|
-
const displayName = (0, _utils.getDisplayNameFromLocalStorage)();
|
|
108
|
-
if (!displayName) return;
|
|
109
|
-
const shouldShowBanner = yield (0, _utils.userShouldUpdateName)(displayName);
|
|
110
|
-
|
|
111
|
-
if (shouldShowBanner) {
|
|
112
|
-
window.dispatchEvent(new CustomEvent("SHOW_REAL_NAME_COMMENTING_BANNER", {}));
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
return function (_x) {
|
|
117
|
-
return _ref.apply(this, arguments);
|
|
118
|
-
};
|
|
119
|
-
}(), {
|
|
120
|
-
once: true
|
|
121
|
-
});
|
|
100
|
+
document.addEventListener("spot-im-current-user-typing-start", onCommentStart);
|
|
122
101
|
document.addEventListener("spot-im-current-user-sent-message", onCommentPost);
|
|
123
102
|
document.addEventListener("spot-im-notification-drop-down-link", onCommentNotification);
|
|
124
103
|
document.addEventListener("spot-im-user-up-vote-click", onCommentRecommend);
|
|
@@ -148,7 +127,7 @@ class Comments extends _react.Component {
|
|
|
148
127
|
launcherScript.setAttribute("src", "https://launcher.spot.im/spot/".concat(commentingConfig.account));
|
|
149
128
|
launcherScript.setAttribute("data-spotim-module", "spotim-launcher");
|
|
150
129
|
launcherScript.setAttribute("data-post-id", articleId);
|
|
151
|
-
launcherScript.setAttribute("data-post-url", "
|
|
130
|
+
launcherScript.setAttribute("data-post-url", "".concat(domainSpecificUrl, "/article/").concat(articleId));
|
|
152
131
|
launcherScript.setAttribute("data-seo-enabled", true);
|
|
153
132
|
launcherScript.setAttribute("data-livefyre-url", articleId);
|
|
154
133
|
this.container.appendChild(launcherScript);
|
|
@@ -223,7 +202,8 @@ Comments.propTypes = {
|
|
|
223
202
|
onCommentRecommend: _propTypes.default.func,
|
|
224
203
|
onCommentNotificationClicked: _propTypes.default.func,
|
|
225
204
|
onCommentUsernameClicked: _propTypes.default.func,
|
|
226
|
-
onCommentSettingsClicked: _propTypes.default.func
|
|
205
|
+
onCommentSettingsClicked: _propTypes.default.func,
|
|
206
|
+
domainSpecificUrl: _propTypes.default.string.isRequired
|
|
227
207
|
}; // onCommentStart and onCommentPost are added as props in order to allow this events to be tracked by analytics.
|
|
228
208
|
|
|
229
209
|
Comments.defaultProps = {
|
package/dist/utils.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
8
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
9
|
|
|
@@ -17,47 +17,6 @@ function _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "und
|
|
|
17
17
|
|
|
18
18
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
19
|
|
|
20
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
21
|
-
|
|
22
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
23
|
-
|
|
24
|
-
/* global fetch window */
|
|
25
|
-
const userShouldUpdateName = /*#__PURE__*/function () {
|
|
26
|
-
var _ref = _asyncToGenerator(function* (username) {
|
|
27
|
-
if (!username) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const url = "/api/comments/display-names-pseudonyms?username=".concat(username);
|
|
32
|
-
const checkUsername = fetch(url).then(response => response.json()).then(data => data);
|
|
33
|
-
|
|
34
|
-
const _yield$checkUsername = yield checkUsername,
|
|
35
|
-
isPseudonym = _yield$checkUsername.isPseudonym;
|
|
36
|
-
|
|
37
|
-
if (!isPseudonym) {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return isPseudonym;
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
return function userShouldUpdateName(_x) {
|
|
45
|
-
return _ref.apply(this, arguments);
|
|
46
|
-
};
|
|
47
|
-
}();
|
|
48
|
-
|
|
49
|
-
exports.userShouldUpdateName = userShouldUpdateName;
|
|
50
|
-
|
|
51
|
-
const getDisplayNameFromLocalStorage = () => {
|
|
52
|
-
const spotimUserDetails = window.localStorage.getItem("SPOTIM_CURRENT_USER");
|
|
53
|
-
if (!spotimUserDetails) return false;
|
|
54
|
-
const spotimUserDetailsJSON = spotimUserDetails && JSON.parse(spotimUserDetails);
|
|
55
|
-
const displayName = spotimUserDetailsJSON.data.displayName;
|
|
56
|
-
return displayName || false;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
exports.getDisplayNameFromLocalStorage = getDisplayNameFromLocalStorage;
|
|
60
|
-
|
|
61
20
|
const parseCookie = cookie => cookie.split("&").reduce((acc, param) => {
|
|
62
21
|
const _param$split = param.split("="),
|
|
63
22
|
_param$split2 = _slicedToArray(_param$split, 2),
|
|
@@ -70,4 +29,5 @@ const parseCookie = cookie => cookie.split("&").reduce((acc, param) => {
|
|
|
70
29
|
|
|
71
30
|
const getCpnId = cookie => cookie ? parseCookie(cookie).eid : undefined;
|
|
72
31
|
|
|
73
|
-
|
|
32
|
+
var _default = getCpnId;
|
|
33
|
+
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@times-components/article-comments",
|
|
3
|
-
"version": "0.42.
|
|
3
|
+
"version": "0.42.2-alpha.11+64700ab43f",
|
|
4
4
|
"description": "Article Comments",
|
|
5
5
|
"main": "dist/article-comments",
|
|
6
6
|
"dev": "src/article-comments",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
},
|
|
34
34
|
"homepage": "https://github.com/newsuk/times-components#readme",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@times-components/link": "3.17.
|
|
37
|
-
"@times-components/tracking": "2.22.
|
|
38
|
-
"@times-components/ts-components": "1.81.
|
|
39
|
-
"@times-components/ts-styleguide": "1.50.
|
|
40
|
-
"@times-components/user-state": "0.5.
|
|
36
|
+
"@times-components/link": "^3.17.12-alpha.82+64700ab43f",
|
|
37
|
+
"@times-components/tracking": "^2.22.12-alpha.82+64700ab43f",
|
|
38
|
+
"@times-components/ts-components": "^1.81.26-alpha.69+64700ab43f",
|
|
39
|
+
"@times-components/ts-styleguide": "^1.50.12-alpha.82+64700ab43f",
|
|
40
|
+
"@times-components/user-state": "^0.5.29-alpha.82+64700ab43f",
|
|
41
41
|
"prop-types": "15.7.2",
|
|
42
42
|
"styled-components": "4.3.2"
|
|
43
43
|
},
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"@babel/core": "7.4.4",
|
|
46
46
|
"@testing-library/jest-dom": "^5.12.0",
|
|
47
47
|
"@testing-library/react": "^12.1.2",
|
|
48
|
-
"@times-components/eslint-config-thetimes": "0.8.18",
|
|
49
|
-
"@times-components/jest-configurator-web": "0.8.1",
|
|
50
|
-
"@times-components/storybook": "4.12.
|
|
51
|
-
"@times-components/webpack-configurator": "2.1.0",
|
|
48
|
+
"@times-components/eslint-config-thetimes": "^0.8.18",
|
|
49
|
+
"@times-components/jest-configurator-web": "^0.8.1",
|
|
50
|
+
"@times-components/storybook": "^4.12.12-alpha.82+64700ab43f",
|
|
51
|
+
"@times-components/webpack-configurator": "^2.1.0",
|
|
52
52
|
"babel-jest": "24.8.0",
|
|
53
53
|
"eslint": "5.9.0",
|
|
54
54
|
"jest": "24.8.0",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "64700ab43f8980944be79412a75c65f3348896f5"
|
|
74
74
|
}
|
package/rnw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports=function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t){e.exports=require("@times-components/ts-styleguide/rnw")},function(e,t){e.exports=require("react")},function(e,t){e.exports=require("@times-components/user-state/rnw")},function(e,t){e.exports=require("styled-components")},function(e,t){e.exports=require("prop-types")},function(e,t){e.exports=require("@times-components/tracking/rnw")},function(e,t){e.exports=require("@times-components/link/rnw")},function(e,t){e.exports=require("@times-components/ts-components/rnw")},function(e,t,n){"use strict";n.r(t);var o=n(1),i=n.n(o),r=(n(4),n(2)),a=n.n(r),m=n(3),c=n.n(m),s=n(0);const l=c.a.div.withConfig({displayName:"responsive__CommentContainer",componentId:"sc-2j1dkf-0"})(["margin-left:auto;margin-right:auto;@media (min-width:","px){width:80.8%;}@media (min-width:","px){width:56.2%;}"],s.breakpoints.medium,s.breakpoints.wide),u=(c.a.p.withConfig({displayName:"responsive__CommentEnabledGuidelines",componentId:"sc-2j1dkf-1"})(["color:",";font-family:",";font-size:","px;margin:0 0 "," 0;padding-left:7px;padding-top:",";"],s.colours.functional.secondary,s.fontsWithFallback.supporting,s.fontSizes.commentsGuidelines,Object(s.spacing)(-2),Object(s.spacing)(6)),c.a.p.withConfig({displayName:"responsive__CommentDisabledGuidelines",componentId:"sc-2j1dkf-2"})(["color:",";font-family:",";font-size:","px;margin:0;padding-bottom:",";padding-top:",";text-align:center;"],s.colours.functional.secondary,s.fontsWithFallback.supporting,s.fontSizes.commentsGuidelines,Object(s.spacing)(6),Object(s.spacing)(1))),d=c.a.p.withConfig({displayName:"responsive__CommentDisabledHeadline",componentId:"sc-2j1dkf-3"})(["color:",";font-family:",";font-size:","px;margin:0;padding-bottom:",";padding-top:",";text-align:center;"],s.colours.functional.primary,s.fontsWithFallback.headline,s.fontSizes.commentsHeadline,Object(s.spacing)(1),Object(s.spacing)(6));function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var o,i,r=[],a=!0,m=!1;try{for(n=n.call(e);!(a=(o=n.next()).done)&&(r.push(o.value),!t||r.length!==t);a=!0);}catch(e){m=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(m)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function g(e,t,n,o,i,r,a){try{var m=e[r](a),c=m.value}catch(e){return void n(e)}m.done?t(c):Promise.resolve(c).then(o,i)}const C=function(){var e,t=(e=function*(e){if(!e)return!1;const t="/api/comments/display-names-pseudonyms?username=".concat(e),n=fetch(t).then(e=>e.json()).then(e=>e),o=(yield n).isPseudonym;return o||!1},function(){var t=this,n=arguments;return new Promise((function(o,i){var r=e.apply(t,n);function a(e){g(r,o,i,a,m,"next",e)}function m(e){g(r,o,i,a,m,"throw",e)}a(void 0)}))});return function(e){return t.apply(this,arguments)}}(),b=e=>e?(e=>e.split("&").reduce((e,t)=>{const n=p(t.split("="),2),o=n[0],i=n[1];return e[o]=i,e},{}))(e).eid:void 0,v=(e,t)=>((e,t)=>{const n=new XMLHttpRequest;n.addEventListener("load",()=>{const e=(200===n.status?JSON.parse(n.response):{}).spotimCodeB;e&&t(e)}),n.open("GET",e),n.send()})("/api/comments/loginv2?codeA=".concat(encodeURIComponent(e)),t);var y=()=>{if(window.SPOTIM&&window.SPOTIM.startSSO){const e=window&&window.nuk&&window.nuk.getCookieValue&&window.nuk.getCookieValue("acs_tnl"),t="".concat(b(e),"_v2");window.SPOTIM.startSSO({callback:v,userId:t})}},h=n(5);function w(e,t,n,o,i,r,a){try{var m=e[r](a),c=m.value}catch(e){return void n(e)}m.done?t(c):Promise.resolve(c).then(o,i)}class k extends o.Component{constructor(){super(),this.container=null}componentDidMount(){this.initialiseComments()}componentWillUnmount(){this.disposeComments()}initialiseComments(){const e=this.props,t=e.articleId,n=e.isReadOnly,o=e.commentingConfig,i=e.onCommentStart,r=e.onCommentPost,a=e.onCommentNotification,m=e.onCommentFilterNewest,c=e.onCommentFilterMostRecommended,s=e.onCommentFilterOldest,l=e.onCommentReplyClick,u=e.onCommentShareLink,d=e.onCommentShareTwitter,p=e.onCommentShareEmail,f=e.onCommentShareFacebook,g=e.onCommentRecommend,b=e.onCommentNotificationClicked,v=e.onCommentUsernameClicked,h=e.onCommentSettingsClicked;if(!this.container||!t||!o)return;document.addEventListener("spot-im-current-user-typing-start",function(){var e,t=(e=function*(e){i(e);const t=(()=>{const e=window.localStorage.getItem("SPOTIM_CURRENT_USER");return e&&(e&&JSON.parse(e)).data.displayName||!1})();t&&(yield C(t))&&window.dispatchEvent(new CustomEvent("SHOW_REAL_NAME_COMMENTING_BANNER",{}))},function(){var t=this,n=arguments;return new Promise((function(o,i){var r=e.apply(t,n);function a(e){w(r,o,i,a,m,"next",e)}function m(e){w(r,o,i,a,m,"throw",e)}a(void 0)}))});return function(e){return t.apply(this,arguments)}}(),{once:!0}),document.addEventListener("spot-im-current-user-sent-message",r),document.addEventListener("spot-im-notification-drop-down-link",a),document.addEventListener("spot-im-user-up-vote-click",g),document.addEventListener("spot-im-sort-by-select",e=>(e=>{switch(e.detail.sortedBy){case"best":return c(e);case"oldest":return s(e);case"newest":return m(e);default:return null}})(e)),document.addEventListener("spot-im-user-clicked-reply",l),document.addEventListener("spot-im-clicked-settings",h),document.addEventListener("spot-im-user-notifications-click",b),document.addEventListener("spot-im-open-user-profile",v),document.addEventListener("spot-im-share-type",e=>(e=>{switch(e.detail.type){case"link":return u(e);case"email":return p(e);case"twitter":return d(e);case"facebook":return f(e);default:return null}})(e)),n||(window.SPOTIM&&window.SPOTIM.startSSO?y():document.addEventListener("spot-im-api-ready",()=>{y()})),document.addEventListener("spot-im-renew-sso",()=>{y()});const k=document.createElement("script");k.setAttribute("async","async"),k.setAttribute("src","https://launcher.spot.im/spot/".concat(o.account)),k.setAttribute("data-spotim-module","spotim-launcher"),k.setAttribute("data-post-id",t),k.setAttribute("data-post-url","https://www.thetimes.co.uk/article/".concat(t)),k.setAttribute("data-seo-enabled",!0),k.setAttribute("data-livefyre-url",t),this.container.appendChild(k)}disposeComments(){this.container&&(this.container.innerHTML="")}render(){const e=this.props,t=e.onCommentStart,n=e.onCommentPost,o=e.onCommentNotification,r=e.onCommentFilterNewest,a=e.onCommentFilterMostRecommended,m=e.onCommentFilterOldest,c=e.onCommentReplyClick,s=e.onCommentShareLink,u=e.onCommentShareTwitter,d=e.onCommentShareEmail,p=e.onCommentShareFacebook,f=e.onCommentRecommend,g=e.onCommentNotificationClicked,C=e.onCommentUsernameClicked,b=e.onCommentSettingsClicked;return i.a.createElement(l,{id:"comments-container",onCommentStart:t,onCommentPost:n,onCommentNotification:o,onCommentReplyClick:c,onCommentFilterNewest:r,onCommentFilterMostRecommended:a,onCommentFilterOldest:m,onCommentShareLink:s,onCommentShareTwitter:u,onCommentShareEmail:d,onCommentShareFacebook:p,onCommentRecommend:f,onCommentNotificationClicked:g,onCommentUsernameClicked:C,onCommentSettingsClicked:b},i.a.createElement("div",{ref:e=>{this.container=e}}))}}k.defaultProps={onCommentStart:()=>{},onCommentPost:()=>{},onCommentNotification:()=>{},onCommentReplyClick:()=>{},onCommentFilterNewest:()=>{},onCommentFilterMostRecommended:()=>{},onCommentFilterOldest:()=>{},onCommentShareLink:()=>{},onCommentShareTwitter:()=>{},onCommentShareEmail:()=>{},onCommentShareFacebook:()=>{},onCommentRecommend:()=>{},onCommentNotificationClicked:()=>{},onCommentUsernameClicked:()=>{},onCommentSettingsClicked:()=>{}};var O,N=(O=k,Object(h.withTrackEvents)(O,{analyticsEvents:[{actionName:"navigation",eventName:"onCommentStart",trackingName:"spot im : comment : start"},{actionName:"navigation",eventName:"onCommentPost",trackingName:"spot im : comment : complete"},{actionName:"navigation",eventName:"onCommentNotification",trackingName:"spot im : notification"},{actionName:"navigation",eventName:"onCommentFilterNewest",trackingName:"spot im : sort : newest"},{actionName:"navigation",eventName:"onCommentFilterMostRecommended",trackingName:"spot im : sort : best"},{actionName:"navigation",eventName:"onCommentFilterOldest",trackingName:"spot im : sort : oldest"},{actionName:"navigation",eventName:"onCommentReplyClick",trackingName:"spot im : reply"},{actionName:"navigation",eventName:"onCommentSettingsClicked",trackingName:"spot im : settings button clicked"},{actionName:"navigation",eventName:"onCommentShareLink",trackingName:"spot im : comment : share : copy link"},{actionName:"navigation",eventName:"onCommentShareEmail",trackingName:"spot im : comment : share : email"},{actionName:"navigation",eventName:"onCommentShareTwitter",trackingName:"spot im : comment : share : twitter"},{actionName:"navigation",eventName:"onCommentShareFacebook",trackingName:"spot im : comment : share : facebook"},{actionName:"navigation",eventName:"onCommentRecommend",trackingName:"spot im : vote up"},{actionName:"navigation",eventName:"onCommentUsernameClicked",trackingName:"spot im : username clicked"},{actionName:"navigation",eventName:"onCommentNotificationClicked",trackingName:"spot im : notification clicked"}]})),S=n(6);function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var x={button:{marginBottom:Object(s.spacing)(0),marginTop:Object(s.spacing)(5),maxWidth:215},container:{alignItems:"center",borderStyle:"solid",borderTopColor:s.colours.functional.keyline,borderTopWidth:1,marginBottom:Object(s.spacing)(10),width:"100%"},headline:E(E({color:s.colours.functional.primary},Object(s.fontFactory)({font:"headline",fontSize:"commentsHeadline"})),{},{maxWidth:315,paddingBottom:Object(s.spacing)(2),paddingTop:Object(s.spacing)(6),textAlign:"center"}),link:{color:s.colours.functional.action},supporting:E(E({},Object(s.fontFactory)({font:"supporting",fontSize:"tertiary"})),{},{color:s.colours.functional.secondary,maxWidth:280,textAlign:"center"})};function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach((function(t){T(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var L=R(R({},x),{},{link:R(R({},x.link),{},{fontFamily:s.fontsWithFallback.supporting,fontSize:s.fontSizes.commentsGuidelines})});var M=()=>i.a.createElement(l,null,i.a.createElement(d,null,"Comments for this article have been turned off"),i.a.createElement(u,null,"Comments are subject to our community guidelines, which can be viewed"," ",i.a.createElement(S.TextLink,{style:L.link,url:"/article/f4024fbe-d989-11e6-9063-500e6740fc32"},"here"),".")),I=n(7);var _=e=>{let t=e.storefrontConfig;const n=window.nuk&&window.nuk.user&&window.nuk.user.isLightPackUser,o=n?null:t,r=n?()=>document&&document.dispatchEvent(new Event("show::upgrade::modal")):null;return i.a.createElement(I.InlineDialog,{title:"Join the conversation",buttonText:"View offers",href:o,onClick:r},"Commenting is only available to unlimited access subscribers. Upgrade your subscription to have your say.")};const A=e=>{let t=e.articleId,n=e.isEnabled,o=e.isReadOnly,r=e.commentingConfig,m=e.isCommentEnabled,c=e.storefrontConfig;return n&&m?i.a.createElement(i.a.Fragment,null,i.a.createElement(a.a,{state:a.a.showJoinTheConversationDialog},i.a.createElement(_,{storefrontConfig:c})),i.a.createElement(a.a,{state:a.a.showCommentingModule},i.a.createElement(N,{articleId:t,isReadOnly:o,commentingConfig:r}))):i.a.createElement(M,null)};A.defaultProps={isReadOnly:!1,isCommentEnabled:!0};t.default=A}]);
|
|
1
|
+
module.exports=function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t){e.exports=require("@times-components/ts-styleguide/rnw")},function(e,t){e.exports=require("react")},function(e,t){e.exports=require("@times-components/user-state/rnw")},function(e,t){e.exports=require("styled-components")},function(e,t){e.exports=require("prop-types")},function(e,t){e.exports=require("@times-components/tracking/rnw")},function(e,t){e.exports=require("@times-components/link/rnw")},function(e,t){e.exports=require("@times-components/ts-components/rnw")},function(e,t,n){"use strict";n.r(t);var o=n(1),i=n.n(o),r=(n(4),n(2)),a=n.n(r),m=n(3),c=n.n(m),s=n(0);const l=c.a.div.withConfig({displayName:"responsive__CommentContainer",componentId:"sc-2j1dkf-0"})(["margin-left:auto;margin-right:auto;@media (min-width:","px){width:80.8%;}@media (min-width:","px){width:56.2%;}"],s.breakpoints.medium,s.breakpoints.wide),d=(c.a.p.withConfig({displayName:"responsive__CommentEnabledGuidelines",componentId:"sc-2j1dkf-1"})(["color:",";font-family:",";font-size:","px;margin:0 0 "," 0;padding-left:7px;padding-top:",";"],s.colours.functional.secondary,s.fontsWithFallback.supporting,s.fontSizes.commentsGuidelines,Object(s.spacing)(-2),Object(s.spacing)(6)),c.a.p.withConfig({displayName:"responsive__CommentDisabledGuidelines",componentId:"sc-2j1dkf-2"})(["color:",";font-family:",";font-size:","px;margin:0;padding-bottom:",";padding-top:",";text-align:center;"],s.colours.functional.secondary,s.fontsWithFallback.supporting,s.fontSizes.commentsGuidelines,Object(s.spacing)(6),Object(s.spacing)(1))),u=c.a.p.withConfig({displayName:"responsive__CommentDisabledHeadline",componentId:"sc-2j1dkf-3"})(["color:",";font-family:",";font-size:","px;margin:0;padding-bottom:",";padding-top:",";text-align:center;"],s.colours.functional.primary,s.fontsWithFallback.headline,s.fontSizes.commentsHeadline,Object(s.spacing)(1),Object(s.spacing)(6));function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var o,i,r=[],a=!0,m=!1;try{for(n=n.call(e);!(a=(o=n.next()).done)&&(r.push(o.value),!t||r.length!==t);a=!0);}catch(e){m=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(m)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var g=e=>e?(e=>e.split("&").reduce((e,t)=>{const n=p(t.split("="),2),o=n[0],i=n[1];return e[o]=i,e},{}))(e).eid:void 0;const C=(e,t)=>((e,t)=>{const n=new XMLHttpRequest;n.addEventListener("load",()=>{const e=(200===n.status?JSON.parse(n.response):{}).spotimCodeB;e&&t(e)}),n.open("GET",e),n.send()})("/api/comments/loginv2?codeA=".concat(encodeURIComponent(e)),t);var b=()=>{if(window.SPOTIM&&window.SPOTIM.startSSO){const e=window&&window.nuk&&window.nuk.getCookieValue&&window.nuk.getCookieValue("acs_tnl"),t="".concat(g(e),"_v2");window.SPOTIM.startSSO({callback:C,userId:t})}},y=n(5);class v extends o.Component{constructor(){super(),this.container=null}componentDidMount(){this.initialiseComments()}componentWillUnmount(){this.disposeComments()}initialiseComments(){const e=this.props,t=e.articleId,n=e.isReadOnly,o=e.commentingConfig,i=e.onCommentStart,r=e.onCommentPost,a=e.onCommentNotification,m=e.onCommentFilterNewest,c=e.onCommentFilterMostRecommended,s=e.onCommentFilterOldest,l=e.onCommentReplyClick,d=e.onCommentShareLink,u=e.onCommentShareTwitter,p=e.onCommentShareEmail,f=e.onCommentShareFacebook,g=e.onCommentRecommend,C=e.onCommentNotificationClicked,y=e.onCommentUsernameClicked,v=e.onCommentSettingsClicked,h=e.domainSpecificUrl;if(!this.container||!t||!o)return;document.addEventListener("spot-im-current-user-typing-start",i),document.addEventListener("spot-im-current-user-sent-message",r),document.addEventListener("spot-im-notification-drop-down-link",a),document.addEventListener("spot-im-user-up-vote-click",g),document.addEventListener("spot-im-sort-by-select",e=>(e=>{switch(e.detail.sortedBy){case"best":return c(e);case"oldest":return s(e);case"newest":return m(e);default:return null}})(e)),document.addEventListener("spot-im-user-clicked-reply",l),document.addEventListener("spot-im-clicked-settings",v),document.addEventListener("spot-im-user-notifications-click",C),document.addEventListener("spot-im-open-user-profile",y),document.addEventListener("spot-im-share-type",e=>(e=>{switch(e.detail.type){case"link":return d(e);case"email":return p(e);case"twitter":return u(e);case"facebook":return f(e);default:return null}})(e)),n||(window.SPOTIM&&window.SPOTIM.startSSO?b():document.addEventListener("spot-im-api-ready",()=>{b()})),document.addEventListener("spot-im-renew-sso",()=>{b()});const k=document.createElement("script");k.setAttribute("async","async"),k.setAttribute("src","https://launcher.spot.im/spot/".concat(o.account)),k.setAttribute("data-spotim-module","spotim-launcher"),k.setAttribute("data-post-id",t),k.setAttribute("data-post-url","".concat(h,"/article/").concat(t)),k.setAttribute("data-seo-enabled",!0),k.setAttribute("data-livefyre-url",t),this.container.appendChild(k)}disposeComments(){this.container&&(this.container.innerHTML="")}render(){const e=this.props,t=e.onCommentStart,n=e.onCommentPost,o=e.onCommentNotification,r=e.onCommentFilterNewest,a=e.onCommentFilterMostRecommended,m=e.onCommentFilterOldest,c=e.onCommentReplyClick,s=e.onCommentShareLink,d=e.onCommentShareTwitter,u=e.onCommentShareEmail,p=e.onCommentShareFacebook,f=e.onCommentRecommend,g=e.onCommentNotificationClicked,C=e.onCommentUsernameClicked,b=e.onCommentSettingsClicked;return i.a.createElement(l,{id:"comments-container",onCommentStart:t,onCommentPost:n,onCommentNotification:o,onCommentReplyClick:c,onCommentFilterNewest:r,onCommentFilterMostRecommended:a,onCommentFilterOldest:m,onCommentShareLink:s,onCommentShareTwitter:d,onCommentShareEmail:u,onCommentShareFacebook:p,onCommentRecommend:f,onCommentNotificationClicked:g,onCommentUsernameClicked:C,onCommentSettingsClicked:b},i.a.createElement("div",{ref:e=>{this.container=e}}))}}v.defaultProps={onCommentStart:()=>{},onCommentPost:()=>{},onCommentNotification:()=>{},onCommentReplyClick:()=>{},onCommentFilterNewest:()=>{},onCommentFilterMostRecommended:()=>{},onCommentFilterOldest:()=>{},onCommentShareLink:()=>{},onCommentShareTwitter:()=>{},onCommentShareEmail:()=>{},onCommentShareFacebook:()=>{},onCommentRecommend:()=>{},onCommentNotificationClicked:()=>{},onCommentUsernameClicked:()=>{},onCommentSettingsClicked:()=>{}};var h,k=(h=v,Object(y.withTrackEvents)(h,{analyticsEvents:[{actionName:"navigation",eventName:"onCommentStart",trackingName:"spot im : comment : start"},{actionName:"navigation",eventName:"onCommentPost",trackingName:"spot im : comment : complete"},{actionName:"navigation",eventName:"onCommentNotification",trackingName:"spot im : notification"},{actionName:"navigation",eventName:"onCommentFilterNewest",trackingName:"spot im : sort : newest"},{actionName:"navigation",eventName:"onCommentFilterMostRecommended",trackingName:"spot im : sort : best"},{actionName:"navigation",eventName:"onCommentFilterOldest",trackingName:"spot im : sort : oldest"},{actionName:"navigation",eventName:"onCommentReplyClick",trackingName:"spot im : reply"},{actionName:"navigation",eventName:"onCommentSettingsClicked",trackingName:"spot im : settings button clicked"},{actionName:"navigation",eventName:"onCommentShareLink",trackingName:"spot im : comment : share : copy link"},{actionName:"navigation",eventName:"onCommentShareEmail",trackingName:"spot im : comment : share : email"},{actionName:"navigation",eventName:"onCommentShareTwitter",trackingName:"spot im : comment : share : twitter"},{actionName:"navigation",eventName:"onCommentShareFacebook",trackingName:"spot im : comment : share : facebook"},{actionName:"navigation",eventName:"onCommentRecommend",trackingName:"spot im : vote up"},{actionName:"navigation",eventName:"onCommentUsernameClicked",trackingName:"spot im : username clicked"},{actionName:"navigation",eventName:"onCommentNotificationClicked",trackingName:"spot im : notification clicked"}]})),w=n(6);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){N(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function N(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var j={button:{marginBottom:Object(s.spacing)(0),marginTop:Object(s.spacing)(5),maxWidth:215},container:{alignItems:"center",borderStyle:"solid",borderTopColor:s.colours.functional.keyline,borderTopWidth:1,marginBottom:Object(s.spacing)(10),width:"100%"},headline:S(S({color:s.colours.functional.primary},Object(s.fontFactory)({font:"headline",fontSize:"commentsHeadline"})),{},{maxWidth:315,paddingBottom:Object(s.spacing)(2),paddingTop:Object(s.spacing)(6),textAlign:"center"}),link:{color:s.colours.functional.action},supporting:S(S({},Object(s.fontFactory)({font:"supporting",fontSize:"tertiary"})),{},{color:s.colours.functional.secondary,maxWidth:280,textAlign:"center"})};function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){x(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var F=P(P({},j),{},{link:P(P({},j.link),{},{fontFamily:s.fontsWithFallback.supporting,fontSize:s.fontSizes.commentsGuidelines})});var T=()=>i.a.createElement(l,null,i.a.createElement(u,null,"Comments for this article have been turned off"),i.a.createElement(d,null,"Comments are subject to our community guidelines, which can be viewed"," ",i.a.createElement(w.TextLink,{style:F.link,url:"/article/f4024fbe-d989-11e6-9063-500e6740fc32"},"here"),".")),L=n(7);var R=e=>{let t=e.storefrontConfig;const n=window.nuk&&window.nuk.user&&window.nuk.user.isLightPackUser,o=n?null:t,r=n?()=>document&&document.dispatchEvent(new Event("show::upgrade::modal")):null;return i.a.createElement(L.InlineDialog,{title:"Join the conversation",buttonText:"View offers",href:o,onClick:r},"Commenting is only available to unlimited access subscribers. Upgrade your subscription to have your say.")};const I=e=>{let t=e.articleId,n=e.isEnabled,o=e.isReadOnly,r=e.commentingConfig,m=e.isCommentEnabled,c=e.storefrontConfig,s=e.domainSpecificUrl;return n&&m?i.a.createElement(i.a.Fragment,null,i.a.createElement(a.a,{state:a.a.showJoinTheConversationDialog},i.a.createElement(R,{storefrontConfig:c})),i.a.createElement(a.a,{state:a.a.showCommentingModule},i.a.createElement(k,{articleId:t,isReadOnly:o,commentingConfig:r,domainSpecificUrl:s}))):i.a.createElement(T,null)};I.defaultProps={isReadOnly:!1,isCommentEnabled:!0};t.default=I}]);
|